「Apache ZooKeeper」:修訂間差異
跳至導覽
跳至搜尋
第26行: | 第26行: | ||
server.2=172.31.x:2888:3888 | server.2=172.31.x:2888:3888 | ||
server.3=172.31.x:2888:3888 | server.3=172.31.x:2888:3888 | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="systemd"> | |||
[Unit] | |||
Description=ZooKeeper Service | |||
Documentation=http://zookeeper.apache.org | |||
Requires=network.target | |||
After=network.target | |||
[Service] | |||
Type=forking | |||
User=nobody | |||
Group=nogroup | |||
ExecStart=/usr/share/zookeeper/bin/zkServer.sh start /etc/zookeeper/conf/zookeeper.conf | |||
ExecStop=/usr/share/zookeeper/bin/zkServer.sh stop /etc/zookeeper/conf/zookeeper.conf | |||
ExecReload=/usr/share/zookeeper/bin/zkServer.sh restart /etc/zookeeper/conf/zookeeper.conf | |||
WorkingDirectory=/var/lib/zookeeper | |||
[Install] | |||
WantedBy=default.target | |||
</syntaxhighlight> | </syntaxhighlight> | ||
於 2019年2月28日 (四) 04:16 的修訂
ZooKeeper是一套分散式的Key-Value系統。
安裝
在Ubuntu下可以直接安裝:
sudo apt install -y zookeeper
設定
每台機器的/etc/zookeeper/conf_production/myid
都需要不同,可以從1
到255
:
1
這邊要列出所有機器/etc/zookeeper/conf_production/zoo.cfg
:
tickTime=2000
dataDir=/var/lib/zookeeper/
clientPort=2181
initLimit=5
syncLimit=2
server.1=172.31.x:2888:3888
server.2=172.31.x:2888:3888
server.3=172.31.x:2888:3888
[Unit]
Description=ZooKeeper Service
Documentation=http://zookeeper.apache.org
Requires=network.target
After=network.target
[Service]
Type=forking
User=nobody
Group=nogroup
ExecStart=/usr/share/zookeeper/bin/zkServer.sh start /etc/zookeeper/conf/zookeeper.conf
ExecStop=/usr/share/zookeeper/bin/zkServer.sh stop /etc/zookeeper/conf/zookeeper.conf
ExecReload=/usr/share/zookeeper/bin/zkServer.sh restart /etc/zookeeper/conf/zookeeper.conf
WorkingDirectory=/var/lib/zookeeper
[Install]
WantedBy=default.target
外部連結
- 官方網站 (英文)