下载地址:http://lucene.apache.org/solr/downloads.html 部署操作
SolrCloud 服务器:s1.solr.com ; s2.solr.com ; s3.solr.com
Zookeeper 服务器: z1.com ; z2.com ; z3.com
默认安装目录 /home/myuser
首先启动zookeeper集群
按照顺序启动 z1.com; z2.com; z3.com 1.从 http://hadoop.apache.org/zookeeper/releases.html 下载zookeeper 2.解压缩zookeeper到zookeeper目录 tar -xf -C /home/myuser/zookeeper/ 3.编辑zookeeper配置文件
vi /home/myuser/zookeeper/conf/zoo.cfg and put something similar to
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial synchronization phase can take
initLimit=10
# The number of ticks that can pass between # sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored. # Choose appropriately for your environment
dataDir=/home/myuser/zookeeper/data/
# the port at which the clients will connect
clientPort=2181
# the directory where transaction log is stored. # this parameter provides dedicated log device for ZooKeeper
dataLogDir=/home/myuser/zookeeper/log/
# ZooKeeper server and its port no. # ZooKeeper ensemble should know about every other machine in the ensemble # specify server id by creating 'myid' file in the dataDir # use hostname instead of IP address for convenient maintenance
server.1=z1.com:2888:3888
server.2=z2.com:2888:3888
server.3=z3.com:2888:3888 4. 为每个服务器建立一个id文件到data目录,配置合适的id到文件中,例如
vi /home/myuser/zookeeper/data/myid and write just 1 for z1.com in the file. For z2.com server write 2 in its myid and 3 in z3.com myid file. myid file is used to identify the zookeeper server(myid文件存储该机器的标识码).
启动所有zookeeper服务器
# cd /home/myuser/zookeeper/bin/
# ./zkServer.sh start
安装tomcat
Now once zookeeper cluster is ready lets setup Solr Cloud machines : s1.solr.com,s2.solr.com,s3.solr.com