Skip to content

Commit d355d33

Browse files
committed
add zkdash
1 parent 7224fec commit d355d33

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed

zkdash/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:2.7-alpine3.6
2+
3+
MAINTAINER ameizi <[email protected]>
4+
5+
RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \
6+
&& echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \
7+
&& apk update && apk upgrade && apk add tzdata git --no-cache \
8+
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
9+
&& echo "Asia/Shanghai" > /etc/timezone \
10+
&& git clone https://github.com/ireaderlab/zkdash.git
11+
12+
WORKDIR /zkdash
13+
14+
RUN pip install --trusted-host pypi.douban.com -i http://pypi.douban.com/simple -r requirements.txt
15+
16+
ADD conf.yml /zkdash/conf/
17+
ADD *.sh /zkdash/
18+
19+
EXPOSE 8765
20+
21+
CMD ["/zkdash/run.sh"]

zkdash/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# zkdash
2+
3+
https://github.com/ireaderlab/zkdash
4+
5+
掌阅科技zkdash。zkdash是一个zookeeper的管理界面。
6+
7+
本地构建
8+
9+
```bash
10+
docker build -t zkdash .
11+
```
12+
13+
在开始之前需要先创建数据库
14+
15+
使用本地构建好的镜像
16+
17+
```bash
18+
docker run \
19+
-d \
20+
--name zkdash \
21+
-e DB_NAME=zkdash \
22+
-e DB_HOST=192.168.31.228 \
23+
-e DB_PORT=3306 \
24+
-e DB_USER=root \
25+
-e DB_PWD=root \
26+
-v /data/logs/zkdash:/data/logs/zkdash \
27+
-p 8765:8765 \
28+
zkdash
29+
```
30+
31+
使用构建好且上传到阿里云的镜像
32+
33+
```bash
34+
docker run \
35+
-d \
36+
--name zkdash \
37+
-e DB_NAME=zkdash \
38+
-e DB_HOST=192.168.31.228 \
39+
-e DB_PORT=3306 \
40+
-e DB_USER=root \
41+
-e DB_PWD=root \
42+
-v /data/logs/zkdash:/data/logs/zkdash \
43+
-p 8765:8765 \
44+
registry.cn-hangzhou.aliyuncs.com/ameizi/zkdash
45+
```

zkdash/conf.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# database
2+
DATABASE:
3+
db: '<DB_NAME>'
4+
host: '<DB_HOST>'
5+
port: <DB_PORT>
6+
user: '<DB_USER>'
7+
passwd: '<DB_PWD>'
8+
9+
# 是否通过QConf获取zookeeper数据(使用该项需要在本地先运行QConf客户端agent)
10+
USE_QCONF: False
11+
12+
# log conf
13+
LOG_ITEMS:
14+
- file: /data/logs/zkdash/zkdash.log
15+
log_levels:
16+
- DEBUG
17+
- INFO
18+
- WARNING
19+
- ERROR
20+
- CRITICAL
21+
format: '[%(levelname)s %(asctime)s %(filename)s %(lineno)d] %(message)s'
22+
when: 'midnight'
23+
interval: 1
24+
backup_count: 10
25+
backup_suffix: '%Y%m%d'
26+
level: 'DEBUG'
27+
- file: /data/logs/zkdash/zkdash.error.log
28+
log_levels:
29+
- WARNING
30+
- ERROR
31+
- CRITICAL
32+
format: '[%(levelname)s %(asctime)s %(filename)s %(lineno)d] %(message)s'
33+
when: 'midnight'
34+
interval: 1
35+
backup_count: 30
36+
backup_suffix: '%Y%m%d'
37+
level: 'DEBUG'

zkdash/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
sed -Ei 's/<DB_NAME>/'$DB_NAME'/g' ./conf/conf.yml
3+
sed -Ei 's/<DB_HOST>/'$DB_HOST'/g' ./conf/conf.yml
4+
sed -Ei 's/<DB_PORT>/'$DB_PORT'/g' ./conf/conf.yml
5+
sed -Ei 's/<DB_USER>/'$DB_USER'/g' ./conf/conf.yml
6+
sed -Ei 's/<DB_PWD>/'$DB_PWD'/g' ./conf/conf.yml
7+
8+
python ./bin/syncdb.py
9+
python init.py -port=8765

0 commit comments

Comments
 (0)