1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Merge pull request #141 from nats-io/aricart-patch-1

updated documentation to mem-resolver generation
This commit is contained in:
Ginger Collison 2020-08-16 14:28:08 -05:00 committed by GitHub
commit f721dd64aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,12 +52,11 @@ Success! - added user "TA" to "A"
## Create the Server Config ## Create the Server Config
The `nsc` tool can generate a configuration file automatically. You provide a path to the server configuration and operator jwt. The `nsc` tool will copy the operator JWT to the file specified, and generate the server config for you: The `nsc` tool can generate a configuration file automatically. You provide a path to the server configuration. The `nsc` tool will generate the server config for you:
```text ```text
> nsc generate config --mem-resolver --config-file /tmp/server.conf --operator-jwt /tmp/memory.jwt > nsc generate config --mem-resolver --config-file /tmp/server.conf
Success!! - generated "/tmp/server.conf" Success!! - generated "/tmp/server.conf"
generated "/tmp/memory.jwt"
``` ```
If you require additional settings, you may want to consider using [`include`](../../#include-directive) in your main configuration, to reference the generated files. Otherwise, you can start a server and reference the generated configuration: If you require additional settings, you may want to consider using [`include`](../../#include-directive) in your main configuration, to reference the generated files. Otherwise, you can start a server and reference the generated configuration:
@ -70,7 +69,7 @@ You can then [test it](mem_resolver.md#testing-the-configuration).
## Manual Server Config ## Manual Server Config
While generating a configuration file is easy, you may want to craft one by hand to know the details. With the entities created, and a standard location for the `.nsc` directory. You can reference the operator JWT and the account JWT in a server configuration. Remember that your configuration will be in `$NSC_HOME/nats/<operator_name>/<operator_name>.jwt` for the operator. The account JWT will be in `$NSC_HOME/nats/<operator_name>/accounts/<account_name>/<account_name>.jwt` While generating a configuration file is easy, you may want to craft one by hand to know the details. With the entities created, and a standard location for the `.nsc` directory. You can reference the operator JWT and the account JWT in a server configuration or the JWT string directly. Remember that your configuration will be in `$NSC_HOME/nats/<operator_name>/<operator_name>.jwt` for the operator. The account JWT will be in `$NSC_HOME/nats/<operator_name>/accounts/<account_name>/<account_name>.jwt`
For the configuration you'll need: For the configuration you'll need:
@ -80,7 +79,7 @@ For the configuration you'll need:
The format of the file is: The format of the file is:
```text ```text
operator: <path to the operator jwt> operator: <path to the operator jwt or jwt itself>
resolver: MEMORY resolver: MEMORY
resolver_preload: { resolver_preload: {
<public key for an account>: <contents of the account jwt> <public key for an account>: <contents of the account jwt>