In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to install and configure solrcloud6.2.1 and Zookeeper clusters under built-in jetty server. I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.
Environment introduction:
Two virtual machines: 192.168.0.1 and 192.168.0.2
System and software version: centos6.8 zookeeper-3.4.10 solr-6.2.1
I. Zookeeper cluster installation
Download zookeeper-3.4.10 and extract it
# cd / data/solrcloud/
# tar zxvf zookeeper-3.4.10.tar.gz
Create data and log directories in the zookeeper directory to store data
# cd / data/solrcloud/zookeeper-3.4.10
# mkdir-p data log
Copy the configuration file zoo_sample.cfg of zookeeper to zoo.cfg
# cp conf/zoo_sample.cfg conf/zoo.cfg
Edit the configuration file zoo.cfg and add the following:
Vi conf/zoo.cfg
DataDir=/data/solrcloud/zookeeper-3.4.10/data
DataLogDir=/data/solrcloud/zookeeper-3.4.10/log
Server.1=192.168.0.1:2888:3888
Server.2=192.168.0.2:2888:3888
Save exit
In the data directory in zookeeper, you need to create a myid file and write the corresponding number
In conf/zoo.cfg:
Write 1 on the machine corresponding to server.1
Write 2 on the machine corresponding to server.2
Write 1 on 192.168.0.1
# cd / data/solrcloud/zookeeper-3.4.10/data
# echo 1 > myid
In the same way, the other one writes 2:
# echo 2 > myid
Start the zookeeper cluster on two machines
# cd / data/solrcloud/zookeeper-3.4.10/bin
#. / zkServer.sh start
View cluster status
#. / zkServer.sh status
The successful installation should be one for leader,1 and one for follower
#. / zkServer.sh status
ZooKeeper JMX enabled by default
Using config: / data/solrcloud/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: leader
The other one:
] #. / zkServer.sh status
ZooKeeper JMX enabled by default
Using config: / data/solrcloud/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: follower
Solrcould installation
Extract solr-6.2.1.tgz and rename it to solr, and then modify the contents of the solr.in.sh file in the bin directory:
SOLR_JAVA_MEM= "- Xms10G-Xmx10G" (here make appropriate modifications based on the memory size, in this case 10G)
Join ZK_HOST
ZK_HOST= "192.168.0.1 purl 2181192.168.0.2purl 2181"
Remove the comments from ZK_CLIENT_TIMEOUT
ZK_CLIENT_TIMEOUT= "15000"
Configure solr Chinese word Separator
Copy the IKAnalyzer-2016_FS.jar file to the solr/server/solr-webapp/webapp/WEB-INF/lib directory
Create a solrhome directory to store the uploaded configuration file, and then copy the configuration file
# mkdir-p / data/solrcloud/solrhome/myconf
# cp-r / data/solrcloud/solr/example/example-DIH/solr/solr/conf / data/solrcloud/solrhome/myconf
The contents of solrconfig.xml and managed-schema under conf in myconf need to be modified. For more information, please see the following configuration:
Managed-schema content:
KvUuid
KvTitle
Start solrcloud
# # cd / data/solrcloud/solr/bin
. / solr start-cloud-z 192.168.0.1 2181192.168.0.2purl 2181-p 8080
Create a topic and chenfeng collection with three slices and one copy:
. / solr create_collection-c topic-shards 3-replicationFactor 1-p 8080
. / solr create_collection-c chenfeng-shards 3-replicationFactor 1-p 8080
Enter the cloud-scripts directory and upload the configuration file to zookeeper:
# cd / data/solrcloud/solr/server/scripts/cloud-scripts
#. / zkcli.sh-zkhost 192.168.0.1 cmd upconfig 2181-cmd upconfig-confdir / data/solrcloud/solr/server/solr/configsets/basic_configs/conf-confname topic
#. / zkcli.sh-zkhost 192.168.0.1 cmd upconfig 2181-cmd upconfig-confdir / data/solrcloud/solr/server/solr/configsets/basic_configs/conf-confname chenfeng
Log in to the zookeeper cluster to view the uploaded files:
# cd / data/solrcloud/zookeeper-3.4.10/bin
#. / zkCli.sh
Connecting to localhost:2181
2018-01-25 17 main:Environment@100 13 main:Environment@100 33212 [myid:]-INFO [main:Environment@100]-Client environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03 Greater 23 Greater 10:13 GMT
2018-01-25 17 main:Environment@100 13 main:Environment@100 33216 [myid:]-INFO [main:Environment@100]-Client environment:host.name=
2018-01-25 17 main:Environment@100 13 main:Environment@100 33216 [myid:]-INFO [main:Environment@100]-Client environment:java.version=1.8.0_161
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.vendor=Oracle Corporation
2018-01-25 17 main:Environment@100 13 Client environment:java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-3.b14.el6_9.x86_64/jre
2018-01-25 17 main:Environment@100 13 Client environment:java.class.path=/data/solrcloud/zookeeper-3.4.10/bin/../build/classes:/data/solrcloud/zookeeper-3.4.10/bin/../build/lib/*.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/slf4j-log4j12 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.class.path=/data/solrcloud/zookeeper-3.4.10/bin/../build/classes:/data/solrcloud/zookeeper-3.4.10/bin/../build/lib/*.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/data/solrcloud/zookeeper -3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/data/solrcloud/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/data / solrcloud/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/data/solrcloud/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/data/solrcloud/zookeeper-3.4.10/bin/../conf:
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.io.tmpdir=/tmp
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:java.compiler=
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:os.name=Linux
2018-01-25 17 main:Environment@100 13 main:Environment@100 33218 [myid:]-INFO [main:Environment@100]-Client environment:os.arch=amd64
2018-01-25 17 main:Environment@100 13 Client environment:os.version=2.6.32 33218 [myid:]-INFO [main:Environment@100]-Client environment:os.version=2.6.32-642.el6.x86_64
2018-01-25 17 main:Environment@100 13 main:Environment@100 33 219 [myid:]-INFO [main:Environment@100]-Client environment:user.name=root
2018-01-25 17 main:Environment@100 13 main:Environment@100 33 219 [myid:]-INFO [main:Environment@100]-Client environment:user.home=/root
2018-01-25 17 main:Environment@100 13 main:Environment@100 33 219 [myid:]-INFO [main:Environment@100]-Client environment:user.dir=/data/solrcloud/zookeeper-3.4.10/bin
2018-01-25 17 main:ZooKeeper@438 13 main:ZooKeeper@438 33220 [myid:]-INFO [main:ZooKeeper@438]-Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@277050dc
Welcome to ZooKeeper!
2018-01-25 17 main-SendThread 13 main-SendThread 33240 [myid:]-INFO [main-SendThread (localhost:2181): ClientCnxn$SendThread@1032]-Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2018-01-25 17 main-SendThread 13 main-SendThread 33297 [myid:]-INFO [main-SendThread (localhost:2181): ClientCnxn$SendThread@876]-Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2018-01-25 17 main-SendThread 13 main-SendThread 33305 [myid:]-INFO [main-SendThread (localhost:2181): ClientCnxn$SendThread@1299]-Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x1612c33f9f2000a, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181 (CONNECTED) 0] ls / configs
[topic, chenfeng]
[zk: localhost:2181 (CONNECTED) 1] ls / configs/topic
[currency.xml, protwords.txt, managed-schema, solrconfig.xml, synonyms.txt, elevate.xml, stopwords.txt, lang, params.json]
[zk: localhost:2181 (CONNECTED) 2] ls / configs/chenfeng
[currency.xml, protwords.txt, managed-schema, solrconfig.xml, synonyms.txt, elevate.xml, stopwords.txt, lang, params.json]
[zk: localhost:2181 (CONNECTED) 3] quit
Quitting...
2018-01-25 17 main:ZooKeeper@684 13 15 12 [myid:]-INFO [main:ZooKeeper@684]-Session: 0x1612c33f9f2000a closed
2018-01-25 17 main-EventThread:ClientCnxn$EventThread@519 13 15 14 [myid:]-INFO [main-EventThread:ClientCnxn$EventThread@519]-EventThread shut down for session: 0x1612c33f9f2000a
Check out the solr cluster page:
Http://192.168.0.1:8080/solr/#/~collections/chenfeng
Http://192.168.0.1:8080/solr/#/~collections/topic
Click reload on the interface to reload the configuration file, and then refresh the page.
These are all the contents of this article entitled "how to install and configure solrcloud6.2.1 and Zookeeper clusters under built-in jetty server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.