# Zookeeper单机
# 关键字说明
- 绿色字体代表已完成
- 红色字体代表待完成
# 实验明细
- 配置
- 运行
- 集成
# docker-compose.yaml
# 可参考:https://hub.docker.com/_/zookeeper
version: '3'
services:
zookeeper:
image: registry.cn-shanghai.aliyuncs.com/odboy/ops:zookeeper-3.8.4
container_name: zookeeper-standalone
restart: unless-stopped
volumes:
- "./zookeeper/data:/data"
- "./zookeeper/datalog:/datalog"
- "./zookeeper/logs:/logs"
ports:
- "12181:2181"
privileged: true
# 可视化界面
zookeeper-webui:
image: registry.cn-shanghai.aliyuncs.com/odboy/ops:tobilg-zookeeper-webui
container_name: zookeeper-webui
restart: unless-stopped
environment:
ZK_DEFAULT_NODE: zookeeper:2181
depends_on:
- zookeeper
links:
- zookeeper
ports:
- "18080:8080"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 环境变量
名称 | 默认值 | 描述 |
---|---|---|
ZOO_TICK_TIME | Defaults to 2000. ZooKeeper's tickTime | The length of a single tick, which is the basic time unit used by ZooKeeper, as measured in milliseconds. It is used to regulate heartbeats, and timeouts. For example, the minimum session timeout will be two ticks |
ZOO_INIT_LIMIT | Defaults to 5. ZooKeeper's initLimit | Amount of time, in ticks (see tickTime), to allow followers to connect and sync to a leader. Increased this value as needed, if the amount of data managed by ZooKeeper is large. |
ZOO_SYNC_LIMIT | Defaults to 2. ZooKeeper's syncLimit | Amount of time, in ticks (see tickTime), to allow followers to sync with ZooKeeper. If followers fall too far behind a leader, they will be dropped. |
ZOO_MAX_CLIENT_CNXNS | Defaults to 60. ZooKeeper's maxClientCnxns | Limits the number of concurrent connections (at the socket level) that a single client, identified by IP address, may make to a single member of the ZooKeeper ensemble. |
ZOO_STANDALONE_ENABLED | Defaults to true. Zookeeper's standaloneEnabled | Prior to 3.5.0, one could run ZooKeeper in Standalone mode or in a Distributed mode. These are separate implementation stacks, and switching between them during run time is not possible. By default (for backward compatibility) standaloneEnabled is set to true. The consequence of using this default is that if started with a single server the ensemble will not be allowed to grow, and if started with more than one server it will not be allowed to shrink to contain fewer than two participants. |
ZOO_ADMINSERVER_ENABLED | Defaults to true. Zookeeper's admin.enableServer | The AdminServer is an embedded Jetty server that provides an HTTP interface to the four letter word commands. By default, the server is started on port 8080, and commands are issued by going to the URL "/commands/[command name]", e.g., http://localhost:8080/commands/stat |
ZOO_AUTOPURGE_PURGEINTERVAL | Defaults to 0. Zookeeper's autoPurge.purgeInterval | The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0. |
ZOO_AUTOPURGE_SNAPRETAINCOUNT | Defaults to 3. Zookeeper's autoPurge.snapRetainCount | When enabled, ZooKeeper auto purge feature retains the autopurge.snapRetainCount most recent snapshots and the corresponding transaction logs in the dataDir and dataLogDir respectively and deletes the rest. Defaults to 3. Minimum value is 3. |
ZOO_4LW_COMMANDS_WHITELIST | Defaults to srvr. Zookeeper's 4lw.commands.whitelist | A list of comma separated Four Letter Words commands that user wants to use. A valid Four Letter Words command must be put in this list else ZooKeeper server will not enable the command. By default the whitelist only contains "srvr" command which zkServer.sh uses. The rest of four letter word commands are disabled by default. |
← MySQL单机 Zookeeper集群 →