Build an open source project 13 – install IK word breaker and zookeeper

Time:2020-11-27

1、 Installing the IK word breaker

  • Download IK word breaker plug-in
wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.2/elasticsearch-analysis-ik-
  • Using Linux to download will be very slow, so I went to GitHub and downloaded it in advance. Now I will start to install it
[[email protected] ~]# mkdir /opt/elasticsearch/elasticsearch-6.4.2/plugins/elasticsearch-analysis-ik-6.4.2
[[email protected] ~]# cd /opt/elasticsearch/elasticsearch-6.4.2/plugins/elasticsearch-analysis-ik-6.4.2
[[email protected] elasticsearch-analysis-ik-6.4.2]# unzip elasticsearch-analysis-ik-6.4.2.tar.gz
  • Decompression means that the IK word breaker is installed, and finally restart elasticsearch cluster

2、 Installation and deployment of zookeeper

  • Unzip the installation packageapache-zookeeper-3.6.1-bin.tar.gzAnd place it in the/rootDirectory.
[[email protected] ~]# cd /usr/local
[[email protected] local]# mkdir zookeeper
[[email protected] local]# cd zookeeper/
[[email protected] zookeeper]# tar -zxvf /root/apache-zookeeper-3.6.1-bin.tar.gz -C ./
[[email protected] zookeeper]# cd apache-zookeeper-3.6.1-bin/
[[email protected] apache-zookeeper-3.6.1-bin]# mkdir data
  • We need to configure the data directory address into the configuration file of zookeeper
[[email protected] apache-zookeeper-3.6.1-bin]# cd conf
[[email protected] conf]# cp zoo_sample.cfg zoo.cfg
[[email protected] conf]# vim zoo.cfg
  • Modify the configuration file, anddatadirRevised asdatacatalog
    13.1
  • Start zookeeper and check the status
[[email protected] apache-zookeeper-3.6.1-bin]# ./bin/zkServer.sh start
[[email protected] apache-zookeeper-3.6.1-bin]# ./bin/zkServer.sh status

13.2

  • You can see from the above that the binding port 2181
  • Next, configure environment variables and set boot up
[[email protected] ~]# vim /etc/profile
##Add these two lines at the end of the configuration document
export ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.6.1-bin
export PATH=$PATH:$ZOOKEEPER_HOME/bin
###
[[email protected] ~]# source /etc/profile
[[email protected] ~]# cd /etc/rc.d/init.d
[[email protected] init.d]# touch zookeeper
[[email protected] init.d]# chmod +x zookeeper 
[[email protected] init.d]# vim zookeeper
###Add the following
#!/bin/bash
#chkconfig:- 20 90
#description:zookeeper
#processname:zookeeper
ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.6.1-bin
export JAVA_HOME=/usr/local/java/jdk1.8.0_161
case $1 in
        start) su root $ZOOKEEPER_HOME/bin/zkServer.sh start;;
        stop) su root $ZOOKEEPER_HOME/bin/zkServer.sh stop;;
        status) su root $ZOOKEEPER_HOME/bin/zkServer.sh status;;
        restart) su root $ZOOKEEPER_HOME/bin/zkServer.sh restart;;
        *) echo "require start|stop|status|restart";;
esac
###
[[email protected] init.d]# chkconfig --add zookeeper
[[email protected] init.d]# chkconfig zookeeper on

3、 Source code:

  • Build an open source project 13 – install IK word breaker and Zookeeper.md
  • https://github.com/ruigege66/Linux/blob/master/ Build an open source project 13 – install IK word breaker and Zookeeper.md
  • CSDN:https://blog.csdn.net/weixin_44630050
  • Blog Garden: https://www.cnblogs.com/ruigege0000/
  • Welcome to WeChat official account: Fourier transform, personal account, for technical exchange only.
    100.0