Question

I'm facing problem with the setup of SolrCloud on AWS EC2 machine. The scenario is follows,

I have three servers for zookeeper and solr.

Each server has zookeeper running on it. When I start Solr with zookeeper hosts information, it start and works as expected.

The problem is that the zookeeper when generating the cluster information uses private ip of the servers and thus I cannot query it using the Solrj which cannot recognize the private IP. For e.g server1. private IP ip-a,b,c,d public IP : u,v,w,x The zookeeper recognizes the solr instance by the private IP (Obviously which won't be visible from the outside EC2 machines)

The cluster information looks something like this:
live nodes:[10.165.15.104:8983_solr] collections:{vicon=DocCollection(vicon)={
  "shards":{"shard1":{
      "range":"80000000-7fffffff",
      "state":"active",
      "replicas":{"10.165.15.104:8983_solr_vicon":{
          "shard":"shard1",
          "state":"down",
          "core":"vicon",
          "collection":"vicon",
          "node_name":"10.165.15.104:8983_solr",
          "base_url":"http://10.165.15.104:8983/solr",
          "leader":"true"}}}},
  "router":"compositeId"}, collection1=DocCollection(collection1)={
  "shards":{"shard1":{
      "range":"80000000-7fffffff",
      "state":"active",
      "replicas":{"10.165.15.104:8983_solr_collection1":{
          "shard":"shard1",
          "state":"down",
          "core":"collection1",
          "collection":"collection1",
          "node_name":"10.165.15.104:8983_solr",
          "base_url":"http://10.165.15.104:8983/solr",
          "leader":"true"}}}},
  "router":"compositeId"}, collections=DocCollection(collections)={
  "shards":{"shard1":{
      "range":"80000000-7fffffff",
      "state":"active",
      "replicas":{
        "10.165.15.104:8983_solr_collections":{
          "shard":"shard1",
          "state":"active",
          "core":"collections",
          "collection":"collections",
          "node_name":"10.165.15.104:8983_solr",
          "base_url":"http://10.165.15.104:8983/solr",
          "leader":"true"},
        "10.147.129.56:8983_solr_collections":{
          "shard":"shard1",
          "state":"down",
          "core":"collections",
          "collection":"collections",
          "node_name":"10.147.129.56:8983_solr",
          "base_url":"http://10.147.129.56:8983/solr"}}}},
  "router":"compositeId"}}

Live nodes IP is the private IP and not the public one

Is there any way in which we can zookeeper to store cluster information as the host name rather than ip. If that cannot be done how can I running solr Cloud on AWS EC2 machine?

Was it helpful?

Solution

I figured the solution. We can start a solr server with a host name which zookeeper will use

Just give a -Dhost=x.y.com when starting the solr instance and it would work fine

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top