提交zookeeper修改

This commit is contained in:
KennyLee 2017-07-18 16:41:21 +08:00
parent beffacd4a7
commit 82ce942fa2
7 changed files with 60 additions and 24 deletions

View File

@ -51,7 +51,11 @@
配置说明
* 基本配置信息参考 [LTS](http://git.oschina.net/hugui/light-task-scheduler),而配置文件都可以在宿主目录找到。
* 由于在docker环境而lts默认绑定的是容器内的ip还好lts支持手动指定 `bind-ip` 。所以需要手动配置各自部署的服务器宿主的IP影响的文件有 `lts-admin/config/lts-monitor.cfg`、`lts-jobtracker/config/application.yml `,以及**不在lts-center中另外跑的tasktracker节点**。*有空再找办法解决至少让修改简单点也许采取类似host的解决方案也可以*
* docker的network配置为 `host`
由于 `jobtrack` 等应用在docker环境。而外部启动 `tasktrack` 可能不在docker的同一个network中而lts默认绑定的是容器内的ip还好lts支持手动指定 `bind-ip`暂时使用host模式。
故此,`admin``jobtrack`和`tasktrack`等节点需要配置各自部署的服务器宿主的IP影响的文件有 `lts-admin/config/lts-monitor.cfg`、`lts-jobtracker/config/application.yml `,以及**不在lts-center中另外跑的tasktracker节点**。*有空再找办法解决至少让修改简单点也许采取类似host的解决方案也可以*
* [lts-tasktracker](./lts-tasktracker)

View File

@ -1,43 +1,74 @@
version: '2'
version: '3'
services:
zoo1:
image: zookeeper:3.4.9
image: registry.cn-hangzhou.aliyuncs.com/kennylee/zookeeper
container_name: lts-zoo1
restart: unless-stopped
ports:
- "5181:2181"
- "2181:2181"
volumes:
- ./data/zoo1/data/:/data/:z
- ./data/zoo1/datalog/:/datalog/:z
environment:
- ZOO_MY_ID=1
- TZ=Asia/Shanghai
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
db:
image: registry.alauda.cn/kenny/mysql
image: registry.cn-hangzhou.aliyuncs.com/kennylee/mysql
container_name: lts-mysql
ports:
- "5306:3306"
- "3306:3306"
restart: unless-stopped
volumes:
- ./data/mysql/:/var/lib/mysql/:rw
- ./lts-mysql/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
environment:
- TZ=Asia/Shanghai
- MYSQL_ROOT_PASSWORD=111111
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
admin:
extends:
file: ./lts-admin/docker-compose.yml
service: admin
build: ./lts-admin/
container_name: lts-admin
network_mode: 'host'
volumes:
- ./lts-admin/config/lts-admin.cfg:/opt/tomcat/webapps/ROOT/WEB-INF/classes/lts-admin.cfg:ro
- ./lts-admin/config/lts-monitor.cfg:/opt/tomcat/webapps/ROOT/WEB-INF/classes/lts-monitor.cfg:ro
- ./lts-admin/config/server.xml:/opt/tomcat/conf/server.xml:ro
restart: unless-stopped
depends_on:
- zoo1
- db
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
jobtracker:
extends:
file: ./lts-jobtracker/docker-compose.yml
service: jobtracker
build: ./lts-jobtracker/
container_name: lts-jobtracker
volumes:
- ./lts-jobtracker/config/application.yml:/data/application.yml:ro
network_mode: 'host'
entrypoint:
- java
- -jar
- /data/lts-jobtracker.jar
- --spring.config.location=/data/application.yml
restart: unless-stopped
environment:
JAVA_OPTS: -server -Xms128m -Xmx512m
depends_on:
- zoo1
- db
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'

View File

@ -1,4 +1,4 @@
FROM registry.cn-hangzhou.aliyuncs.com/kennylee/tomcat:tomcat8-jdk8
FROM registry.cn-hangzhou.aliyuncs.com/kennylee/tomcat:tomcat8-jre8
MAINTAINER kennylee26 <kennylee26@gmail.com>

View File

@ -3,7 +3,7 @@ console.username=admin
console.password=admin
# 注册中心地址可以是zk也可以是redis
registryAddress=zookeeper://127.0.0.1:5181
registryAddress=zookeeper://127.0.0.1:2181
# registryAddress=redis://127.0.0.1:6379
# 集群名称
@ -14,7 +14,7 @@ bindIp=127.0.0.1
configs.zk.client=zkclient
# ------ 这个是Admin存储数据的地方,也可以和JobQueue的地址一样 ------
configs.jdbc.url=jdbc:mysql://127.0.0.1:5306/lts?useUnicode=true&characterEncoding=UTF-8
configs.jdbc.url=jdbc:mysql://127.0.0.1:3306/lts?useUnicode=true&characterEncoding=UTF-8
configs.jdbc.username=root
configs.jdbc.password=111111

View File

@ -1,6 +1,6 @@
# 注册中心地址可以是zk也可以是redis
registryAddress=zookeeper://127.0.0.1:5181
registryAddress=zookeeper://127.0.0.1:2181
# registryAddress=redis://127.0.0.1:6379
# 集群名称
@ -17,7 +17,7 @@ configs.zk.client=zkclient
configs.job.queue=mysql
# ------ 1. 如果是mysql作为任务队列 ------
configs.jdbc.url=jdbc:mysql://127.0.0.1:5306/lts?useUnicode=true&characterEncoding=UTF-8
configs.jdbc.url=jdbc:mysql://127.0.0.1:3306/lts?useUnicode=true&characterEncoding=UTF-8
configs.jdbc.username=root
configs.jdbc.password=111111
@ -32,4 +32,4 @@ jdbc.datasource.provider=mysql
# 使用 可选值 fastjson, jackson
# configs.lts.json=fastjson
bindIp=192.168.3.232
bindIp=192.168.0.117

View File

@ -2,13 +2,13 @@ lts:
jobtracker:
cluster-name: default_cluster
listen-port: 35001
registry-address: zookeeper://127.0.0.1:5181
registry-address: zookeeper://127.0.0.1:2181
configs:
job:
logger: mysql
queue: mysql
jdbc:
url: jdbc:mysql://127.0.0.1:5306/lts?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://127.0.0.1:3306/lts?useUnicode=true&characterEncoding=UTF-8
username: root
password: 111111
bind-ip: 192.168.3.232
bind-ip: 192.168.0.117

View File

@ -47,5 +47,6 @@ ENV PATH=$PATH:/$DISTRO_NAME/bin \
ZOOCFGDIR=$ZOO_CONF_DIR
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["zkServer.sh", "start-foreground"]