Skip to content

Support configuring RCS 2.0 remote cluster without node restart#98120

Closed
ywangd wants to merge 5 commits intoelastic:mainfrom
ywangd:rcs2-remote-cluster-no-restart
Closed

Support configuring RCS 2.0 remote cluster without node restart#98120
ywangd wants to merge 5 commits intoelastic:mainfrom
ywangd:rcs2-remote-cluster-no-restart

Conversation

@ywangd
Copy link
Copy Markdown
Member

@ywangd ywangd commented Aug 2, 2023

This PR enables RCS 2.0 remote cluster to be configured without the need to restart nodes. It works as the follows (assuming both clusters are already running):

  1. Get a cross-cluster API key for accessing the remote cluster
  2. Add cross-cluster API key to keystores of the local cluster, e.g.
    echo -n xxx | ./bin/elasticsearch-keystore add cluster.remote.my.credentials -x
    
  3. Call ReloadSecureSettings API on the local cluster
  4. Configure RCS 2.0 remote cluster should now just work for the local cluster, e.g.
    PUT /_cluster/settings
    {"persistent":{"cluster":{"remote":{"my":{"seeds":["127.0.0.1:9443"]}}}}}
    

@ywangd
Copy link
Copy Markdown
Member Author

ywangd commented Aug 2, 2023

@elasticmachine run elasticsearch-ci/part-1

@ywangd
Copy link
Copy Markdown
Member Author

ywangd commented Aug 3, 2023

@elasticmachine update branch

@ywangd ywangd closed this Aug 8, 2023
elasticsearchmachine pushed a commit that referenced this pull request Dec 8, 2023
This PR enables RCS 2.0 remote clusters to be configured without the
need to restart nodes. It works as the follows (assuming both clusters
are already running):

1. Get a cross-cluster API key for accessing the _remote_ cluster
2. Add cross-cluster API key to keystores of the _local_ cluster, e.g.

    ```

    echo -n xxx | ./bin/elasticsearch-keystore add cluster.remote.my.credentials -x

    ```

3. Call [ReloadSecureSettings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-reload-secure-settings.html) on the _local_ cluster
4. Configure RCS 2.0 remote cluster should now just work for the _local_ cluster, e.g.

    ```

    PUT /_cluster/settings
    {"persistent":{"cluster":{"remote":{"my":{"seeds":["127.0.0.1:9443"]}}}}}

    ```

This PR does **not** include functionality to automatically re-build
connections on secure settings reload. I will add this in a follow up
PR.

The high level technical approach is to maintain a credentials manager
class and use this to attach credentials for connections to remote
clusters. This
[comment](https://github.com/elastic/elasticsearch/pull/102798/files#r1417708553)
also provides more context on some lower level details.

Relates: #98120 Relates:
ES-6764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants