wget http://mirror.navercorp.com/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
1번 서버
mkdir -p /home/eclipse4j/tmp/zookeeper
echo '1'> /home/eclipse4j/tmp/zookeeper/myid
2번 서버
mkdir -p /home/eclipse4j/tmp/zookeeper
echo '2'> /home/eclipse4j/tmp/zookeeper/myid
----------------------------------------------------------------------------------------
Step 1:
Node 1:
zoo.cfg
server.1= 0.0.0.0:<port>:<port2>
server.2= <IP>:<port>:<port2>
.
.
server.n= <IP>:<port>:<port2>
Node 2 :
server.1= <IP>:<port>:<port2>
server.2= 0.0.0.0:<port>:<port2>
.
.
server.n= <IP>:<port>:<port2>
ex)
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/eclipse4j/tmp/zookeeper/
clientPort=2181
server.1=0.0.0.0:2888:3888
server.2=zks2:2888:3888
- ./bin/zkServer.sh start
- ./bin/zkServer.sh start-foreground <-- 확인이 필요할 경우
eclipse4j@ubuntu:~/zookeeper-3.4.8$ ./bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/eclipse4j/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: follower
eclipse4j@ubuntu:~/zookeeper-3.4.8$ ./bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/eclipse4j/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: leader
"/home/eclipse4j/solr-5.5.1/bin/solr.in.sh"
ZK_HOST = "<Server1의 IP> : 2181,<Server2의 IP> : 2181 <Server3의 IP> : 2181"
ZK_CLIENT_TIMEOUT = "150000"
SOLR_HOME = /home/eclipse4j/solr-5.5.1/server/solr
SOLR_PORT = 8983
SOLR_MODE = solrcloud
./bin/solr start -c
./bin/solr create -c solr-cloud-test1
zk
eclipse4j@ubuntu:~/solr-5.5.1$ ./server/scripts/cloud-scripts/zkcli.sh -zkhost <1번서버>:2181 <2번서버>:2181 -cmd upconfig -confdir <코어/콜렉션 DIR> -confname <config명을 지정할때 컬렉션 또는 코어명으로 지정한다.>
Collection 만들기
http://192.168.219.109:8983/solr/admin/collections?action=CREATE&name=solr-cloud-test3&numShards=1&replicationFactor=3&collection.configName=solrconfig&maxShardsPerNode=3
Collection 지우기
http://192.168.219.109:8983/solr/admin/collections?action=DELETE&name=solr-cloud-test3&numShards=1&replicationFactor=3&collection.configName=solrconfig&maxShardsPerNode=3
CLOUD 환경에서 유의
db-data-config.xml
기본 :
<propertyWriter dateFormat="yyyy-MM-dd HH:mm:ss" type="SimplePropertiesWriter">
변경/추가
<propertyWriter dateFormat="yyyy-MM-dd HH:mm:ss" type="ZKPropertiesWriter"/>
* dataimport.properties의 증분 색인 등에서 문제가 발생할 수 있다.
최종 호출시
http://host:8983/solr/<코어명>/select?q=content:단어&wt=json&indent=true
http://host:8983/solr/<코어명>/dataimport?command=full-import&clean=true&commit=true
http://host:8983/solr/<코어명>/dataimport?command=delta_import
........./solr/bin/solr -cloud -z <solr_server>:2181, <solr_server>:2181 -noprompt