Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eda842a36d | |||
| d2ba96967b | |||
| a9144167d8 | |||
| 07b0650128 | |||
| bff43bed13 | |||
| 75efdfeae8 |
@@ -55,6 +55,8 @@ PUT _plugins/_ism/policies/policy_id
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you have more than one template that matches an index pattern, ISM uses the priority value to determine which template to apply.
|
||||||
|
|
||||||
For an example ISM template policy, see [Sample policy with ISM template]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#sample-policy-with-ism-template).
|
For an example ISM template policy, see [Sample policy with ISM template]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies#sample-policy-with-ism-template).
|
||||||
|
|
||||||
Older versions of the plugin include the `policy_id` in an index template, so when an index is created that matches the index template pattern, the index will have the policy attached to it:
|
Older versions of the plugin include the `policy_id` in an index template, so when an index is created that matches the index template pattern, the index will have the policy attached to it:
|
||||||
@@ -89,6 +91,7 @@ Make sure that the alias that you enter already exists. For more information abo
|
|||||||
|
|
||||||
After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default to perform policy actions, check conditions, and transition the index into different states. To change the default time interval for this job, see [Settings]({{site.url}}{{site.baseurl}}/im-plugin/ism/settings/).
|
After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default to perform policy actions, check conditions, and transition the index into different states. To change the default time interval for this job, see [Settings]({{site.url}}{{site.baseurl}}/im-plugin/ism/settings/).
|
||||||
|
|
||||||
|
ISM does not run jobs if the cluster state is red.
|
||||||
|
|
||||||
### Step 3: Manage indices
|
### Step 3: Manage indices
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ In a tarball installation, Performance Analyzer collects data when it is enabled
|
|||||||
1. Launch the agent CLI:
|
1. Launch the agent CLI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ES_HOME="$PWD" ./bin/performance-analyzer-agent-cli
|
OPENSEARCH_HOME="$PWD" ./bin/performance-analyzer-agent-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
1. In a separate window, enable the Performance Analyzer plugin:
|
1. In a separate window, enable the Performance Analyzer plugin:
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Remote cluster information
|
||||||
|
parent: REST API reference
|
||||||
|
nav_order: 25
|
||||||
|
---
|
||||||
|
|
||||||
|
# Remote cluster information
|
||||||
|
Introduced 1.0
|
||||||
|
{: .label .label-purple }
|
||||||
|
|
||||||
|
This operation provides connection information for any remote OpenSearch clusters that you've configured for the local cluster, such as the remote cluster alias, connection mode (`sniff` or `proxy`), IP addresses for seed nodes, and timeout settings.
|
||||||
|
|
||||||
|
The response is more comprehensive and useful than a call to `_cluster/settings`, which only includes the cluster alias and seed nodes.
|
||||||
|
|
||||||
|
|
||||||
|
## Path and HTTP methods
|
||||||
|
|
||||||
|
```
|
||||||
|
GET _remote/info
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Response
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"opensearch-cluster2": {
|
||||||
|
"connected": true,
|
||||||
|
"mode": "sniff",
|
||||||
|
"seeds": [
|
||||||
|
"172.28.0.2:9300"
|
||||||
|
],
|
||||||
|
"num_nodes_connected": 1,
|
||||||
|
"max_connections_per_cluster": 3,
|
||||||
|
"initial_connect_timeout": "30s",
|
||||||
|
"skip_unavailable": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -65,11 +65,11 @@ Save this file as `docker-compose.yml` and run `docker-compose up` to start two
|
|||||||
```yml
|
```yml
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
opensearch-node1:
|
opensearch-ccs-node1:
|
||||||
image: opensearchproject/opensearch:{{site.opensearch_version}}
|
image: opensearchproject/opensearch:{{site.opensearch_version}}
|
||||||
container_name: opensearch-node1
|
container_name: opensearch-ccs-node1
|
||||||
environment:
|
environment:
|
||||||
- cluster.name=opensearch-cluster1
|
- cluster.name=opensearch-ccs-cluster1
|
||||||
- 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
|
||||||
@@ -85,11 +85,11 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- opensearch-net
|
- opensearch-net
|
||||||
|
|
||||||
opensearch-node2:
|
opensearch-ccs-node2:
|
||||||
image: opensearchproject/opensearch:{{site.opensearch_version}}
|
image: opensearchproject/opensearch:{{site.opensearch_version}}
|
||||||
container_name: opensearch-node2
|
container_name: opensearch-ccs-node2
|
||||||
environment:
|
environment:
|
||||||
- cluster.name=opensearch-cluster2
|
- cluster.name=opensearch-ccs-cluster2
|
||||||
- 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
|
||||||
@@ -118,26 +118,26 @@ After the clusters start, verify the names of each:
|
|||||||
```json
|
```json
|
||||||
curl -XGET -u 'admin:admin' -k 'https://localhost:9200'
|
curl -XGET -u 'admin:admin' -k 'https://localhost:9200'
|
||||||
{
|
{
|
||||||
"cluster_name" : "opensearch-cluster1",
|
"cluster_name" : "opensearch-ccs-cluster1",
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
curl -XGET -u 'admin:admin' -k 'https://localhost:9250'
|
curl -XGET -u 'admin:admin' -k 'https://localhost:9250'
|
||||||
{
|
{
|
||||||
"cluster_name" : "opensearch-cluster2",
|
"cluster_name" : "opensearch-ccs-cluster2",
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Both clusters run on `localhost`, so the important identifier is the port number. In this case, use port 9200 (`opensearch-node1`) as the remote cluster, and port 9250 (`opensearch-node2`) as the coordinating cluster.
|
Both clusters run on `localhost`, so the important identifier is the port number. In this case, use port 9200 (`opensearch-ccs-node1`) as the remote cluster, and port 9250 (`opensearch-ccs-node2`) as the coordinating cluster.
|
||||||
|
|
||||||
To get the IP address for the remote cluster, first identify its container ID:
|
To get the IP address for the remote cluster, first identify its container ID:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker ps
|
docker ps
|
||||||
CONTAINER ID IMAGE PORTS NAMES
|
CONTAINER ID IMAGE PORTS NAMES
|
||||||
6fe89ebc5a8e opensearchproject/opensearch:{{site.opensearch_version}} 0.0.0.0:9200->9200/tcp, 0.0.0.0:9600->9600/tcp, 9300/tcp opensearch-node1
|
6fe89ebc5a8e opensearchproject/opensearch:{{site.opensearch_version}} 0.0.0.0:9200->9200/tcp, 0.0.0.0:9600->9600/tcp, 9300/tcp opensearch-ccs-node1
|
||||||
2da08b6c54d8 opensearchproject/opensearch:{{site.opensearch_version}} 9300/tcp, 0.0.0.0:9250->9200/tcp, 0.0.0.0:9700->9600/tcp opensearch-node2
|
2da08b6c54d8 opensearchproject/opensearch:{{site.opensearch_version}} 9300/tcp, 0.0.0.0:9250->9200/tcp, 0.0.0.0:9700->9600/tcp opensearch-ccs-node2
|
||||||
```
|
```
|
||||||
|
|
||||||
Then get that container's IP address:
|
Then get that container's IP address:
|
||||||
@@ -154,7 +154,7 @@ curl -k -XPUT -H 'Content-Type: application/json' -u 'admin:admin' 'https://loca
|
|||||||
{
|
{
|
||||||
"persistent": {
|
"persistent": {
|
||||||
"search.remote": {
|
"search.remote": {
|
||||||
"opensearch-cluster1": {
|
"opensearch-ccs-cluster1": {
|
||||||
"seeds": ["172.31.0.3:9300"]
|
"seeds": ["172.31.0.3:9300"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,11 +171,11 @@ curl -XPUT -k -H 'Content-Type: application/json' -u 'admin:admin' 'https://loca
|
|||||||
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-cluster1:books/_search?pretty'
|
curl -XGET -k -u 'admin:admin' 'https://localhost:9250/opensearch-ccs-cluster1:books/_search?pretty'
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"hits": [{
|
"hits": [{
|
||||||
"_index": "opensearch-cluster1:books",
|
"_index": "opensearch-ccs-cluster1:books",
|
||||||
"_type": "_doc",
|
"_type": "_doc",
|
||||||
"_id": "1",
|
"_id": "1",
|
||||||
"_score": 1.0,
|
"_score": 1.0,
|
||||||
@@ -196,7 +196,7 @@ curl -XPUT -k -u 'admin:admin' 'https://localhost:9250/_plugins/_security/api/in
|
|||||||
Then run the same search as before with `booksuser`:
|
Then run the same search as before with `booksuser`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
curl -XGET -k -u booksuser:password 'https://localhost:9250/opensearch-cluster1:books/_search?pretty'
|
curl -XGET -k -u booksuser:password 'https://localhost:9250/opensearch-ccs-cluster1:books/_search?pretty'
|
||||||
{
|
{
|
||||||
"error" : {
|
"error" : {
|
||||||
"root_cause" : [
|
"root_cause" : [
|
||||||
@@ -225,11 +225,11 @@ Both clusters must have the user, but only the remote cluster needs the role and
|
|||||||
Finally, repeat the search:
|
Finally, repeat the search:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -XGET -k -u booksuser:password 'https://localhost:9250/opensearch-cluster1:books/_search?pretty'
|
curl -XGET -k -u booksuser:password 'https://localhost:9250/opensearch-ccs-cluster1:books/_search?pretty'
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"hits": [{
|
"hits": [{
|
||||||
"_index": "opensearch-cluster1:books",
|
"_index": "opensearch-ccs-cluster1:books",
|
||||||
"_type": "_doc",
|
"_type": "_doc",
|
||||||
"_id": "1",
|
"_id": "1",
|
||||||
"_score": 1.0,
|
"_score": 1.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user