add kubernetes

This commit is contained in:
dylan
2026-01-09 17:56:38 +08:00
parent 6e7af2d016
commit 2a879d383c
203 changed files with 17379 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
> 本文作者:丁辉
# Mysql容器纳入System管理
1. 创建 Systemd Service 文件
```bash
vi /usr/lib/systemd/system/mysql.service
```
内容如下
```bash
[Unit]
Description=Mysql container
Requires=docker.service
After=docker.service
[Service]
RemainAfterExit=yes
ExecStop=/usr/bin/docker stop mysql # 容器名
ExecStart=/usr/bin/docker start mysql
ExecReload=/usr/bin/docker restart mysql
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
```
2. 重载配置文件
```bash
systemctl daemon-reload
```
3. 启动 Mysql
```bash
systemctl start mysql
```