阿里雲 Centos7 安裝zookeeper

2021-08-20 15:25:48 字數 4111 閱讀 8887

1、建立 /usr/local/zookeeper 資料夾

shell>mkdir -p /usr/local/zookeeper
2、進入到 /usr/local/zookeeper 目錄中

shell> wget  htps:
4、解壓縮 zookeeper-3.5.4-beta.tar.gz

shell>tar -zxvf zookeeper-3.5.3-beta.tar.gz
5、配置資料夾檔案移至/usr/local/zookeeper/下

shell>mv /usr/local/webtools/zookeeper-3.5.4-beta /usr/local/zookeeper/
進入到 /usr/local/zookeeper/zookeeper-3.5.4-beta/conf 目錄中

shell>cd zookeeper-3.5.4-beta/conf/
複製 zoo_sample.cfg 檔案的並命名為為 zoo.cfg

shell>cp zoo_sample.cfg zoo.cfg
用 vim 開啟 zoo.cfg 檔案並修改其內容為如下:

# the number of milliseconds of each tick

# zookeeper 定義的基準時間間隔,單位:毫秒

ticktime=2000

# the number of ticks that the initial

# synchronization phase can take

initlimit=10

# the number of ticks that can pass between

# sending a request and getting an acknowledgement

synclimit=5

# the directory where the snapshot is stored.

# do not use /tmp for storage, /tmp here is just

# example sakes.

# datadir=/tmp/zookeeper

# 資料資料夾

datadir=/usr/local/zookeeper/zookeeper-3.5.3-beta/data

# 日誌資料夾

datalogdir=/usr/local/zookeeper/zookeeper-3.5.3-beta/logs

# the port at which the clients will connect

# 客戶端訪問 zookeeper 的埠號

clientport=2181

# the maximum number of client connections.

# increase this if you need to handle more clients

#maxclientcnxns=60

## be sure to read the maintenance section of the

# administrator guide before turning on autopurge.

## ## the number of snapshots to retain in datadir

#autopurge.snapretaincount=3

# purge task interval in hours

# set to "0" to disable auto purge feature

#autopurge.purgeinterval=1

儲存並關閉 zoo.cfg 檔案

用 vim 開啟 /etc/ 目錄下的配置檔案 profile並在其尾部追加如下內容

shell>vim /etc/profile
export zookeeper_home=/usr/local/zookeeper/zookeeper-3.5.4-beta

export path=$zookeeper_home/bin:$path

export path

使 /etc/ 目錄下的 profile 檔案即可生效:source /etc/profile

6、操作命令

shell>zkserver.sh start
啟動 zookeeper 服務如列印如下資訊則表明啟動成功:

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

starting zookeeper ... started

shell>zkserver.sh status

查詢 zookeeper 狀態

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

client port found: 2181. client address: localhost.

mode: standalone

shell>zkserver.sh stop

關閉 zookeeper 服務如列印如下資訊則表明成功關閉:

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

stopping zookeeper ... stopped

shell>zkserver.sh restart

重啟 zookeeper 服務如列印如下資訊則表明重啟成功:

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

stopping zookeeper ... no zookeeper to stop (could not find file /usr/local/zookeeper/zookeeper-3.5

.4-beta/data/zookeeper_server.pid)

zookeeper jmx enabled by

default

using config: /usr/local/zookeeper/zookeeper-3.5.4-beta/bin/../conf/zoo.cfg

starting zookeeper ... started

阿里雲centos7 安裝mysql

wget sudo rpm ivh mysql community release el7 5.noarch.rpm 安裝 yum install mysql server yum install mysql devel yum install mysql rpm qa grep i mysql 啟...

阿里雲centos7 安裝vsftpd

vsftpd相關問題 安裝yum y install vsftpd設定開機啟動 systemctl enable vsftpd啟動ftp服務 systemctl start vsftpd.serviceuseradd g root d home wwwroot asite s sbin nologi...

阿里雲centos7安裝mysql

使用root登入 1.確保伺服器系統處於最新狀態 root localhost yum y update如果顯示以下內容說明已經更新完成 replaced grub2.x86 64 1 2.02 0.64.el7.centos grub2 tools.x86 64 1 2.02 0.64.el7.c...