Remove admin:admin default and update instructions for demo setup (#5887)

* Update some admin:admin references

Signed-off-by: Derek Ho <dxho@amazon.com>

* Update all references except for helm

Signed-off-by: Derek Ho <dxho@amazon.com>

* Update helm

Signed-off-by: Derek Ho <dxho@amazon.com>

* Reverts changes made to _install-and-configure folder

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>

* Apply suggestions from code review

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: Derek Ho <derek01778@gmail.com>

* Update _about/quickstart.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update quickstart.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Derek Ho <derek01778@gmail.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Darshit Chanpura <dchanp@amazon.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
This commit is contained in:
Derek Ho 2024-02-01 14:01:58 -05:00 committed by GitHub
parent 796008b330
commit 6af66500eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 54 additions and 52 deletions

View File

@ -52,9 +52,9 @@ You'll need a special file, called a Compose file, that Docker Compose uses to d
opensearch-node1 "./opensearch-docker…" opensearch-node1 running 0.0.0.0:9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, 9650/tcp opensearch-node1 "./opensearch-docker…" opensearch-node1 running 0.0.0.0:9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, 9650/tcp
opensearch-node2 "./opensearch-docker…" opensearch-node2 running 9200/tcp, 9300/tcp, 9600/tcp, 9650/tcp opensearch-node2 "./opensearch-docker…" opensearch-node2 running 9200/tcp, 9300/tcp, 9600/tcp, 9650/tcp
``` ```
1. Query the OpenSearch REST API to verify that the service is running. You should use `-k` (also written as `--insecure`) to disable host name checking because the default security configuration uses demo certificates. Use `-u` to pass the default username and password (`admin:admin`). 1. Query the OpenSearch REST API to verify that the service is running. You should use `-k` (also written as `--insecure`) to disable hostname checking because the default security configuration uses demo certificates. Use `-u` to pass the default username and password (`admin:<custom-admin-password>`).
```bash ```bash
curl https://localhost:9200 -ku admin:admin curl https://localhost:9200 -ku admin:<custom-admin-password>
``` ```
Sample response: Sample response:
```json ```json
@ -76,7 +76,7 @@ You'll need a special file, called a Compose file, that Docker Compose uses to d
"tagline" : "The OpenSearch Project: https://opensearch.org/" "tagline" : "The OpenSearch Project: https://opensearch.org/"
} }
``` ```
1. Explore OpenSearch Dashboards by opening `http://localhost:5601/` in a web browser on the same host that is running your OpenSearch cluster. The default username is `admin` and the default password is `admin`. 1. Explore OpenSearch Dashboards by opening `http://localhost:5601/` in a web browser on the same host that is running your OpenSearch cluster. The default username is `admin` and the default password is set in your `docker-compose.yml` file in the `OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>` setting.
## Create an index and field mappings using sample data ## Create an index and field mappings using sample data
@ -100,18 +100,18 @@ Create an index and define field mappings using a dataset provided by the OpenSe
``` ```
1. Define the field mappings with the mapping file. 1. Define the field mappings with the mapping file.
```bash ```bash
curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce" -ku admin:admin --data-binary "@ecommerce-field_mappings.json" curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce" -ku admin:<custom-admin-password> --data-binary "@ecommerce-field_mappings.json"
``` ```
1. Upload the index to the bulk API. 1. Upload the index to the bulk API.
```bash ```bash
curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce/_bulk" -ku admin:admin --data-binary "@ecommerce.json" curl -H "Content-Type: application/x-ndjson" -X PUT "https://localhost:9200/ecommerce/_bulk" -ku admin:<custom-admin-password> --data-binary "@ecommerce.json"
``` ```
1. Query the data using the search API. The following command submits a query that will return documents where `customer_first_name` is `Sonya`. 1. Query the data using the search API. The following command submits a query that will return documents where `customer_first_name` is `Sonya`.
```bash ```bash
curl -H 'Content-Type: application/json' -X GET "https://localhost:9200/ecommerce/_search?pretty=true" -ku admin:admin -d' {"query":{"match":{"customer_first_name":"Sonya"}}}' curl -H 'Content-Type: application/json' -X GET "https://localhost:9200/ecommerce/_search?pretty=true" -ku admin:<custom-admin-password> -d' {"query":{"match":{"customer_first_name":"Sonya"}}}'
``` ```
Queries submitted to the OpenSearch REST API will generally return a flat JSON by default. For a human readable response body, use the query parameter `pretty=true`. For more information about `pretty` and other useful query parameters, see [Common REST parameters]({{site.url}}{{site.baseurl}}/opensearch/common-parameters/). Queries submitted to the OpenSearch REST API will generally return a flat JSON by default. For a human readable response body, use the query parameter `pretty=true`. For more information about `pretty` and other useful query parameters, see [Common REST parameters]({{site.url}}{{site.baseurl}}/opensearch/common-parameters/).
1. Access OpenSearch Dashboards by opening `http://localhost:5601/` in a web browser on the same host that is running your OpenSearch cluster. The default username is `admin` and the default password is `admin`. 1. Access OpenSearch Dashboards by opening `http://localhost:5601/` in a web browser on the same host that is running your OpenSearch cluster. The default username is `admin` and the password is set in your `docker-compose.yml` file in the `OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>` setting.
1. On the top menu bar, go to **Management > Dev Tools**. 1. On the top menu bar, go to **Management > Dev Tools**.
1. In the left pane of the console, enter the following: 1. In the left pane of the console, enter the following:
```json ```json
@ -162,4 +162,4 @@ OpenSearch will fail to start if your host's `vm.max_map_count` is too low. Revi
opensearch-node1 | ERROR: [1] bootstrap checks failed opensearch-node1 | ERROR: [1] bootstrap checks failed
opensearch-node1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] opensearch-node1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
opensearch-node1 | ERROR: OpenSearch did not exit normally - check the logs at /usr/share/opensearch/logs/opensearch-cluster.log opensearch-node1 | ERROR: OpenSearch did not exit normally - check the logs at /usr/share/opensearch/logs/opensearch-cluster.log
``` ```

