Use root account directly
1. zookeeper installation
Place the zookeeper-3.4.13.tar.gz installation package in the specified directory
sudo tar -zxvf zookeeper-3.4.13.tar.gz -C /usr sudo mkdir /usr/zookeeper-3.4.13/data sudo cp /usr/zookeeper-3.4.13/conf/zoo_sample.cfg /usr/zookeeper-3.4.13/conf/zoo.cfg sudo vim /usr/zookeeper-3.4.13/conf/zoo.cfg #Edit the configuration file to modify the following values
dataDir=/usr/zookeeper-3.4.13/data server.1=master:2888:3888 clientPort=2181
cd /usr/zookeeper-3.4.13/bin/ #Enter bin directory ./zkServer.sh start #Start command
# As shown below, successful start-up Using config: /usr/zookeeper-3.4.13/bin/../conf/zoo.cfg Starting zookeeper ... STARTED
# Frequently used commands zkServer.sh {start|start-foreground|stop|restart|status|upgrade|print-cmd}
2. zookeeper Installation Visualization Tool
You need to install java and maven environments
1. Installing maven environment
Download address online, no need to care http://mirrors.shu.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
Place the apache-maven-3.6.0-bin.tar.gz installation package in the server directory
sudo tar xzf apache-maven-3.6.0-bin.tar.gz -C /usr #Unzip to / usr cd /usr/ #You can see the apache-maven-3.6.0 folder sudo vim /etc/profile #Editing environment variables
export MAVEN_HOME=/usr/apache-maven-3.6.0 export PATH=$PATH:$MAVEN_HOME/bin
source /etc/profile # Effective environmental variables mvn -version # The test shows that the following is correct
Maven home: /usr/apache-maven-3.6.0 Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /usr/local/java/jdk1.8.0_201/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.4.73-5-default", arch: "amd64", family: "unix"
2. Installation of zkui
git clone https://gitee.com/ilanni/zkui.git cd zkui/ mvn clean install # maven packaging, successful execution will generate the target folder, which has jar files
Generate a target folder under the zkui folder after execution
There are two jar packages in the target folder. We just need to start zkui-2.0-SNAPSHOT-jar-with-dependencies.jar (but config.cfg file needs to be configured before starting)
cp config.cfg target/ #Copy the config.cfg file to the target folder sudo vim target/config.cfg #modify config.cfg file
# Find and modify the following configuration # zkui web page access port serverPort=9090 # IP Address and Port of zookeeper Cluster zkServer=localhost:2181,localhost:2182 # Set the username and password for login zkui, where we set the username and password to admin userSet = {"users": [{ "username":"admin" , "password":"admin","role": "ADMIN" },{ "username":"appconfig" , "password":"appconfig","role": "USER" }]}
cd target java -jar zkui-2.0-SNAPSHOT-jar-with-dependencies.jar & #Start zkui service, no daemon is used for the time being
Visit ip:9090 to view