mirror of https://github.com/dapr/docs.git
Add docs for dapr init without docker (#665)
* Add docs for dapr init without docker * Update docs for enabling statestore and actors without docker * Update README.md * Update README.md * Update README.md * Update readme * Update README.md * Update environment-setup.md * Update README.md * Update README.md * Removing slim init instructions * Simplifying self hosted mode section * Minor language changes Co-authored-by: Mark Fussell <mfussell@microsoft.com> Co-authored-by: Ori Zohar <orzohar@microsoft.com>
This commit is contained in:
parent
b8ac9497f0
commit
d60e951309
|
@ -6,11 +6,13 @@ Dapr can be run in either self hosted or Kubernetes modes. Running Dapr runtime
|
|||
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Installing Dapr CLI](#installing-dapr-cli)
|
||||
- [Installing Dapr in standalone mode](#installing-dapr-in-standalone-mode)
|
||||
- [Installing Dapr in self-hosted mode](#installing-dapr-in-self-hosted-mode)
|
||||
- [Installing Dapr on Kubernetes cluster](#installing-dapr-on-a-kubernetes-cluster)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
On default Dapr will install with a developer environment using Docker containers to get you started easily. However, Dapr does not depend on Docker to run (see [here](https://github.com/dapr/cli/blob/master/README.md) for instructions on installing Dapr locally without Docker using slim init). This getting started guide assumes Dapr is installed along with this developer environment.
|
||||
|
||||
- Install [Docker](https://docs.docker.com/install/)
|
||||
|
||||
> For Windows user, ensure that `Docker Desktop For Windows` uses Linux containers.
|
||||
|
@ -61,9 +63,11 @@ Each release of Dapr CLI includes various OSes and architectures. These binary v
|
|||
|
||||
## Installing Dapr in self hosted mode
|
||||
|
||||
### Install Dapr runtime using the CLI
|
||||
### Initialize Dapr using the CLI
|
||||
|
||||
Install Dapr by running `dapr init` from a command prompt
|
||||
On default, during initialization the Dapr CLI will install the Dapr binaries as well as setup a developer environment to help you get started easily with Dapr. This environment uses Docker containers, therefore Docker is listed as a prerequisite.
|
||||
|
||||
>If you prefer to run Dapr without this environment and no dependency on Docker, see the CLI documentation for usage of the `--slim` flag with the init CLI command [here](https://github.com/dapr/cli/blob/master/README.md). Note, if you are a new user, it is strongly recommended to intall Docker and use the regular init command.
|
||||
|
||||
> For Linux users, if you run your docker cmds with sudo, you need to use "**sudo dapr init**"
|
||||
> For Windows users, make sure that you run the cmd terminal in administrator mode
|
||||
|
@ -82,7 +86,7 @@ If you prefer you can also install to an alternate location by using `--install-
|
|||
$ dapr init --install-path /home/user123/mydaprinstall
|
||||
```
|
||||
|
||||
To see that Dapr has been installed successful, from a command prompt run the `docker ps` command and check that the `daprio/dapr:latest` and `redis` container images are both running.
|
||||
To see that Dapr has been installed successfully, from a command prompt run the `docker ps` command and check that the `daprio/dapr:latest` and `redis` container images are both running.
|
||||
|
||||
### Install a specific runtime version
|
||||
|
||||
|
@ -98,9 +102,9 @@ cli version: v0.1.0
|
|||
runtime version: v0.1.0
|
||||
```
|
||||
|
||||
### Uninstall Dapr in a standalone mode
|
||||
### Uninstall Dapr in a self hosted mode
|
||||
|
||||
Uninstalling removes the Placement service container.
|
||||
Uninstalling removes the Placement service container or the Placement service binary.
|
||||
|
||||
```bash
|
||||
$ dapr uninstall
|
||||
|
@ -111,7 +115,13 @@ It won't remove the Redis or Zipkin containers by default in case you were using
|
|||
$ dapr uninstall --all
|
||||
```
|
||||
|
||||
You should always run `dapr uninstall` before running another `dapr init`.
|
||||
**You should always run `dapr uninstall` before running another `dapr init`.**
|
||||
|
||||
To specify a custom install path from which you have to uninstall run:
|
||||
|
||||
```bash
|
||||
$ dapr uninstall --install-path /path/to/binary
|
||||
```
|
||||
|
||||
## Installing Dapr on a Kubernetes cluster
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
|
|||
value: lhDOkwTlp0
|
||||
```
|
||||
|
||||
### Option 2: Creating an managed Azure Cache for Redis service
|
||||
### Option 2: Creating an Azure Cache for Redis service
|
||||
|
||||
> **Note**: This approach requires having an Azure Subscription.
|
||||
|
||||
|
@ -138,7 +138,9 @@ kubectl apply -f redis-state.yaml
|
|||
kubectl apply -f redis-pubsub.yaml
|
||||
```
|
||||
|
||||
### Standalone
|
||||
### Self Hosted Mode
|
||||
|
||||
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. However, if you want to configure a different Redis instance, create a `components` dir containing the YAML file and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
If you initialized Dapr using `dapr init --slim`, the Dapr CLI did not create a Redis instance or a default configuration file for it. Follow [these instructions](#Creating-a-Redis-Store) to create a Redis store. Create the `redis.yaml` following the configuration [instructions](#Configuration) in a `components` dir and provide the path to the `dapr run` command with the flag `--components-path`.
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
# Self hosted mode without containers
|
||||
|
||||
This article provides guidance on running Dapr in self-hosted mode without Docker.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Dapr CLI](../../getting-started/environment-setup.md#installing-dapr-cli)
|
||||
|
||||
## Initialize Dapr without containers
|
||||
|
||||
The Dapr CLI provides an option to initialize Dapr using slim init, without the default creation of a development environment which has a dependency on Docker. To initialize Dapr with slim init, after installing the Dapr CLI use the following command:
|
||||
|
||||
```bash
|
||||
dapr init --slim
|
||||
```
|
||||
|
||||
In this mode two different binaries are installed `daprd` and `placement`. The `placement` binary is needed to enable [actors](../../concepts/actors/README.md) in a Dapr self-hosted installation.
|
||||
|
||||
In this mode no default components such as Redis are installed for state managment or pub/sub. This means, that aside from [Service Invocation](../../concepts/service-invocation/README.md), no other building block functionality is availble on install out of the box. Users are free to setup their own environemnt and custom components. Furthermore, actor based service invocation is possible if a statestore is configured as explained in the following sections.
|
||||
|
||||
## Service invocation
|
||||
See [this sample](https://github.com/dapr/samples/tree/master/11.hello-dapr-slim) for an example on how to perform service invocation in this mode.
|
||||
|
||||
## Enabling state management or pub/sub
|
||||
|
||||
See configuring Redis in self hosted mode [without docker](../../howto/configure-redis/README.md#Self-Hosted-Mode-without-Containers) to enable a local state store or pub/sub broker for messaging.
|
||||
|
||||
## Enabling actors
|
||||
|
||||
The placement service must be run locally to enable actor placement. Also a [transactoinal state store](#Enabling-state-management-or-pub/sub) must be enabled for actors.
|
||||
|
||||
By default for Linux/MacOS the `placement` binary is installed in `/usr/local/bin` or for Windows at `c:\dapr`.
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/placement
|
||||
|
||||
INFO[0000] starting Dapr Placement Service -- version 0.8.0 -- commit 74db927 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] log level set to: info instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] metrics server started on :9090/ instance=host.localhost.name scope=dapr.metrics type=log ver=0.8.0
|
||||
INFO[0000] placement Service started on port 50005 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0000] Healthz server is listening on :8080 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
|
||||
```
|
||||
|
||||
From here on you can follow the sample example created for the [java-sdk](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors/http), [python-sdk](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor) or [dotnet-sdk](https://github.com/dapr/dotnet-sdk/tree/master/samples/Actor) for running an application with Actors enabled.
|
||||
|
||||
Update the state store configuration files to have the Redis host and password match the setup that you have. Additionally to enable it as a actor state store have the metadata piece added similar to the [sample Java Redis component](https://github.com/dapr/java-sdk/blob/master/examples/components/redis.yaml) definition.
|
||||
|
||||
```yaml
|
||||
- name: actorStateStore
|
||||
value: "true"
|
||||
```
|
||||
|
||||
The logs of the placement service are updated whenever a host that uses actors is added or removed similar to the following output:
|
||||
|
||||
```
|
||||
INFO[0446] host added: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
INFO[0450] host removed: 192.168.1.6 instance=host.localhost.name scope=dapr.placement type=log ver=0.8.0
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
Follow the uninstall [instructions](../../getting-started/environment-setup.md#Uninstall-Dapr-in-self-hosted-mode-(without-docker)) to remove the binaries.
|
Loading…
Reference in New Issue