MySql Workbench连接错误

为提高效率,提问时请尽量提供详细背景信息,问题描述清晰可优先响应。以下信息点请尽量提供:

  • 系统版本 & kernel 版本】 Windows 10 ,build 18362
  • TiDB 版本】 4.0
  • 磁盘型号
  • 集群节点分布
  • 数据量 & region 数量 & 副本数
  • 问题描述(我做了什么)】 根据官方文档《 使用 Docker Compose 快速构建 TiDB 集群 》,快速部署 - > 我未执行第三步,而是使用 MySql Workbench 连接,填写 IP 和端口后,当点击 Test Connection 时报错,报错内容为:

Faild to Connect to MySQL at 192.168.1.123:4000 with user root

Lost connection to MySQL server at ‘reading initial communication packet’,system error:0

  • 关键词
  1. 麻烦看下 tidb-server container是否有不断重启的情况
  2. 可以用 docker log 检查各个container 是否有报错的情况

以下是所有有日志的Containers

tidb-docker-compose_tispark-slave0_1

starting org.apache.spark.deploy.worker.Worker, logging to /opt/spark/logs/spark–org.apache.spark.deploy.worker.Worker-1-2012a7e7fa5c.out Spark Command: /opt/jdk/bin/java -cp /opt/spark/conf/:/opt/spark/jars/* -Xmx1g org.apache.spark.deploy.worker.Worker --webui-port 38081 spark://tispark-master:7077

19/11/07 09:12:35 INFO Worker: Started daemon with process name: 11@2012a7e7fa5c 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for TERM 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for HUP 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for INT 19/11/07 09:12:35 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable 19/11/07 09:12:35 INFO SecurityManager: Changing view acls to: root 19/11/07 09:12:35 INFO SecurityManager: Changing modify acls to: root 19/11/07 09:12:35 INFO SecurityManager: Changing view acls groups to: 19/11/07 09:12:35 INFO SecurityManager: Changing modify acls groups to: 19/11/07 09:12:36 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); groups with view permissions: Set(); users with modify permissions: Set(root); groups with modify permissions: Set() 19/11/07 09:12:36 INFO Utils: Successfully started service ‘sparkWorker’ on port 35039. 19/11/07 09:12:36 INFO Worker: Starting Spark worker 172.18.0.14:35039 with 2 cores, 1024.0 MB RAM 19/11/07 09:12:36 INFO Worker: Running Spark version 2.4.3 19/11/07 09:12:36 INFO Worker: Spark home: /opt/spark 19/11/07 09:12:37 INFO Utils: Successfully started service ‘WorkerUI’ on port 38081. 19/11/07 09:12:37 INFO WorkerWebUI: Bound WorkerWebUI to 0.0.0.0, and started at http://2012a7e7fa5c:38081 19/11/07 09:12:37 INFO Worker: Connecting to master tispark-master:7077… 19/11/07 09:12:37 INFO TransportClientFactory: Successfully created connection to tispark-master/172.18.0.12:7077 after 67 ms (0 ms spent in bootstraps) 19/11/07 09:12:37 INFO Worker: Successfully registered with master spark://0.0.0.0:7077

tidb-docker-compose_tispark-master_1

starting org.apache.spark.deploy.master.Master, logging to /opt/spark/logs/spark–org.apache.spark.deploy.master.Master-1-9d9b5b578a76.out Spark Command: /opt/jdk/bin/java -cp /opt/spark/conf/:/opt/spark/jars/* -Xmx1g org.apache.spark.deploy.master.Master --host 0.0.0.0 --port 7077 --webui-port 8080

19/11/07 09:12:35 INFO Master: Started daemon with process name: 11@9d9b5b578a76 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for TERM 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for HUP 19/11/07 09:12:35 INFO SignalUtils: Registered signal handler for INT 19/11/07 09:12:35 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable 19/11/07 09:12:35 INFO SecurityManager: Changing view acls to: root 19/11/07 09:12:35 INFO SecurityManager: Changing modify acls to: root 19/11/07 09:12:35 INFO SecurityManager: Changing view acls groups to: 19/11/07 09:12:35 INFO SecurityManager: Changing modify acls groups to: 19/11/07 09:12:36 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); groups with view permissions: Set(); users with modify permissions: Set(root); groups with modify permissions: Set() 19/11/07 09:12:36 INFO Utils: Successfully started service ‘sparkMaster’ on port 7077. 19/11/07 09:12:36 INFO Master: Starting Spark master at spark://0.0.0.0:7077 19/11/07 09:12:36 INFO Master: Running Spark version 2.4.3 19/11/07 09:12:36 INFO Utils: Successfully started service ‘MasterUI’ on port 8080. 19/11/07 09:12:37 INFO MasterWebUI: Bound MasterWebUI to 0.0.0.0, and started at http://9d9b5b578a76:8080 19/11/07 09:12:37 INFO Master: I have been elected leader! New state: ALIVE 19/11/07 09:12:37 INFO Master: Registering worker 172.18.0.14:35039 with 2 cores, 1024.0 MB RAM

tidb-docker-compose_grafana_1

t=2019-11-07T09:12:33+0000 lvl=eror msg=“Can’t read alert notification provisioning files from directory” logger=provisioning.notifiers path=/etc/grafana/provisioning/notifiers error=“open /etc/grafana/provisioning/notifiers: no such file or directory” t=2019-11-07T09:17:50+0000 lvl=eror msg=“Dashboard not found” logger=context userId=0 orgId=1 uname= error=“Dashboard not found”

tidb-docker-compose_prometheus_1

level=error ts=2019-11-07T09:12:36.629794Z caller=wal.go:709 component=tsdb msg=“operation failed” err=“sync WAL directory: sync /data/prometheus/wal: invalid argument”

tidb-docker-compose_tidb-vision_1

Activating privacy features… done. http://0.0.0.0:8010

这边并没有看到 tidb-server 相关的日志

所有启动的Containers有:

pingcap/tispark:latest

pingcap/tispark:latest

pingcap/tidb:latest

pingcap/tikv:latest

grafana/grafana:6.0.1

pingcap/pd:latest

prom/prometheus:v2.2.1

pingcap/tidb-vision:latest

prom/pushgateway:v0.3.1

docker-compose.yml (5.3 KB)

可以尝试这个 docker-compose.yml 文件进行部署试试

我替换了 docker-compose.yml 文件,并部署成功了,但当我使用 Workbench 测试连接时依然报

查看 tidb-server container 依然没有日志产生。

补充:Telnet 是通的。

是远程连接还是本地连接,在 Docker 机器上使用 mysql -uroot -P4000 -h127.0.0.1 命令连接的吗?

我的使用环境是,在 Windows 上装了 Docker,使用 Docker 安装 TiDB ,我连接是在 Windows 上使用 Workbench 连接的。

workbench 的连接配置看一下

hostname 改为 127.0.0.1 试下

这些我都试过了。

看下 docker container ls 的情况

docker exec -it 2e6df4e52c24 sh 进入 tidb-server 的 container,然后执行 ps -ef | grep tidb,检查一下 tidb 进程

您好: 稍等,正在查看,有进展会尽快反馈,多谢

您好: 请在tidb环境中安装mysql客户端,使用命令行测试能否访问,我们先排除下工具和docker的影响,多谢。

是指进到 tidb-server Container 中安装 MySql 客户端吗?