You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by maephisto <my...@yahoo.com> on 2013/09/03 12:13:47 UTC

Starting Solr in Tomcat with specifying ZK host(s)

Hi,
I've setup a ZK instance and also deployed Solr in Tomcat7 on a different
instance in Amazon EC2.
Afterwards I tried starting tomcat specifying the ZK host IP, like so:

sudo service tomcat7 start -DzkHost=<<zk ip>>:2181 -DnumShards=3
-Dcollection.configName=myconf
-Dbootstrap_confdir=/usr/share/solr/example/solr/collection1/conf

Solr loads fine, but is not in the cloud. 

Any idea what am i doing wrong here?




--
View this message in context: http://lucene.472066.n3.nabble.com/Starting-Solr-in-Tomcat-with-specifying-ZK-host-s-tp4087916.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Starting Solr in Tomcat with specifying ZK host(s)

Posted by maephisto <my...@yahoo.com>.
When i try to deploy using jetty, everything works fine, and the solr
instance gets in the cloud

sudo java -Dbootstrap_confdir=./solr/collection1/conf
-Dcollection.configName=myconf -DzkHost=<<zk ip>>:2181 -DnumShards=3 -jar
start.jar



--
View this message in context: http://lucene.472066.n3.nabble.com/Starting-Solr-in-Tomcat-with-specifying-ZK-host-s-tp4087916p4087962.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Starting Solr in Tomcat with specifying ZK host(s)

Posted by maephisto <my...@yahoo.com>.
Thanks Shawn!

Indeed, setting the JAVA_OPTS and restarting Tomcat did the trick.
Currently I'm exploring and experimenting with SolrCloud, thus I only used
only one ZK.
For a production environment you suggestion would, of course, be mandatory.



--
View this message in context: http://lucene.472066.n3.nabble.com/Starting-Solr-in-Tomcat-with-specifying-ZK-host-s-tp4087916p4088164.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Starting Solr in Tomcat with specifying ZK host(s)

Posted by Shawn Heisey <so...@elyograg.org>.
On 9/3/2013 4:13 AM, maephisto wrote:
> I've setup a ZK instance and also deployed Solr in Tomcat7 on a different
> instance in Amazon EC2.
> Afterwards I tried starting tomcat specifying the ZK host IP, like so:
> 
> sudo service tomcat7 start -DzkHost=<<zk ip>>:2181 -DnumShards=3
> -Dcollection.configName=myconf
> -Dbootstrap_confdir=/usr/share/solr/example/solr/collection1/conf
> 
> Solr loads fine, but is not in the cloud. 

The tomcat init script likely does not pay attention to anything that
you put on the commandline other than a command (like start/stop/status)
for the service.  The java command is buried in that script.

It works with jetty because you are running java directly, not a script.

Helping you with tomcat is outside the scope of this mailing list, but
you may be able to modify the JAVA_OPTS environment variable in a file
with a name like one of the following:

/etc/default/tomcat7
/etc/sysconfig/tomcat7

Many init scripts for packaged software will load environment
information from a central user-modifiable config file.  If this
information is not directly usable to you, please consult a tomcat
mailing list, IRC channel, or other support avenue.

Although Solr does usually work with tomcat, there is no official
testing.  Solr is only tested using the Jetty that is bundled with it.

Side note: I hope you realize that if you're only connecting to one
zookeeper instance, then SolrCloud will not function if that zookeeper
instance goes down.  You need three instances minimum (running on
separate hardware) for robust operation, and Solr must know about all of
them.

Thanks,
Shawn