删除原有openjdk
mkdir /usr/java
tar xzvf jdk-7u79-linux-x64.gz -C /usr/java/
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_79
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
vim /etc/hosts
10.10.20.2 solr1
10.10.20.4 solr2
10.10.20.5 solr3
ssh互信
mkdir -p /apps/svr/
mkdir -p /apps/data/zookeeper/
mkdir -p /apps/data/zookeeper/logs/
tar xzvf zookeeper-3.4.8.tar.gz -C /apps/svr/
scp -r /apps/svr/zookeeper-3.4.8 [email protected]:/apps/svr
scp -r /apps/data [email protected]:/apps/data
echo "1" >> /apps/data/zookeeper/myid
echo "2" >> /apps/data/zookeeper/myid
echo "3" >> /apps/data/zookeeper/myid
vim /etc/init.d/zookeeper
#!/bin/bash
#
# chkconfig: 345 30 70
# description: Starts/Stops Apache Zookeeper
export ZOO_HOME=/apps/svr/zookeeper-3.4.8
export ZOO_BIN=$ZOO_HOME/bin
export ZOO_SER_BIN=$ZOO_BIN/zkServer.sh
$ZOO_SER_BIN $1
chmod +x /etc/init.d/zookeeper
chkconfig --add zookeeper
chkconfig zookeeper on
tar xzf solr-5.5.0.tgz solr-5.5.0/bin/install_solr_service.sh --strip-components=2
./install_solr_service.sh solr-5.5.0.tgz -i /apps/svr -d /apps/data/solrcloud -u solr -s solr -p 8983
vim /apps/data/solrcloud/solr.in.sh
SOLR_JAVA_MEM="-Xms10g -Xmx10g"
ZK_HOST=10.10.20.2:2181,10.10.20.4:2181,10.10.20.5:2181
cp ik-analyzer-solr5-5.x.jar /apps/svr/solr/server/solr-webapp/webapp/WEB-INF/lib
cp -n /apps/svr/solr/dist/*.jar /apps/svr/solr/server/solr-webapp/webapp/WEB-INF/lib
cp mysql-connector-java-5.1.35.jar /apps/svr/solr/server/lib
su -c ‘/apps/svr/solr/bin/solr create -c c1_cd -d /apps/data/solrcloud/opt/c1_cd_conf -n c1_cd -s 3 -rf 2 -port 8983‘ - solr
http://localhost:8983/solr/admin/collections?action=CREATE&name=core_cd&numShards=2&replicationFactor=3
server/scripts/cloud-scripts/zkcli.sh -zkhost solr1:2181 -cmd makepath /solr