SolrCloud build zookeeper build

Series Article Directory

The first chapter zookeeper construction and startup script

Chapter 2 Solr stand-alone construction and use

Chapter 3 solrCloud Construction and Evolution


Article directory


foreword

With the continuous iterative update of Internet technology, distributed technology is becoming more and more important. Many people have started the learning mode. This article introduces the basic content of solr construction and use.


Zookeeper is not unfamiliar to most people, but most people are still in the use stage. Today we will build a zookeeper cluster together

1. If you install zookeeper on the same machine, you can directly use the compressed package to decompress it. The first thing to do when installing a zookeeper cluster on multiple servers is to synchronize the system time to ensure that the time of each machine is synchronized.

Download zookeeper Download address: Index of /dist/zookeeper

Select the version to be downloaded, and upload the tar package to the specified directory on the server after the download is complete.

2. Use zookeeper to manage the solr cluster. First, upload the zookeeper compressed package to the specified directory /usr/tmp on the server, decompress the file, copy the decompressed file to /usr/local/zookeeper, and rename it zookeeper1

cp -r /usr/local/tmp/zookeeper-3.8.4 /usr/local/zookeeper/zookeeper1

3. Enter the zookeeper1 file to create a new data directory, and create a new myid under the data directory, write 1 in it, indicating that it is the server1 identifier, and the latter corresponds to the configuration in the zoo.cfg file.

4. Go to conf under the zookeeper1 folder, copy the zoo_example.cfg file and rename it to zoo.cfg.

5. Modify the content of zoo.cfg, set dataDir as the data folder directory, clientPort as the external interface 2181,

And add the cluster configuration information at the bottom of the file, as shown in the figure below

 The 1 in server.1 is the id of the server defined in myid in the previous step

2688, 2689, and 2690 are the internal ports of each node of zookeeper

3888, 3889, and 3890 are the ports for each node of zookeeper to communicate with the leader

6. After the above modification is completed, copy two copies of zookeeper1 and name them zookeeper2 and zookeeper3 respectively; and modify the serverid of the myid file under the data in the two folders to 2 and 3 respectively; modify the directory of data in the zoo.cfg file, Modify dataDir and clientPort, the directories correspond to zookeeper2/data and zookeeper3/data respectively; the clientPort ports correspond to 2182 and 2183 respectively.

7. Return to the zookeeper directory, write the startup script startupall.sh; and start three zookeepers

 8. Check the startup status and write the script status.sh;

 

 9. Above, the status of zookeeper can be checked through the log, one leader node and two follower nodes, the setup is completed.

A few problems were encountered in the middle, and the port number in zoo.cfg was not changed. After the modification, all zookeeper restart problems were solved.


Summarize

The above is what I will talk about today. This article only briefly introduces the building process of the zookeeper cluster. During the building process, you must carefully follow the steps to build it. Don’t panic if there are problems. Check the configurations carefully, recheck each port and need to separate After modifying the configuration file, make sure that all the modifications are completed, shut down the zookeeper that has been started, and restart all zookeepers.

Guess you like

Origin blog.csdn.net/fuhaiqiang123/article/details/126757865