阿里云ecs ip: 内网172.19.136.22, 外网47.100.15.8. 就用了一台ecs做测试, 也不想用Docker来部署.
topology.yaml
# Global variables are applied to all deployments and as the default value of
# them if the specific deployment value missing.
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/home/tidb/tidb-deploy"
data_dir: "/home/tidb/tidb-data"
monitored:
deploy_dir: "/home/tidb/tidb-deploy/monitored-9100"
data_dir: "/home/tidb/tidb-data/monitored-9100"
log_dir: "/home/tidb/tidb-deploy/monitored-9100/log"
server_configs:
tidb:
log.slow-threshold: 300
log.level: warn
binlog.enable: false
binlog.ignore-error: false
tikv:
readpool.storage.use-unified-pool: true
readpool.coprocessor.use-unified-pool: true
pd:
schedule.leader-schedule-limit: 4
schedule.region-schedule-limit: 2048
schedule.replica-schedule-limit: 64
replication.enable-placement-rules: true
pd_servers:
- host: 47.100.15.8
client_port: 12379
peer_port: 12380
tidb_servers:
- host: 47.100.15.8
tikv_servers:
- host: 47.100.15.8
tiflash_servers:
monitoring_servers:
- host: 47.100.15.8
grafana_servers:
- host: 47.100.15.8
alertmanager_servers:
- host: 47.100.15.8
第一次尝试: 使用外网ip部署: 部署失败
使用外网ip时肯定不能部署, 因为ecs网卡上没有外网ip:
$ tiup cluster deploy tidb-test v4.0.0-rc ./topology.yaml --user root -i /home/chen/.ssh/tidb_rsa
...
Starting component pd
Starting instance pd 47.100.15.8:12379
pd 47.100.15.8:12379 failed to start: timed out waiting for port 12379 to be started after 1m0s
Error: failed to start: failed to start pd: pd 47.100.15.8:12379 failed to start: timed out waiting for port 12379 to be started after 1m0s: timed out waiting for port 12379 to be started after 1m0s
请问有方法, 让tiup在外网也能在ecs上部署tidb吗?
第二次尝试: 使用内网ip部署: 部署成功, 但外网无法访问tidb dashboard
将topology.yaml上所有的外网ip换成内网ip, 再在ecs上部署, 很顺畅, 一次成功. 比 TiDB Ansible时方便许多, 原先Ansible部署单机测试环境时需要改一些设置, tiup就不用这么麻烦.
问题是无法访问tidb dashboard.
sudo ss -nalpt
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 172.19.136.22:12379 0.0.0.0:* users:(("pd-server",pid=14579,fd=7))
LISTEN 0 128 *:4000 *:* users:(("tidb-server",pid=15023,fd=13))
LISTEN 0 128 *:3000 *:* users:(("grafana-server",pid=15242,fd=6))
因为我已经在ecs上部署了rancher, 因此需修改pd的client_port和peer_port, 不过这个修改不会影响这个问题.
即使在topology.yaml上为tidb_servers,grafana_servers指定了内网地址, 但它还是绑定了所有网卡, 我只要在esc 安全组上添加规则就可在外网访问到它们, 但pd-server绑定的是内网ip, 没法添加规则, 导致外网无法访问tidb dashboard.
请问有方法, 让tiup在ecs上部署tidb也能访问到tidb dashboard吗?