kubernetes上的Mysql服务器不会重新启动(Mysql server on kubernetes wont restart)

系统教程 行业动态 更新时间:2024-06-14 16:59:47
kubernetes上的Mysql服务器不会重新启动(Mysql server on kubernetes wont restart)

即时尝试重新启动我的MySQL服务器。 服务器位于Kubernetes / fedora容器上。 我试图使用#/etc/init.d/mysqld restart和#systemctl restart mysqld。 问题是init.d中没有文件。 运行时#/etc/init.d/mysqld restart bash说没有这样的文件,显然没有这样的文件。 当运行#systemctl restart mysqld时,它会响应“bash:systemctl:Command not found”mysql-servier运行良好,我可以登录进去,但是我不能重新启动它。 请帮忙。

im trying to restart my mysql server. The server is on a Kubernetes/fedora container. I have tried to use # /etc/init.d/mysqld restart and # systemctl restart mysqld. The problem is that there is no files in the init.d. When running # /etc/init.d/mysqld restart bash says No such file, obviously as there is no such file. When running # systemctl restart mysqld it responds "bash: systemctl: Command not found" The mysql-servier is running fine and i can log into it, however i cant restart it. Please help.

最满意答案

MySQL的服务器运行良好,我可以登录到它,但我不能重新启动它。

你有两个选择,都有它的'危险'来解决:

更有可能的是,容器是通过Docker镜像中的CMD或者实际启动mysql的kubernetes清单中的command指令启动的。 在这种情况下,无论您如何设法在该容器上运行mysql的实例(在重新启动期间)终止,您也将 - 终止整个容器。 然后Kubernetes将重新启动该容器或整个吊舱。

可能性较小,但可能的是该容器是用其他'main'命令启动的,并且mysql是作为单独脚本的一部分启动的。 在这种情况下,检查docker文件或kubernetes清单会为您提供有关启动/停止过程的详细信息,并且只有在这种情况下,您才能重新启动mysql而不会实际上终止正在运行的容器。

危险:数据持久性。 如果没有正确的数据持久性,则可以通过重新启动或刷新来禁止正在运行的容器,也可以使用它来销毁任何短暂的数据。

附加说明:你有没有尝试过service mysql status和service mysql restart ?

The mysql-servier is running fine and i can log into it, however i cant restart it.

You have 2 options and both have it's 'dangers' to address:

More likely, container is started with either CMD given in docker image or command directive in kubernetes manifest that is actually starting your mysql. In that case, regardless of the way you manage to do termination (during restart) of running instance of mysql on that container you will also - terminate the whole container. Kubernetes will then restart that container, or whole pod.

Less likely, but possible is that container was started with some other 'main' command, and mysql is started as part of a separate script. In that case inspecting docker file or kubernetes manifest will give you details about start/stop procedure and only in that case you can restart mysql without actually killing the container it is running onto.

Dangers: data persistence. If you don't have proper data persistence in place killing running container (either through restart or refresh) will also destroy any ephemeral data with it.

Additional note: have you tried service mysql status and service mysql restart?

更多推荐

本文发布于:2023-04-17 08:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/fa036f9e8a1797a5d6065c18992f95a2.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重新启动   服务器   Mysql   kubernetes   wont

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!