4

NOTE: I've tried everything in the comments below and everything else I can think of. At this point I have to assume there's a bug of some kind and that a restart will NOT bring SOLR up in cloud mode unless you roll your own init.d stuff.

==================================================

I have 3 SOLR nodes and 3 Zookeeper nodes.

The SOLR Nodes are SOLR 5.4 on Ubuntu 14 and were installed based on the instructions here:

https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production

If I issue this command to start or restart SOLR on the command line, everything looks fine in the SOLR Admin UI and all my nodes are green in the UI

sudo /opt/solr/bin/solr restart -c -z 192.168.56.5,192.168.56.6,192.168.56.7/solr5_4

However, even though I have a ZK_HOST entry in my solr.in.sh I cannot get the nodes to show up in the SOLR Admin console correctly if I try:

service solr restart 

Or if I reboot the VM.

My ZK_HOST entry in solr.in.sh looks like this:

ZK_HOST="192.168.56.5,192.168.56.6,192.168.56.7/solr5_4"

I also tried it this way (no quotes, just in case) because that's how it looks on the Apache wiki page I was reading:

ZK_HOST=192.168.56.5,192.168.56.6,192.168.56.7/solr5_4

I always have to run the command line to get the SOLR instances to show up correctly in the Admin UI. It would be preferrable to have this "just happen" when rebooting the VM.

If I run service solr restart on any of them, they show as "down" in the Admin UI and the core I am using disappears from the Admin UI for the one IP address I'm looking at.

Why is this and what settings are required to get SOLR to start on boot into "Cloud Mode" with the correct Zookeeper settings?

Conor Mancone
  • 1,940
  • 16
  • 22
jb62
  • 2,224
  • 2
  • 14
  • 23
  • Odd. Setting the `ZK_HOST` should make it act in cloud mode. There is a bug for that [here](https://issues.apache.org/jira/browse/SOLR-7102) where that wasn't always true. What happens if you set `SOLR_MODE=solrcloud` in the same config location where `ZK_HOST` is set? – vcsjones Jan 27 '16 at 21:55
  • Isn't `solr.in.sh` just the template that's copied to `/etc/init.d/solr` when installing it as a service? Are you sure it's being read afterwards? – MatsLindh Jan 28 '16 at 08:14
  • Thanks - the file exists in two places. /opt/solr/bin and /etc/default. I'm not sure which (if either) is used. I have put my connection string in the ZK_HOST line in both files. – jb62 Jan 28 '16 at 16:41
  • When I look in /etc/init.d/solr I see something quite different than the solr.in.sh file. For example: if [ ! -d "$SOLR_INSTALL_DIR" ]; then echo "$SOLR_INSTALL_DIR not found! Please check the SOLR_INSTALL_DIR setting in your $0 script." – jb62 Jan 28 '16 at 16:44
  • The file doesn't contain "SOLR_MODE" at all, but I'll try adding it to both and testing what happens. – jb62 Jan 28 '16 at 16:45
  • Nope - it appears to not make a difference... I've put "SOLR_MODE="solrcloud" into each of the solr.in.sh files and restarted [sudo service solr restart] and the behavior is the same. The VM I restarted this way shows in the Admin UI as "down" and the core is not in the dropdown when hitting the SOLR Admin Console on that IP address. – jb62 Jan 28 '16 at 17:14

1 Answers1

3

Until a recent change, the docs for setting SOLR up for Prod had a slight misdirection. The bottom line here is that /etc/default/solr.in.sh was what controlled the SOLR configs on startup. NOT the one mentioned in the docs (which was somewhere else anyway /opt/solr/bin)

Once I added the ZKHOST setting in /etc/default/solr.in.sh and restarted the service (or rebooted the server) SOLR came up in "Cloud" mode every time.

jb62
  • 2,224
  • 2
  • 14
  • 23