Domanda

I'm trying to deploy a cluster of 3 VMs with SolR 4.2 (on a Tomcat 7 instance) using SolrCloud, with an external ZooKeeper (3.4.5) in each instance (I'm using Windows Server 2008 R2) But something goes wrong, I don't have specific errors but when I send documents on an instance, they are always indexed on that instance and the other ones do not see it. In short, it looks like they don't communicate each other, even if the Zookeeper instances do. (I have a multi-core SolR configuration)

Here there are the steps I made to deploy SolrCloud (followed by this tutorial).


1) I've installed ZooKeeper and created a zoo.cfg file in each instance, modifying some lines of the example file:

dataDir=C:\\PcSemantic\\PCSEMANTIC\\Solr\\zookeeper_data
clientPort=2181
server.1=vm1:2888:3888
server.2=vm2:2888:3888
server.3=vm3:2888:3888

2) I added in context.xml of Tomcat for SolR the following lines (I also tried to remove the first and second lines from 2 of 3 instances but nothing changes):

<Environment name="numShards" type="java.lang.Integer" value="3" override="true" />
<Environment name="bootstrap_conf" type="java.lang.Boolean" value="true" override="true" />
<Environment name="zkHost" type="java.lang.String" value="vm1:2181,vm2:2181,vm2:2181" override="true" />

3) I added in schema.xml and solrconfig.xml of each core of each instance the version field, 'replication' and 'get' handlers and the updateLog, as specified in http://wiki.apache.org/solr/SolrCloud#Required_Config

4) in solr.xml I put hostPort="8080" in 'cores' tag 5) then I launched ZooKeeper (with bin/zkServer.cmd) in each instance, and then started Tomcat as a Service in each instance The ZooKeeper instances seems communicating correctly, some errors appears in the logs only until I start all of 3 ZK, then it logs the following :

2013-10-04 10:17:33,733 [myid:3] - INFO  [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:218
1:Follower@63] - FOLLOWING - LEADER ELECTION TOOK - 94
2013-10-04 10:17:33,780 [myid:3] - INFO  [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:218
1:Learner@325] - Getting a snapshot from leader
2013-10-04 10:17:33,780 [myid:3] - INFO  [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:218
1:FileTxnSnapLog@240] - Snapshotting: 0x100000000 to C:\PcSemantic\PCSEMANTIC\So
lr\zookeeper_data\version-2\snapshot.100000000

Solr instances do not log errors or warning. I stopped all firewall/proxies on 3 machines (they are on same LAN and they communicate correctly each other).

È stato utile?

Soluzione

I found the solution (even if its not exactly the configuration that I needed at least it works) The variable bootstrap_conf should be passed as a Java system parameter :

  • Tomcat as a service : $TOMCAT_HOME/bin/tomcat7w.exe , tab 'JAVA'; add in 'java options':

    -Dboostrap_conf=true
    
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top