tiup在aliyun ecs上部署的问题

阿里云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吗?

第一个问题:ecs 的机器上面没有外网 ip,但是在外网又不能访问内网 ip,所以没有办法使用外网 IP 部署。第二个问题能否做端口转发,把外网请求转发到内网来访问 dashboard。

不想用转发。能让pd像grafana那样绑定网卡吗?

稍等,我这边确认下回复。

Hi,目前版本 Tiup 部署的集群尚无法解决这个问题,目前只能暂时端口转发一下,我们会在新版 Tiup 中解决这个问题(监听 0.0.0.0)

新版tiup预计什么时候发布?当前是否有手动修改的方法?

推出新版本时官网会第一时间更新,请关注官网的信息更新,当前没有手动更新的方式,还是建议使用端口转发。

刚留意到v4.0正式版已发布, 请问这个问题是否已处理?

您好,当前还没有发布,暂时没有明确时间,您可以关注下之后发布的 relase note,多谢。

没有吗, 我之前收到github的通知, tidb release了4.0.0, 今天也在oschina上看到了v4.0.0的新闻.

刚试了一下by tiup-cluster v1.0.0, dashboard还是未绑定到0.0.0.0上.

你好,

4.0-GA 已于 2020.5.28 晚 正式发布可以通过 tiup update --self && tiup update --all 升级组件并更更新至 GA 版本上线使用。

tiup已经最新了, 但dashboard是绑定在内网ip上而非0.0.0.0呀.

我的意思是监听修复的问题,并不是在4.0 GA,这个问题还没有修复,可以关注下之后新版本发布的 release note,多谢

Hi,我们预计将在六月底发布新版本的 TiUP Playground / TiUP Cluster 组件支持自定义 bind ip。目前没有手工修改的办法,建议使用反向代理:https://pingcap.com/docs-cn/dev/dashboard/dashboard-ops-reverse-proxy/

1 个赞

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。