View File

@ -267,7 +267,7 @@ To associate requests with tasks for better tracking, you can provide a `X-Opaqu
Usage: Usage:
```bash ```bash
curl -i -H "X-Opaque-Id: 111111" "https://localhost:9200/_tasks" -u 'admin:admin' --insecure curl -i -H "X-Opaque-Id: 111111" "https://localhost:9200/_tasks" -u 'admin:<custom-admin-password>' --insecure
``` ```
{% include copy.html %} {% include copy.html %}
@ -326,6 +326,6 @@ content-length: 768
This operation supports the same parameters as the `tasks` operation. The following example shows how you can associate `X-Opaque-Id` with specific tasks: This operation supports the same parameters as the `tasks` operation. The following example shows how you can associate `X-Opaque-Id` with specific tasks:
```bash ```bash
curl -i -H "X-Opaque-Id: 123456" "https://localhost:9200/_tasks?nodes=opensearch-node1" -u 'admin:admin' --insecure curl -i -H "X-Opaque-Id: 123456" "https://localhost:9200/_tasks?nodes=opensearch-node1" -u 'admin:<custom-admin-password>' --insecure
``` ```
{% include copy.html %} {% include copy.html %}

View File

@ -31,7 +31,7 @@ After installation, you can verify OpenSearch is running by going to `localhost:
Use the following command to verify OpenSearch is running with SSL certificate checks disabled: Use the following command to verify OpenSearch is running with SSL certificate checks disabled:
```bash ```bash
curl -k -u admin:admin https://localhost:9200 # the "-k" option skips SSL certificate checks curl -k -u admin:<custom-admin-password> https://localhost:9200 # the "-k" option skips SSL certificate checks
{ {
"name" : "147ddae31bf8.opensearch.org", "name" : "147ddae31bf8.opensearch.org",

View File

@ -48,7 +48,7 @@ To connect to the default OpenSearch host, create a client object with the addre
var host = "localhost"; var host = "localhost";
var protocol = "https"; var protocol = "https";
var port = 9200; var port = 9200;
var auth = "admin:admin"; // For testing only. Don't store credentials in code. var auth = "admin:<custom-admin-password>"; // For testing only. Don't store credentials in code.
var ca_certs_path = "/full/path/to/root-ca.pem"; var ca_certs_path = "/full/path/to/root-ca.pem";
// Optional client certificates if you don't want to use HTTP basic authentication. // Optional client certificates if you don't want to use HTTP basic authentication.
@ -360,7 +360,7 @@ The following sample program creates a client, adds an index with non-default se
var host = "localhost"; var host = "localhost";
var protocol = "https"; var protocol = "https";
var port = 9200; var port = 9200;
var auth = "admin:admin"; // For testing only. Don't store credentials in code. var auth = "admin:<custom-admin-password>"; // For testing only. Don't store credentials in code.
var ca_certs_path = "/full/path/to/root-ca.pem"; var ca_certs_path = "/full/path/to/root-ca.pem";
// Optional client certificates if you don't want to use HTTP basic authentication. // Optional client certificates if you don't want to use HTTP basic authentication.

View File

@ -245,7 +245,7 @@ curl -XPOST http://localhost:9200/_plugins/_performanceanalyzer/rca/cluster/conf
If you encounter the `curl: (52) Empty reply from server` response, run the following command to enable RCA: If you encounter the `curl: (52) Empty reply from server` response, run the following command to enable RCA:
```bash ```bash
curl -XPOST https://localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' -u 'admin:admin' -k curl -XPOST https://localhost:9200/_plugins/_performanceanalyzer/rca/cluster/config -H 'Content-Type: application/json' -d '{"enabled": true}' -u 'admin:<custom-admin-password>' -k
``` ```
### Example API query and response ### Example API query and response

View File

@ -63,7 +63,7 @@ This should result in a single document being written to the OpenSearch cluster
Run the following command to see one of the raw documents in the OpenSearch cluster: Run the following command to see one of the raw documents in the OpenSearch cluster:
```bash ```bash
curl -X GET -u 'admin:admin' -k 'https://localhost:9200/apache_logs/_search?pretty&size=1' curl -X GET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200/apache_logs/_search?pretty&size=1'
``` ```
The response should show the parsed log data: The response should show the parsed log data:

View File

@ -76,7 +76,7 @@ node-0.example.com | [2020-11-19T16:29:55,267][INFO ][o.e.c.m.MetadataMappingSe
In a new terminal window, run the following command to see one of the raw documents in the OpenSearch cluster: In a new terminal window, run the following command to see one of the raw documents in the OpenSearch cluster:
```bash ```bash
curl -X GET -u 'admin:admin' -k 'https://localhost:9200/otel-v1-apm-span-000001/_search?pretty&size=1' curl -X GET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200/otel-v1-apm-span-000001/_search?pretty&size=1'
``` ```
Navigate to `http://localhost:5601` in a web browser and choose **Trace Analytics**. You can see the results of your single click in the Jaeger HotROD web interface: the number of traces per API and HTTP method, latency trends, a color-coded map of the service architecture, and a list of trace IDs that you can use to drill down on individual operations. Navigate to `http://localhost:5601` in a web browser and choose **Trace Analytics**. You can see the results of your single click in the Jaeger HotROD web interface: the number of traces per API and HTTP method, latency trends, a color-coded map of the service architecture, and a list of trace IDs that you can use to drill down on individual operations.

View File

@ -30,7 +30,7 @@ Values from the command line argument have higher priority than the environment
The following command requests a report with basic authentication in PNG format: The following command requests a report with basic authentication in PNG format:
``` ```
opensearch-reporting-cli --url https://localhost:5601/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d --format png --auth basic --credentials admin:admin opensearch-reporting-cli --url https://localhost:5601/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d --format png --auth basic --credentials admin:<custom-admin-password>
``` ```
Upon success, the report will download to the current directory. Upon success, the report will download to the current directory.

View File

@ -61,7 +61,7 @@ POST _plugins/_sql
To run the preceding query in the command line, use the [curl](https://curl.haxx.se/) command: To run the preceding query in the command line, use the [curl](https://curl.haxx.se/) command:
```bash ```bash
curl -XPOST https://localhost:9200/_plugins/_sql -u 'admin:admin' -k -H 'Content-Type: application/json' -d '{"query": "SELECT * FROM my-index* LIMIT 50"}' curl -XPOST https://localhost:9200/_plugins/_sql -u 'admin:<custom-admin-password>' -k -H 'Content-Type: application/json' -d '{"query": "SELECT * FROM my-index* LIMIT 50"}'
``` ```
{% include copy.html %} {% include copy.html %}

View File

@ -77,6 +77,7 @@ services:
- discovery.type=single-node - discovery.type=single-node
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>" # The initial admin password used by the demo configuration
ulimits: ulimits:
memlock: memlock:
soft: -1 soft: -1
@ -97,6 +98,7 @@ services:
- discovery.type=single-node - discovery.type=single-node
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>" # The initial admin password used by the demo configuration
ulimits: ulimits:
memlock: memlock:
soft: -1 soft: -1
@ -120,13 +122,13 @@ networks:
After the clusters start, verify the names of each: After the clusters start, verify the names of each:
```json ```json
curl -XGET -u 'admin:admin' -k 'https://localhost:9200' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200'
{ {
"cluster_name" : "opensearch-ccs-cluster1", "cluster_name" : "opensearch-ccs-cluster1",
... ...
} }
curl -XGET -u 'admin:admin' -k 'https://localhost:9250' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9250'
{ {
"cluster_name" : "opensearch-ccs-cluster2", "cluster_name" : "opensearch-ccs-cluster2",
... ...
@ -154,7 +156,7 @@ docker inspect --format='{% raw %}{{range .NetworkSettings.Networks}}{{.IPAddres
On the coordinating cluster, add the remote cluster name and the IP address (with port 9300) for each "seed node." In this case, you only have one seed node: On the coordinating cluster, add the remote cluster name and the IP address (with port 9300) for each "seed node." In this case, you only have one seed node:
```json ```json
curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9250/_cluster/settings' -d ' curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9250/_cluster/settings' -d '
{ {
"persistent": { "persistent": {
"cluster.remote": { "cluster.remote": {
@ -169,13 +171,13 @@ curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:admin' 'https://loca
On the remote cluster, index a document: On the remote cluster, index a document:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/books/_doc/1' -d '{"Dracula": "Bram Stoker"}' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/books/_doc/1' -d '{"Dracula": "Bram Stoker"}'
``` ```
At this point, cross-cluster search works. You can test it using the `admin` user: At this point, cross-cluster search works. You can test it using the `admin` user:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9250/opensearch-ccs-cluster1:books/_search?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9250/opensearch-ccs-cluster1:books/_search?pretty'
{ {
... ...
"hits": [{ "hits": [{
@ -192,8 +194,8 @@ curl -XGET -k -u 'admin:admin' 'https://localhost:9250/opensearch-ccs-cluster1:b
To continue testing, create a new user on both clusters: To continue testing, create a new user on both clusters:
```bash ```bash
curl -XPUT -k -u 'admin:admin' 'https://localhost:9200/_plugins/_security/api/internalusers/booksuser' -H 'Content-Type: application/json' -d '{"password":"password"}' curl -XPUT -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_security/api/internalusers/booksuser' -H 'Content-Type: application/json' -d '{"password":"password"}'
curl -XPUT -k -u 'admin:admin' 'https://localhost:9250/_plugins/_security/api/internalusers/booksuser' -H 'Content-Type: application/json' -d '{"password":"password"}' curl -XPUT -k -u 'admin:<custom-admin-password>' 'https://localhost:9250/_plugins/_security/api/internalusers/booksuser' -H 'Content-Type: application/json' -d '{"password":"password"}'
``` ```
Then run the same search as before with `booksuser`: Then run the same search as before with `booksuser`:
@ -218,8 +220,8 @@ curl -XGET -k -u booksuser:password 'https://localhost:9250/opensearch-ccs-clust
Note the permissions error. On the remote cluster, create a role with the appropriate permissions, and map `booksuser` to that role: Note the permissions error. On the remote cluster, create a role with the appropriate permissions, and map `booksuser` to that role:
```bash ```bash
curl -XPUT -k -u 'admin:admin' -H 'Content-Type: application/json' 'https://localhost:9200/_plugins/_security/api/roles/booksrole' -d '{"index_permissions":[{"index_patterns":["books"],"allowed_actions":["indices:admin/shards/search_shards","indices:data/read/search"]}]}' curl -XPUT -k -u 'admin:<custom-admin-password>' -H 'Content-Type: application/json' 'https://localhost:9200/_plugins/_security/api/roles/booksrole' -d '{"index_permissions":[{"index_patterns":["books"],"allowed_actions":["indices:admin/shards/search_shards","indices:data/read/search"]}]}'
curl -XPUT -k -u 'admin:admin' -H 'Content-Type: application/json' 'https://localhost:9200/_plugins/_security/api/rolesmapping/booksrole' -d '{"users" : ["booksuser"]}' curl -XPUT -k -u 'admin:<custom-admin-password>' -H 'Content-Type: application/json' 'https://localhost:9200/_plugins/_security/api/rolesmapping/booksrole' -d '{"users" : ["booksuser"]}'
``` ```
Both clusters must have the user, but only the remote cluster needs the role and mapping; in this case, the coordinating cluster handles authentication (i.e. "Does this request include valid user credentials?"), and the remote cluster handles authorization (i.e. "Can this user access this data?"). Both clusters must have the user, but only the remote cluster needs the role and mapping; in this case, the coordinating cluster handles authentication (i.e. "Does this request include valid user credentials?"), and the remote cluster handles authorization (i.e. "Can this user access this data?").

View File

@ -47,5 +47,5 @@ plugins.security.authcz.impersonation_dn:
To impersonate another user, submit a request to the system with the HTTP header `opendistro_security_impersonate_as` set to the name of the user to be impersonated. A good test is to make a GET request to the `_plugins/_security/authinfo` URI: To impersonate another user, submit a request to the system with the HTTP header `opendistro_security_impersonate_as` set to the name of the user to be impersonated. A good test is to make a GET request to the `_plugins/_security/authinfo` URI:
```bash ```bash
curl -XGET -u 'admin:admin' -k -H "opendistro_security_impersonate_as: user_1" https://localhost:9200/_plugins/_security/authinfo?pretty curl -XGET -u 'admin:<custom-admin-password>' -k -H "opendistro_security_impersonate_as: user_1" https://localhost:9200/_plugins/_security/authinfo?pretty
``` ```

View File

@ -30,7 +30,7 @@ If you run legacy Kibana OSS scripts against OpenSearch Dashboards---for example
In this case, your scripts likely include the `"kbn-xsrf: true"` header. Switch it to the `osd-xsrf: true` header: In this case, your scripts likely include the `"kbn-xsrf: true"` header. Switch it to the `osd-xsrf: true` header:
``` ```
curl -XPOST -u 'admin:admin' 'https://DASHBOARDS_ENDPOINT/api/saved_objects/_import' -H 'osd-xsrf:true' --form file=@export.ndjson curl -XPOST -u 'admin:<custom-admin-password>' 'https://DASHBOARDS_ENDPOINT/api/saved_objects/_import' -H 'osd-xsrf:true' --form file=@export.ndjson
``` ```

View File

@ -86,7 +86,7 @@ curl -X POST "https://localhost:9200/_remotestore/_restore" -H 'Content-Type: ap
**Restore all shards of a given index** **Restore all shards of a given index**
```bash ```bash
curl -X POST "https://localhost:9200/_remotestore/_restore?restore_all_shards=true" -ku admin:admin -H 'Content-Type: application/json' -d' curl -X POST "https://localhost:9200/_remotestore/_restore?restore_all_shards=true" -ku admin:<custom-admin-password> -H 'Content-Type: application/json' -d'
{ {
"indices": ["my-index"] "indices": ["my-index"]
} }

View File

@ -177,7 +177,7 @@ less /var/log/opensearch/opensearch-cluster.log
Perform the following `_cat` query on any node to see all the nodes formed as a cluster: Perform the following `_cat` query on any node to see all the nodes formed as a cluster:
```bash ```bash
curl -XGET https://<private-ip>:9200/_cat/nodes?v -u 'admin:admin' --insecure curl -XGET https://<private-ip>:9200/_cat/nodes?v -u 'admin:<custom-admin-password>' --insecure
``` ```
``` ```

View File

@ -28,7 +28,7 @@ Replication rules are a collection of patterns that you create against a single
Create a replication rule on the follower cluster: Create a replication rule on the follower cluster:
```bash ```bash
curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d ' curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{ {
"leader_alias" : "my-connection-alias", "leader_alias" : "my-connection-alias",
"name": "my-replication-rule", "name": "my-replication-rule",
@ -46,13 +46,13 @@ If the Security plugin is disabled, you can leave out the `use_roles` parameter.
To test the rule, create a matching index on the leader cluster: To test the rule, create a matching index on the leader cluster:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9201/movies-0001?pretty' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9201/movies-0001?pretty'
``` ```
And confirm its replica shows up on the follower cluster: And confirm its replica shows up on the follower cluster:
```bash ```bash
curl -XGET -u 'admin:admin' -k 'https://localhost:9200/_cat/indices?v' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200/_cat/indices?v'
``` ```
It might take several seconds for the index to appear. It might take several seconds for the index to appear.
@ -67,7 +67,7 @@ yellow open movies-0001 kHOxYYHxRMeszLjTD9rvSQ 1 1 0
To retrieve a list of existing replication rules that are configured on a cluster, send the following request: To retrieve a list of existing replication rules that are configured on a cluster, send the following request:
```bash ```bash
curl -XGET -u 'admin:admin' -k 'https://localhost:9200/_plugins/_replication/autofollow_stats' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200/_plugins/_replication/autofollow_stats'
{ {
"num_success_start_replication": 1, "num_success_start_replication": 1,
@ -96,7 +96,7 @@ curl -XGET -u 'admin:admin' -k 'https://localhost:9200/_plugins/_replication/aut
To delete a replication rule, send the following request to the follower cluster: To delete a replication rule, send the following request to the follower cluster:
```bash ```bash
curl -XDELETE -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d ' curl -XDELETE -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/_autofollow?pretty' -d '
{ {
"leader_alias" : "my-conection-alias", "leader_alias" : "my-conection-alias",
"name": "my-replication-rule" "name": "my-replication-rule"

View File

@ -32,7 +32,7 @@ In addition, verify and add the distinguished names (DNs) of each follower clust
First, get the node's DN from each follower cluster: First, get the node's DN from each follower cluster:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_opendistro/_security/api/ssl/certs?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_opendistro/_security/api/ssl/certs?pretty'
{ {
"transport_certificates_list": [ "transport_certificates_list": [
@ -110,13 +110,13 @@ networks:
After the clusters start, verify the names of each: After the clusters start, verify the names of each:
```bash ```bash
curl -XGET -u 'admin:admin' -k 'https://localhost:9201' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9201'
{ {
"cluster_name" : "leader-cluster", "cluster_name" : "leader-cluster",
... ...
} }
curl -XGET -u 'admin:admin' -k 'https://localhost:9200' curl -XGET -u 'admin:<custom-admin-password>' -k 'https://localhost:9200'
{ {
"cluster_name" : "follower-cluster", "cluster_name" : "follower-cluster",
... ...
@ -148,7 +148,7 @@ Cross-cluster replication follows a "pull" model, so most changes occur on the f
On the follower cluster, add the IP address (with port 9300) for each seed node. Because this is a single-node cluster, you only have one seed node. Provide a descriptive name for the connection, which you'll use in the request to start replication: On the follower cluster, add the IP address (with port 9300) for each seed node. Because this is a single-node cluster, you only have one seed node. Provide a descriptive name for the connection, which you'll use in the request to start replication:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_cluster/settings?pretty' -d ' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_cluster/settings?pretty' -d '
{ {
"persistent": { "persistent": {
"cluster": { "cluster": {
@ -167,13 +167,13 @@ curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://loca
To get started, create an index called `leader-01` on the leader cluster: To get started, create an index called `leader-01` on the leader cluster:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9201/leader-01?pretty' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9201/leader-01?pretty'
``` ```
Then start replication from the follower cluster. In the request body, provide the connection name and leader index that you want to replicate, along with the security roles you want to use: Then start replication from the follower cluster. In the request body, provide the connection name and leader index that you want to replicate, along with the security roles you want to use:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_start?pretty' -d ' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_start?pretty' -d '
{ {
"leader_alias": "my-connection-alias", "leader_alias": "my-connection-alias",
"leader_index": "leader-01", "leader_index": "leader-01",
@ -194,7 +194,7 @@ This command creates an identical read-only index named `follower-01` on the fol
After replication starts, get the status: After replication starts, get the status:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty'
{ {
"status" : "SYNCING", "status" : "SYNCING",
@ -217,13 +217,13 @@ The leader and follower checkpoint values begin as negative numbers and reflect
To confirm that replication is actually happening, add a document to the leader index: To confirm that replication is actually happening, add a document to the leader index:
```bash ```bash
curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9201/leader-01/_doc/1?pretty' -d '{"The Shining": "Stephen King"}' curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9201/leader-01/_doc/1?pretty' -d '{"The Shining": "Stephen King"}'
``` ```
Then validate the replicated content on the follower index: Then validate the replicated content on the follower index:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/follower-01/_search?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/follower-01/_search?pretty'
{ {
... ...
@ -251,13 +251,13 @@ After the first replication API trigger, the `.replication-metadata-store` index
You can temporarily pause replication of an index if you need to remediate issues or reduce load on the leader cluster: You can temporarily pause replication of an index if you need to remediate issues or reduce load on the leader cluster:
```bash ```bash
curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_pause?pretty' -d '{}' curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_pause?pretty' -d '{}'
``` ```
To confirm that replication is paused, get the status: To confirm that replication is paused, get the status:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty'
{ {
"status" : "PAUSED", "status" : "PAUSED",
@ -271,7 +271,7 @@ curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/fol
When you're done making changes, resume replication: When you're done making changes, resume replication:
```bash ```bash
curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_resume?pretty' -d '{}' curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_resume?pretty' -d '{}'
``` ```
When replication resumes, the follower index picks up any changes that were made to the leader index while replication was paused. When replication resumes, the follower index picks up any changes that were made to the leader index while replication was paused.
@ -283,7 +283,7 @@ Note that you can't resume replication after it's been paused for more than 12 h
When you no longer need to replicate an index, terminate replication from the follower cluster: When you no longer need to replicate an index, terminate replication from the follower cluster:
```bash ```bash
curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_stop?pretty' -d '{}' curl -XPOST -k -H 'Content-Type: application/json' -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_stop?pretty' -d '{}'
``` ```
When you stop replication, the follower index un-follows the leader and becomes a standard index that you can write to. You can't restart replication after stopping it. When you stop replication, the follower index un-follows the leader and becomes a standard index that you can write to. You can't restart replication after stopping it.
@ -291,7 +291,7 @@ When you stop replication, the follower index un-follows the leader and becomes
Get the status to confirm that the index is no longer being replicated: Get the status to confirm that the index is no longer being replicated:
```bash ```bash
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_plugins/_replication/follower-01/_status?pretty'
{ {
"status" : "REPLICATION NOT IN PROGRESS" "status" : "REPLICATION NOT IN PROGRESS"

View File

@ -87,7 +87,7 @@ If you are migrating an Open Distro for Elasticsearch cluster, we recommend firs
# Elasticsearch OSS # Elasticsearch OSS
curl -XGET 'localhost:9200/_nodes/_all?pretty=true' curl -XGET 'localhost:9200/_nodes/_all?pretty=true'
# Open Distro for Elasticsearch with Security plugin enabled # Open Distro for Elasticsearch with Security plugin enabled
curl -XGET 'https://localhost:9200/_nodes/_all?pretty=true' -u 'admin:admin' -k curl -XGET 'https://localhost:9200/_nodes/_all?pretty=true' -u 'admin:<custom-admin-password>' -k
``` ```
Specifically, check the `nodes.<node-id>.version` portion of the response. Also check `_cat/indices?v` for a green status on all indexes. Specifically, check the `nodes.<node-id>.version` portion of the response. Also check `_cat/indices?v` for a green status on all indexes.
@ -169,7 +169,7 @@ If you are migrating an Open Distro for Elasticsearch cluster, we recommend firs
# Security plugin disabled # Security plugin disabled
curl -XGET 'localhost:9200/_nodes/_all?pretty=true' curl -XGET 'localhost:9200/_nodes/_all?pretty=true'
# Security plugin enabled # Security plugin enabled
curl -XGET -k -u 'admin:admin' 'https://localhost:9200/_nodes/_all?pretty=true' curl -XGET -k -u 'admin:<custom-admin-password>' 'https://localhost:9200/_nodes/_all?pretty=true'
``` ```
Specifically, check the `nodes.<node-id>.version` portion of the response. Also check `_cat/indices?v` for a green status on all indexes. Specifically, check the `nodes.<node-id>.version` portion of the response. Also check `_cat/indices?v` for a green status on all indexes.