Using this fantastic GIST of Kalharbi at https://gist.github.com/kalharbi/fd29661b9926eb087c45 , I have configured SolrCloud on my localhost with three ZooKeeper server on port 2181, 2182 & 2183 where their roles are follower, follower, & Leader respectively.
I have uploaded two different configurations namely tr_config & rp_config to ZooKeeper and create two collections using below commands
My config folder contains some files like schema.xml,solrconfig.xml etc,at
-/opt/solr/server/solr/configsets/tr_config
-/opt/solr/server/solr/configsets/rp_config
Upload config To ZooKeeper:
./server/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -confdir ./server/solr/configsets/tr_config/conf/ -confname tr_config
./server/scripts/cloud-scripts/zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -confdir ./server/solr/configsets/rp_config/conf/ -confname rp_config
Create Collections:
curl 'http://localhost:8983/solr/admin/collections?action=CREATE&name=transactions&numShards=2&replicationFactor=1&collection.configName=tr_config'
curl 'http://localhost:8983/solr/admin/collections?action=CREATE&name=properties&numShards=2&replicationFactor=1&collection.configName=rp_config'
It works properly but then I have changed the solrconfig.xml on properties collection and update configuration again to ZooKeeper server,then it showing lockType.native issue on solr initialization, so then I have set lockType:none on solrconfig.xml. and it works again. but when I run all solr instances on different ports like 8983, 8984 & 8985 using command
$ ./bin/solr start -c -p 8983 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
$ ./bin/solr start -c -p 8984 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
$ ./bin/solr start -c -p 8985 -z 127.0.0.1:2181,127.0.0.1:2182,127.0.0.1:2183
It shows
no servers hosting shard: shard1
but If I stop the other solr instances on 8984 and 8985 port and restart 8983 then all my docs are queryable. again if I start any of the 8984 or 8985 solr instance, 8983 instance again non queryable.
The problem may be the data indexing directory are same for all three solr instances, but I don't know how to configure it differently for every other solr collections. So experts give some light on my below problems.
What is the problem ? why not able to run three instances while I am updating the configuration on ZooKeeper.?
How can I change the maxShardsPerNode ?
Thanks in Advance