How to make SOLR "boot" into Cloud Mode when server reboots - solr

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?

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.

Related

SolrCloud is always starting in Example. Solr Home configuration is not working

Solr Cloud always starts in example and configuration specified in solr.in.sh is not working.
What are changes required to start with custom configuration ?
I have setup Zookeeper in ensemble mode and also do changes in solr.in.sh. But, it seems Solr is always starts with Example
I saw your answer in comments, yet completing the answer for others.
To start solr in cloud mode you need to add "-cloud":- solr start -cloud
-e start in interactive mode with one example. This is just for newbies to get started with solrcloud

Controlling what cores get loaded when solr 5 starts/restarts

I setup my solr instance to run the way I wanted. The service was restarted and all my setup was removed and 4 gettingstarted cores were loaded.
Can someone explain why this happened and what I can do to prevent it from happening again. I would like the cores that I built to be persistent.
Thanks for your help
Edit: Looking over :
https://cwiki.apache.org/confluence/display/solr/Moving+to+the+New+solr.xml+Format
I have the solr.xml setup exactly like the example. I have the core.properties files setup properly. I don't see how it is suppose to know to load the core I created.
Edit2: I found this documentation that states any core.properties files in the home folder will be used.
https://cwiki.apache.org/confluence/display/solr/Solr+Cores+and+solr.xml
Assuming Solr 5, it sounds like you run /bin/solr restart and got wrong collections. The reason to that would be that the restart command needs the same parameters as the start command, most importantly your solr home path.
Solr home is what you provided with -s parameter when you started your Solr the last time. If you did it instead by starting from an example, this guide on solr home locations should help.

SolrCloud boot with existing cores

I am playing with solrcloud 4.6.0 and have a question. I have 3 standalone zookeeper v3.4.5 servers and 2 solr instances. Zookeeper was freshly installed and empty.
I configured the first solr node with the new discovery format, prepared initial existing cores (with data) and started the first solr with the bootstrap_conf set to true.
By observing the solr log I saw the cores config was uploaded to zookeeper and can also confirm that by looking at zookeeper registry. Also the cores are visible in the solr web console, searchable. All in all working.
Now I wanted the second solr node to kick in. The second solr was only having solr.xml (exactly the same as the first solr node). My understanding was that starting the second solr node will read the cores info from zookeeper and after a while all cores will replicate to it.
Didn't happen.
No errors in the logs, second solr web console says no cores are available.
What did I miss?
Best regards
No errors in the log, huh? Bad eye I have.
It turns out that the initial configuration which was uploaded to zookeeper wasn't expending the variables in solr.xml, so the clusterstate.json had wrong ports for my Jetty solr installations - the default port 8983 was taken for replicas, but they were running on different ports.
I just modified the default value on all replicas in solr.xml file prior to booting the first solr instance with bootstrap_conf and now the cores are immediately visible. Also I deleted all zookeeper info before.
But still replicas have to be created on each node via web gui or by rest api.

ColdFusion 10 SOLR install

I am running Coldfusion 10 (10,0,9,284568) on Win7 64bit developer instance. Initially we had no need for SOLR, so we did not include it in the original ColdFusion install. However, we now have need, so I downloaded ColdFusion_10_Jetty_Solr_win.exe from adobe, and installed using default values, and received no errors. However, when I open CF Admin to add a collection, I receive the cannot create collection error.
What is the SOLR home directory supposed to be set to in ColdFusion Admin? I tried several values, (coldfusionjetty\solr, and coldfusionjetty\multicore\), and they all appear to work. But when I go to create a collection I always receive the cannot create error. I have uninstalled and reinstalled the ColdFusion 10 SOLR multiple times, but no improvement. Adobe has no documentation on this that I can find. Any ideas?
Edit:
--- nevermind, I was finally able to get it to work. For anyone else who wonders where the Coldfusion SOLR Home should be, I set the SOLR host to localhost and the SOLR home to C:/ColdFusionJetty/multicore/ using CF admin, saved, then created a collection and it worked. I swear I tried the multicore directory earlier, but perhaps not.
For anyone else who wonders where the Coldfusion SOLR Home should be, I set the SOLR host to localhost and the SOLR home to C:/ColdFusionJetty/multicore/ using CF admin, saved, then created a collection and it worked. I swear I tried the multicore directory earlier, but perhaps not.
References
Jetspeed Deployers Guide - Apache Tomcat Overview
Solr Tomcat
Apache Tomcat 7 (7.0.78) - Security Considerations
Solr Wiki: Why no WAR

Disappearing cores in Solr

I am new to Solr.
I have created two cores from the admin page, let's call them "books" and "libraries", and imported some data there. Everything works without a hitch until I restart the server. When I do so, one of these cores disappears, and the logging screen in the admin page contains:
SEVERE CoreContainer null:java.lang.NoClassDefFoundError: net/arnx/jsonic/JSONException
SEVERE SolrCore REFCOUNT ERROR: unreferenced org.apache.solr.core.SolrCore#454055ac (papers) has a reference count of 1
I was testing my query in the admin interface; when I refreshed it, the "libraries" core was gone, even though I could normally query it just a minute earlier. The contents of solr.xml are intact. Even if I restart Tomcat, it remains gone.
Additionally, I was trying to build a query similar to this: "Find books matching 'war peace' in libraries in Atlanta or New York". So given cores "books" and "libraries", I would issue "books" the following query (which might be wrong, if it is please correct me):
(title:(war peace) blurb:(war peace))
AND _query_:"{!join
fromIndex=libraries from=libraryid to=libraryid
v='city:(new york) city:(atlanta)'}"
When I do so, the query fails with "libraries" core disappears, with the above symptoms. If I re-add it, I can continue working (as long as I don't restart the server or issue another join query).
I am using Solr 4.0; if anyone has a clue what is happening, I would be very grateful. I could not find out anything about the meaning of the error message, so if anyone could suggest where to look for that, or how go about debugging this, it would be really great. I can't even find where the log file itself is located...
I would avoid the Debian package which may be misconfigured and quirky. And it contains (a very early build of?) solr 4.0, which itself may have lingering issues; being the first release in a new major version. The package maintainer may not have incorporated the latest and safest Solr release into his package.
A better way is to download Solr 4.1 yourself and set it up yourself with Tomcat or another servlet container.
In case you are looking to install SOLR 4.0 and configure, you can following the installation procedure from here
Update the solr config for the cores to be persistent.
In your solr.xml, update <solr> or <solr persistent="false"> to <solr persistent="true">

Resources