提交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),而配置文件都可以在宿主目录找到。 * 基本配置信息参考 [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) * [lts-tasktracker](./lts-tasktracker)

View File

@ -1,43 +1,74 @@
version: '2' version: '3'
services: services:
zoo1: zoo1:
image: zookeeper:3.4.9 image: registry.cn-hangzhou.aliyuncs.com/kennylee/zookeeper
container_name: lts-zoo1 container_name: lts-zoo1
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5181:2181" - "2181:2181"
volumes: volumes:
- ./data/zoo1/data/:/data/:z - ./data/zoo1/data/:/data/:z
- ./data/zoo1/datalog/:/datalog/:z - ./data/zoo1/datalog/:/datalog/:z
environment: environment:
- ZOO_MY_ID=1 - ZOO_MY_ID=1
- TZ=Asia/Shanghai logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
db: db:
image: registry.alauda.cn/kenny/mysql image: registry.cn-hangzhou.aliyuncs.com/kennylee/mysql
container_name: lts-mysql container_name: lts-mysql
ports: ports:
- "5306:3306" - "3306:3306"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./data/mysql/:/var/lib/mysql/:rw - ./data/mysql/:/var/lib/mysql/:rw
- ./lts-mysql/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro - ./lts-mysql/database/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
environment: environment:
- TZ=Asia/Shanghai
- MYSQL_ROOT_PASSWORD=111111 - MYSQL_ROOT_PASSWORD=111111
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
admin: admin:
extends: build: ./lts-admin/
file: ./lts-admin/docker-compose.yml container_name: lts-admin
service: 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 restart: unless-stopped
depends_on: depends_on:
- zoo1 - zoo1
- db - db
logging:
driver: 'json-file'
options:
max-size: '30m'
max-file: '1'
jobtracker: jobtracker:
extends: build: ./lts-jobtracker/
file: ./lts-jobtracker/docker-compose.yml container_name: lts-jobtracker
service: 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 restart: unless-stopped
environment:
JAVA_OPTS: -server -Xms128m -Xmx512m
depends_on: depends_on:
- zoo1 - zoo1
- db - 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> MAINTAINER kennylee26 <kennylee26@gmail.com>

View File

@ -3,7 +3,7 @@ console.username=admin
console.password=admin console.password=admin
# 注册中心地址可以是zk也可以是redis # 注册中心地址可以是zk也可以是redis
registryAddress=zookeeper://127.0.0.1:5181 registryAddress=zookeeper://127.0.0.1:2181
# registryAddress=redis://127.0.0.1:6379 # registryAddress=redis://127.0.0.1:6379
# 集群名称 # 集群名称
@ -14,7 +14,7 @@ bindIp=127.0.0.1
configs.zk.client=zkclient configs.zk.client=zkclient
# ------ 这个是Admin存储数据的地方,也可以和JobQueue的地址一样 ------ # ------ 这个是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.username=root
configs.jdbc.password=111111 configs.jdbc.password=111111

View File

@ -1,6 +1,6 @@
# 注册中心地址可以是zk也可以是redis # 注册中心地址可以是zk也可以是redis
registryAddress=zookeeper://127.0.0.1:5181 registryAddress=zookeeper://127.0.0.1:2181
# registryAddress=redis://127.0.0.1:6379 # registryAddress=redis://127.0.0.1:6379
# 集群名称 # 集群名称
@ -17,7 +17,7 @@ configs.zk.client=zkclient
configs.job.queue=mysql configs.job.queue=mysql
# ------ 1. 如果是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.username=root
configs.jdbc.password=111111 configs.jdbc.password=111111
@ -32,4 +32,4 @@ jdbc.datasource.provider=mysql
# 使用 可选值 fastjson, jackson # 使用 可选值 fastjson, jackson
# configs.lts.json=fastjson # configs.lts.json=fastjson
bindIp=192.168.3.232 bindIp=192.168.0.117

View File

@ -2,13 +2,13 @@ lts:
jobtracker: jobtracker:
cluster-name: default_cluster cluster-name: default_cluster
listen-port: 35001 listen-port: 35001
registry-address: zookeeper://127.0.0.1:5181 registry-address: zookeeper://127.0.0.1:2181
configs: configs:
job: job:
logger: mysql logger: mysql
queue: mysql queue: mysql
jdbc: 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 username: root
password: 111111 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 ZOOCFGDIR=$ZOO_CONF_DIR
COPY docker-entrypoint.sh / COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["zkServer.sh", "start-foreground"] CMD ["zkServer.sh", "start-foreground"]