The full name of Dapr is "Distributed Application Runtime", which is the "Distributed Application Runtime". Dapr is an open-source project initiated by Microsoft and is currently part of the CNCF Incubator Project.
Any language, any framework, anywhere
The Distributed Application Runtime (DAPR) provides APIs that simplify microservice connectivity. Whether your communication mode is service-to-service call or publish/subscribe messaging, Dapr can help you write resilient and secure microservices.
By letting Dapr's sidecar handle complex challenges like service discovery, message broker integration, encryption, observability, and secrets management, you can focus on your business logic and keep your code simple. Each of the building blocks APIs is independent, meaning you can use one, some or all of them in your application. The following building blocks can be used:
| subassembly | description | | The hyperlink login is visible. | Elastic service-to-service calls support method calls on remote services, including retries, regardless of where they are located in a supported hosting environment. | | The hyperlink login is visible. | With state management for storing and querying key/value pairs, you can easily write long-running, highly available, stateful and stateless services in your application. State stores are pluggable, and examples include AWS DynamoDB, Azure CosmosDB, Azure SQL Server, GCP Firebase, PostgreSQL, or Redis, among others. | | The hyperlink login is visible. | Publishing events and subscription topics between services enables an event-driven architecture to simplify horizontal scalability and enable it to adapt to failures. Dapr offers at-least-once messaging guarantees, message TTL, consumer groups, and other advanced features. | | The hyperlink login is visible. | Resource binding with triggers is further built on an event-driven architecture that enables scale and resiliency by receiving and sending events from any external source, such as databases, queues, file systems, etc. | | The hyperlink login is visible. | Patterns for stateful and stateless objects that make concurrency simple through methods and state encapsulation. Dapr provides a number of features during its Actor runtime, including concurrency, state, and lifecycle management for Actor activation/deactivation, as well as timers and reminders to wake up Actors. | | The hyperlink login is visible. | Dapr issues metrics, logs, and traces to debug and monitor Dapr and user applications. Dapr supports distributed tracing, using the W3C Trace Context standard and Open Telemetry to easily diagnose and service inter-service calls in production to be sent to different monitoring tools. | | The hyperlink login is visible. | The Secrets Management API integrates with public cloud and on-premises secret storage to retrieve secrets for use in application code. | | The hyperlink login is visible. | The Configuration API enables you to retrieve and subscribe to application configuration items from the configuration store. | | The hyperlink login is visible. | The Distributed Locks API enables your application to acquire a lock for any resource that provides it with exclusive access until the lock is released by the application or a lease timeout occurs. |
Official Website:The hyperlink login is visible. Documentation:The hyperlink login is visible. Dapr for .NET developers:The hyperlink login is visible.
Dapr offers a variety of SDKs and frameworks, making it easy to start developing with Dapr in your preferred language.
To make using Dapr more natural for different languages, it also includes language-specific SDKs for:
- C++
- Go
- Java
- JavaScript
- .NET
- PHP
- Python
- Rust
Linux installs the Dapr distributed runtime
Install the Dapr CLI
First, prepare a server for CentOS 7 system, due to domestic environmental problems, please use the following command to manually install dapr-cli:
Verify the installation
Install the Docker service
Install the Docker service on the system, slightly (Docker is required for the recommended development environment.) While you can initialize Dapr without relying on Docker, some subsequent development is built on top of Docker. )
Initialize Dapr
Use the CLI to initialize Dapr on your local machine.
Dapr runs as a sidecar with your app. In self-hosted mode, this means that it is a process on your local computer. By initializing Dapr, you:
- Get and install the Dapr sidecar binary locally.
- Use Dapr to create a development environment that simplifies application development.
Dapr initialization includes:
- Run a Redis container instance to use as a local state store and message broker.
- Run a Zipkin container instance for observability.
- Use the above component definitions to create a default component folder.
- Run Dapr to place a service container instance for local participant support.
By default, Dapr initialization downloads the binary and pulls images from the network to set up the development environment. However, Dapr also supports offline installation with pre-downloaded artifacts, as the Domestic environmental problems, initialization requires offline installation, download the daprbundle_linux_amd64.tar.gz file,/root directory。
Download Address:The hyperlink login is visible.
The command is as follows:
Verify the Dapr version
The CLI also creates a default component folder with multiple YAML files that contain definitions for state stores, pub/subs, and zipkins. Dapr sidecar will read these components and use:
The command is as follows:
Install Dapr Dashboard
The Dapr Dashboard provides information about Dapr applications, components, configurations, and control plane services. Users can view metadata, manifest and deployment files, contributors, logs, and more on Kubernetes and self-hosted platforms.
The command is as follows:
Background runs:
(End)
|