AWS EC2计算机上的Solrcloud配置

Glo*_*ior 4 solr amazon-ec2 amazon-web-services solrcloud apache-zookeeper

我在AWS EC2机器上设置SolrCloud时遇到问题.场景如下,

我有三台服务器用于zookeeper和solr.

每个服务器上都运行着zookeeper.当我使用zookeeper主机信息启动Solr时,它会按预期启动并运行.

问题是动物园管理员在生成集群信息时使用服务器的私有ip,因此我无法使用无法识别私有IP的Solrj来查询它.例如server1.私有IP ip-a,b,c,d公共IP:u,v,w,x zookeeper通过私有IP识别solr实例(显然从外部EC2机器上看不到)

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"}}
Run Code Online (Sandbox Code Playgroud)

实时节点IP是私有IP而不是公共IP

有没有什么方法可以让zookeeper将集群信息存储为主机名而不是ip.如果无法做到这一点,我如何在AWS EC2机器上运行solr Cloud?

Glo*_*ior 6

我想出了解决方案.我们可以使用zookeeper将使用的主机名启动一个solr服务器

只需在启动solr实例时给出-Dhost = xycom,它就能正常工作