sl28271495 发表于 2025-4-28 15:29:59

dock中数据库自动关闭情况

在没网的情况下,启动镜像后1-2分钟就关闭了数据库,报错如下



Could not find OpenSSL on the system
MySQL init process in progress...
MySQL init process failed.


急急急

yejr 发表于 2025-4-28 15:32:01

请详细补充如何启动Docker容器的,如: docker run ...

以及详细的日志信息,如:docker logs ....

sl28271495 发表于 2025-4-28 15:39:02

yejr 发表于 2025-4-28 15:32
请详细补充如何启动Docker容器的,如: docker run ...

以及详细的日志信息,如:docker logs .... ...

启动命令:docker run -d -v /home/greatSql/data:/merged/data/GreatSQL --name greatsql --hostname=greatsql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 greatsql/greatsql

sl28271495 发表于 2025-4-28 15:39:48

yejr 发表于 2025-4-28 15:32
请详细补充如何启动Docker容器的,如: docker run ...

以及详细的日志信息,如:docker logs .... ...

启动命令:docker run -d -v /home/greatSql/data:/merged/data/GreatSQL --name greatsql --hostname=greatsql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 registry.cn-beijing.aliyuncs.com/greatsql/greatsql

sl28271495 发表于 2025-4-28 15:40:22

yejr 发表于 2025-4-28 15:32
请详细补充如何启动Docker容器的,如: docker run ...

以及详细的日志信息,如:docker logs .... ...

启动命令:docker run -d -v /home/greatSql/data:/merged/data/GreatSQL --name greatsql --hostname=greatsql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 registry.cn-beijing.aliyuncs.com/greatsql/greatsql

sl28271495 发表于 2025-4-28 15:40:55

yejr 发表于 2025-4-28 15:32
请详细补充如何启动Docker容器的,如: docker run ...

以及详细的日志信息,如:docker logs .... ...

报错Initializing database
Database initialized
Initializing certificates
2025-04-28 07:42:35    Could not find OpenSSL on the system
Certificates initialized
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...

yejr 发表于 2025-4-28 15:46:27

sl28271495 发表于 2025-4-28 15:40
报错Initializing database
Database initialized
Initializing certificates


我和你用完全一样的命令拉起,看起来是正常的
# history | tail
1085mkdir -p /home/greatSql/data
1086docker run -d -v /home/greatSql/data:/merged/data/GreatSQL --name tt1 --hostname=tt1 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 registry.cn-beijing.aliyuncs.com/greatsql/greatsql
1087docker logs tt1

# docker logs tt1
Initializing database
Database initialized
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
MySQL init process in progress...
mysql: Using a password on the command line interface can be insecure.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql: Using a password on the command line interface can be insecure.

/greatsql-init.sh: ignoring /docker-entrypoint-initdb.d/*


MySQL init process done. Ready for start up.

可以正常启动。

你的宿主OS以及docker版本是哪个,可能是版本的问题,之前有其他用户遇到可能类似的情况 https://greatsql.cn/thread-1034-1-1.html

yejr 发表于 2025-4-29 10:35:07

yejr 发表于 2025-4-28 15:46
我和你用完全一样的命令拉起,看起来是正常的




我又换了个openKylin的虚机环境测试,也是OK的

# cat /etc/os-release
NAME="openKylin"
FULL_NAME="openKylin"
VERSION="2.0 SP1 (nile)"
VERSION_US="2.0 SP1 (nile)"
ID=openkylin
PRETTY_NAME="openKylin 2.0 SP1"
VERSION_ID="2.0"
HOME_URL="https://www.openkylin.top/"
VERSION_CODENAME=nile
PRODUCT_FEATURES=3

# arch
aarch64

# ldd --version
ldd (Ubuntu GLIBC 2.38-1ok6.9) 2.38
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.


# mkdir -p /home/greatSql/data

# docker run -d -v /home/greatSql/data:/merged/data/GreatSQL --name tt1 --hostname=tt1 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 registry.cn-beijing.aliyuncs.com/greatsql/greatsql
Unable to find image 'registry.cn-beijing.aliyuncs.com/greatsql/greatsql:latest' locally
latest: Pulling from greatsql/greatsql
55a6912e699c: Pull complete
330a48c0446c: Pull complete
Digest: sha256:69304dfc7712c13274fa722fd4aa1da62402d6f47251e5073f8af858b59e7fac
Status: Downloaded newer image for registry.cn-beijing.aliyuncs.com/greatsql/greatsql:latest
9b0258cd2d9b6ead4a9f53fe1aa2efb2d80763fac93c6c4720cdfa0f580fcfe2

# docker logs tt1
Initializing database
Database initialized
MySQL init process in progress...
mysql: Using a password on the command line interface can be insecure.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql: Using a password on the command line interface can be insecure.

/greatsql-init.sh: ignoring /docker-entrypoint-initdb.d/*


MySQL init process done. Ready for start up.

上面是详细过程。

还是请提供更多详细信息以便排查,或者先自查你的运行环境有什么问题吧。

yejr 发表于 7 天前

怀疑是SELinux原因导致的,暂时找到解决方案了,启动容器时加上 --privileged 参数,即:docker run -d --privileged--name greatsql --hostname=greatsql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 registry.cn-beijing.aliyuncs.com/greatsql/greatsql 应该就可以
页: [1]
查看完整版本: dock中数据库自动关闭情况