CodisLabs / CodisLabs/codis

codis-proxy的jodis_addr配置项和codis-proxy命令中zookeeper option的关系, 两者怎么指定?(有日志, 描述详细)

Open
#1,333 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
13.2k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

以下是codis-proxy的yml文件:
```
codis-proxy2:
restart: always
image: ***/codis-server:dev-1.5.0-release3.2
hostname: codis-proxy2
command: codis-proxy --zookeeper=192.168.130.54:2181,192.168.130.55:2181,192.168.130.53:2181
-c /codis/proxy.toml --host-admin 192.168.130.120:28099 --host-proxy 192.168.130.120:28098
ports:
- "28098:19000"
- "28099:11080"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /kmx/codis/log/:/codis/log
# - /kmx/codis/config/codis-proxy/proxy.toml:/codis/
logging:
options:
max-size: 3g
mem_limit: 12g
host: 192.168.130.120
health_check:
timeout: 10
s_depends_on:
- "codis-dashboard"

```
运行时指定的配置文件 /codis/proxy.toml 里面的jodis_addr为**192.168.130.13:2181**; 运行时指定的zk地址
**192.168.130.54:2181,192.168.130.55:2181,192.168.130.53:2181**
运行codis-proxy时的日志:
```
2017/08/23 18:30:58 main.go:186: [WARN] create proxy with config
proto_type = "tcp4"
jodis_name = "zookeeper"
jodis_addr = "192.168.130.13:2181"
proxy_addr = "0.0.0.0:19000"
***
2017/08/23 18:30:58 main.go:222: [WARN] [0xc42012e210] proxy waiting online ...
2017/08/23 18:30:58 zkclient.go:23: [INFO] zookeeper - zkclient setup new connection to
192.168.130.54:2181,192.168.130.55:2181,192.168.130.53:2181

```
最后proxy信息存在了**192.168.130.13:2181**, 请问这两者有什么关系吗?

***

**现在有一个需求是在docker镜像运行的时候动态指定zk的地址, 请问怎么做?**
万分感谢~~~

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.