1. create /solr in zookeeper (in zkCli: create /solr solr_dir
2. edit $TOMCAT_HOME/conf/server.xml, following the book "apache_solr_4_cookbook", p11
3. edit $TOMCAT_HOME/bin/setenv.sh
(set JAVA_OPTS="$JAVA_OPTS -DzkClientTimeout=20000 -DzkHost=localhost:2181/solr"
4. create file $TOMCAT_HOME/conf/Catalina/localhost/solr.xml, add contents (p11
5. create solr data folder, copy solr.xml from example and edit (remove core
6. copy *.* in example/lib/ext to $TOMCAT_HOME/lib
7. start tomcat
8. config & start solr in all machines
9. upload collection configs
~/Java/solr-4.3.0/example/cloud-scripts$ ./zkcli.sh -z localhost:2181/solr -cmd upconfig -d ../multicore/core0/conf -n excoll0
~/Java/solr-4.3.0/example/cloud-scripts$ ./zkcli.sh -z localhost:2181/solr -cmd upconfig -d ../multicore/core1/conf -n excoll1
10. create collections
http://localhost:58080/solr/admin/collections?action=CREATE&name=excoll0&numShards=2&replicationFactor=2&maxShardsPerNode=2
http://localhost:58080/solr/admin/collections?action=CREATE&name=excoll1&numShards=2&replicationFactor=2&maxShardsPerNode=2
additional:
2. edit $TOMCAT_HOME/conf/server.xml, following the book "apache_solr_4_cookbook", p11
3. edit $TOMCAT_HOME/bin/setenv.sh
(set JAVA_OPTS="$JAVA_OPTS -DzkClientTimeout=20000 -DzkHost=localhost:2181/solr"
4. create file $TOMCAT_HOME/conf/Catalina/localhost/solr.xml, add contents (p11
5. create solr data folder, copy solr.xml from example and edit (remove core
6. copy *.* in example/lib/ext to $TOMCAT_HOME/lib
7. start tomcat
8. config & start solr in all machines
9. upload collection configs
~/Java/solr-4.3.0/example/cloud-scripts$ ./zkcli.sh -z localhost:2181/solr -cmd upconfig -d ../multicore/core0/conf -n excoll0
~/Java/solr-4.3.0/example/cloud-scripts$ ./zkcli.sh -z localhost:2181/solr -cmd upconfig -d ../multicore/core1/conf -n excoll1
10. create collections
http://localhost:58080/solr/admin/collections?action=CREATE&name=excoll0&numShards=2&replicationFactor=2&maxShardsPerNode=2
http://localhost:58080/solr/admin/collections?action=CREATE&name=excoll1&numShards=2&replicationFactor=2&maxShardsPerNode=2
additional:
1. install tomcat native library 1.1.27
sudo apt-get install libapr1-dev libssl-dev
In the jni/native runs:
./configure --with-apr=/usr/bin/apr-1-config \
--with-java-home=$JAVA_HOME \
--with-ssl=yes \
--prefix=/home/luyi/Java/apache-tomcat-7.0.39
make
make install
Edit $CATALINA_HOME/bin/setenv.sh (creating the file if necessary) and add the path to the tc-native libraries to LD_LIBRARY_PATH. Something like:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH