CentOS7安裝zookeeper集群

2021-08-18 22:41:02 字數 2682 閱讀 6692

解壓zookeeper並分別建立3個資料夾

解壓檔案複製到各個檔案中,進入conf檔案中,

複製檔案並修改名稱

編輯zoo.cfg

# server 2

# the number of milliseconds of each tick

# 伺服器與客戶端之間互動的基本時間單元(ms)

ticktime=2000

# the number of ticks that the initial

# synchronization phase can take

# zookeeper所能接受的客戶端數量

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.

# 儲存zookeeper資料,日誌路徑

datadir=/opt/zookeeper-cluster/zookerper-1/data

datalogdir=/opt/zookeeper-cluster/zookerper-1/log

# the port at which the clients will connect

# 客戶端與zookeeper相互互動的埠

clientport=2181

server.1= 127.0.0.1:2888:3888

server.2= 127.0.0.1:2889:3889

server.3= 127.0.0.1:2890:3890

#server.a=b:c:d 其中a是乙個數字,代表這是第幾號伺服器;b是伺服器的ip位址;c表示伺服器與群集中的「領導者」交換資訊的埠;當領導者失效後,d表示用來執行選舉時伺服器相互通訊的埠。

# 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

/opt/zookeeper-cluster/zookerper-1/下建立data和log檔案

進入data資料夾

vi myid 並寫入1

zookeeper-1就算完成了

繼續完成zookeeper-2和zookeeper-3並修改相應的位置,與zookeeper-1相似

如果是一台機器上部署集群的話,clientport埠一定不能一樣,

啟動zookeeper

檢視狀態(全部啟動完了後再檢視狀態)

ok,啟動完成

centos7 安裝centos桌面

一 輸入命令 yum groupinstall gnome desktop graphical administration tools 二 設定系統啟動等級。systemctl get default 獲取當前系統執行形式,會顯示multi user.target 命令列終端 或者 graphic...

centos7安裝nginx(yum安裝)

感興趣的可以檢視用壓縮包安裝的過程 1 通過檢視當前linux核心以及版本號進行獲取nginx的rpm安裝源適配。uname a2 獲取nginx相關的rpm源 防止版本號不對應產生的各種問題 rpm uvh3 yum安裝nginx yum install nginx等待安裝完成。1 安裝完成後,n...

CentOS7安裝docker(yum安裝)

1.中文文件 2.檢視linux版本 cat etc redhat release3.是否聯網 這裡yun安裝,不聯網gg 4.解除安裝舊版本 sudo yum remove docker docker client docker client latest docker common docker...