【问题标题】:Artifactory not connecting to host mysqlArtifactory没有连接到主机mysql
【发布时间】:2018-04-19 06:21:21
【问题描述】:

我正在尝试执行以下命令。

docker run --name artifactory-host-mysql -e DB_TYPE=mysql -e DB_HOST=my_host_ip -e DB_URL='jdbc:mysql://my_host_ip:3306/some_db?characterEncoding=UTF-8&elideSetAutoCommits=true' -e DB_PORT=3306  -e DB_USER=my_db_user -e DB_PASSWORD=my_passowrd -d -p 8083:8083 --net=host -v /artifactory/mysql-connector-java-5.1.46.jar:/opt/jfrog/artifactory/tomcat/lib/mysql-connector-java-5.1.46.jar artifactory-hostmysql

输出如下

Preparing to run Artifactory in Docker
=====================================
2018-04-19 05:32:46   [44 entrypoint-artifactory.sh] Dockerfile for this image can found inside the container.
2018-04-19 05:32:46  [282 entrypoint-artifactory.sh] Checking DB_TYPE
2018-04-19 05:32:46  [285 entrypoint-artifactory.sh] DB_TYPE is set to mysql
2018-04-19 05:32:46  [213 entrypoint-artifactory.sh] DB_HOST is set to my_ip
2018-04-19 05:32:46  [215 entrypoint-artifactory.sh] Checking if need to copy mysql configuration
2018-04-19 05:32:46  [231 entrypoint-artifactory.sh] Copying mysql configuration...
2018-04-19 05:32:46  [239 entrypoint-artifactory.sh] Setting DB_URL to jdbc:mysql://my_ip:3306/some_db?characterEncoding=UTF-8&elideSetAutoCommits=true
2018-04-19 05:32:46  [243 entrypoint-artifactory.sh] Setting DB_USER to artifactory
2018-04-19 05:32:46  [247 entrypoint-artifactory.sh] Setting DB_PASSWORD to **********
2018-04-19 05:32:46  [251 entrypoint-artifactory.sh] Setting DB_PORT to 3306
2018-04-19 05:32:46  [266 entrypoint-artifactory.sh] Setting DB_HOST to my_ip
2018-04-19 05:32:46  [190 entrypoint-artifactory.sh] Waiting for DB mysql to be ready on my_ip/3306 within 30 seconds
2018-04-19 05:32:46  [198 entrypoint-artifactory.sh] .
2018-04-19 05:33:16  [198 entrypoint-artifactory.sh] .
2018-04-19 05:33:17   [34 entrypoint-artifactory.sh] ERROR: DB mysql failed to start in the given time

mysql 服务已经在主机中运行 端口 3306 也为 tcp 开放 - netstat -tlnp 的输出低于

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -

【问题讨论】:

  • Do I need to open the ...不要让我们悬而未决!
  • @TimBiegeleisen 实际上正在考虑通过 iptables 打开 3306,但随后端口再次从 netstat 命令输出为 tcp 协议打开

标签: mysql docker artifactory


【解决方案1】:

以下解决方案对我有用。

bind-address            = 0.0.0.0

在文件/etc/mysql/mysql.conf.d/mysqld.cnf中

【讨论】:

  • 但是,我在运行当前缺少的 docker run 命令 master.key 文件时遇到缺少 master.key 的错误 - 等待 Access 创建它。 1 秒后重新尝试检查 master.key 文件是否存在。
  • 如何在 artifactory 容器内 /opt/jfrog/artifactory/etc/security/ 这个位置生成 artifactory.key 和 master.key 文件?
猜你喜欢
  • 2019-11-21
  • 2015-03-24
  • 1970-01-01
  • 2013-12-24
  • 1970-01-01
  • 1970-01-01
  • 2018-11-15
  • 2012-04-01
  • 1970-01-01
相关资源
最近更新 更多