在CentOS7中安裝zookeeper

2022-05-02 11:00:10 字數 2331 閱讀 2082

參考:

1.zookeeper執行需要jdk環境,先確保有配置jdk,可以參考此處

mkdir -p /usr/local/services/zookeeper

進入zookeeper目錄

cd /usr/local/services/zookeeper

wget

解壓檔案

tar -zxvf zookeeper-3.4.10.tar.gz

3.修改zookeeper配置檔案

進入到 /usr/local/services/zookeeper/zookeeper-3.4.10/conf 目錄中,複製 zoo_sample.cfg 檔案的並命名為為 zoo.cfg:

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/services/zookeeper/zookeeper-3.4.10/data# 日誌資料夾datalogdir=/usr/local/services/zookeeper/zookeeper-3.4.10/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

4.配置zookeeper環境變數

用 vim 開啟 /etc/ 目錄下的配置檔案 profile:

vim /etc/profile

在其底部空白處追加如下內容

#--- update for zookeeper---start

export zookeeper_home=/usr/local/services/zookeeper/zookeeper-3.4.10/

export path=$zookeeper_home/bin:$path

export path

#---update for zookeeper---end

使修改檔案生效

source /etc/profile

5.操作zookeeper

啟動

zkserver.sh start

檢視執行狀態

zkserver.sh status

停止

zkserver.sh stop

重啟

zkserver.sh restart

在CentOS7中安裝TensorFlow

之後,請到 學習安裝centos7 進入centos,開啟終端,切換為管理員模式。輸入 cd 並按下回車鍵,以切換到家目錄。輸入 yum y install epel release 並按下回車鍵,等待安裝完成。輸入 yum install python pip 並按下回車鍵,等待安裝完成。輸入 p...

在Centos 7中安裝 Mysql

一 安裝mysql a 檢視centos發行版本cat etc redhat release b 根據linux發行版本 centos fedora都屬於紅帽系 從mysql官方 獲取yumrepository。輸入命令 wget i c 安裝完 mysql 的yum repository 每次執行...

在centos7中安裝mysql

切換root 去mysql官網 下一步安裝mysql yum install mysql community server y 修改關閉密碼驗證 alter user root localhost identified by 修改 etc my.cnf 在最後新增 開啟 systemctl star...