Unable to add remote cluster for CCS

I am simply spinning up two Elasticsearch instances in the same machine and trying to add one as a remote cluster to the other one.

Settings for cluster_one (only the relevant part):

    transport.port: 9307
    http.port: 9207
    xpack.security.enabled: false

Port settings for cluster_two:

    transport.port: 9357
    http.port: 9257
    xpack.security.enabled: false

    cluster:
      remote:
        cluster_one:
          seeds: 127.0.0.1:9307

Here's the document I want to search in cluster_one

curl localhost:9207/cc-idx/_search
{"took":35,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"cc-idx","_type":"1","_id":"WdYtsncBXLIED8mInk4S","_score":1.0,"_source":{"name": "John Doe", "tag": "apple"}}]}}

When I try to query cluster_one from the other cluster, its unable to find the index

curl localhost:9257/cluster_one:cc-idx/_search
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [cluster_one:cc-idx]","resource.type":"index_or_alias","resource.id":"cluster_one:cc-idx","index_uuid":"_na_","index":"cluster_one:cc-idx"}],"type":"index_not_found_exception","reason":"no such index [cluster_one:cc-idx]","resource.type":"index_or_alias","resource.id":"cluster_one:cc-idx","index_uuid":"_na_","index":"cluster_one:cc-idx"},"status":404}

I am not seeing anything in the logs - no errors, no debug or trace, nothing!

_remote/info API return empty result.

> curl localhost:9207/_remote/info
{}

The transport are reachable as well

> curl localhost:9307
This is not an HTTP port

> curl localhost:9357
This is not an HTTP port

What am I doing wrong here? Am I missing a setting that's making the cluster undiscoverable to the other?

Did you configure the remote cluster?

Thanks for the response @DavidTurner

Like I pointed out in the config above, I have configured the remote cluster. Both via elasticsearch.yml and via the _cluster/settings API.

Here is the response of GET _cluster/settings

curl localhost:9257/_cluster/settings
{"persistent":{"cluster":{"remote":{"cluster_one":{"seeds":["127.0.0.1:9307"]}}}},"transient":{}}

Hmm, that's very strange, I can't see how you would get an empty result from GET _remote/info if the remote cluster really was configured.

Aha I see, you need to do curl http://localhost:9257/_remote/info not curl http://localhost:9207/_remote/info. The remote cluster is defined on cluster_two not cluster_one.

Sorry for the confusion. Both the clusters return empty result for _remote/info

> curl localhost:9257/_cluster/settings
{"persistent":{"cluster":{"remote":{"cluster_one":{"seeds":["127.0.0.1:9307"]}}}},"transient":{}}

> curl http://localhost:9257/_remote/info
{}
> curl localhost:9207/_cluster/settings
{"persistent":{},"transient":{}}

> curl http://localhost:9207/_remote/info
{}

Ok, weird. What version are we discussing?

> curl http://localhost:9207/
{
  "name" : "node-1",
  "cluster_name" : "cluster_one",
  "version" : {
    "number" : "7.9.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "c4138e51121ef06a6404866cddc601906fe5c868",
    "build_date" : "2020-10-16T10:36:16.141335Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

> curl http://localhost:9257/
{
  "name" : "node-1",
  "cluster_name" : "cluster_two",
  "version" : {
    "number" : "7.9.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "c4138e51121ef06a6404866cddc601906fe5c868",
    "build_date" : "2020-10-16T10:36:16.141335Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Can you share GET _cat/nodes from both clusters?

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.