ckman脚本操作
# 启动和停止
start
#!/bin/sh
DIR=$(cd "$(dirname "$0")" && pwd)
HDIR=$(dirname $DIR)
env GODEBUG=madvdontneed=1 GOTRACEBACK=crash $HDIR/bin/ckman -c=$HDIR/conf/ckman.yaml -p=$HDIR/run/ckman.pid -l=$HDIR/logs/ckman.log -d
1
2
3
4
5
6
2
3
4
5
6
stop
#!/bin/sh
DIR=$(cd "$(dirname "$0")" && pwd)
ps -ef | grep "$DIR/ckman" | grep -v grep | awk '{print $2}' | xargs kill
1
2
3
4
2
3
4
# Docker/Compose相关
Dockerfile
FROM debian:stable-slim
RUN mkdir -p /etc/ckman && cd /etc/ckman && \
mkdir bin run logs conf package
ADD ./ckman /etc/ckman/bin/ckman
ADD ./purger /etc/ckman/bin/purger
ADD ./exporter /etc/ckman/bin/exporter
ADD ./rebalancer /etc/ckman/bin/rebalancer
ADD ./schemer /etc/ckman/bin/schemer
ADD ./migrate /etc/ckman/bin/migrate
ADD ./ckmanpasswd /etc/ckman/bin/ckmanpasswd
ADD ./README.md /etc/ckman/package/README.md
ADD ./resources/ckman.yaml /etc/ckman/conf
ADD ./resources/migrate.yaml /etc/ckman/conf
ADD ./resources/password /etc/ckman/conf/password
ADD ./resources/server.key /etc/ckman/conf/server.key
ADD ./resources/server.crt /etc/ckman/conf/server.crt
WORKDIR /etc/ckman
ENTRYPOINT ["bin/ckman"]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
docker-compose.yml
version: "3"
services:
zookeeper:
image: zookeeper:3.7.0
ports:
- "12181:2181"
cknode:
image: eoitek/ckman-clickhouse:centos-7
privileged: true
deploy:
mode: replicated
replicas: 4
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
上次更新: 2023/11/17, 05:08:19