重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

标题: 金仓启停数据库的两种常用方式 [打印本页]

作者: 郑全    时间: 2025-7-12 12:28
标题: 金仓启停数据库的两种常用方式
本帖最后由 郑全 于 2025-7-12 12:30 编辑

一种root用户使用systemctl stop/start/restart kingbased
[root@kesdb ~]# systemctl status kingbased
● kingbased.service - LSB: Start and stop the kingbase server
   Loaded: loaded (/etc/rc.d/init.d/kingbased; generated)
   Active: active (exited) since Sat 2025-07-12 12:25:14 CST; 2s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3898 ExecStop=/etc/rc.d/init.d/kingbased stop (code=exited, status=0/SUCCESS)
  Process: 3966 ExecStart=/etc/rc.d/init.d/kingbased start (code=exited, status=0/SUCCESS)

Jul 12 12:25:13 kesdb systemd[1]: Starting LSB: Start and stop the kingbase server...
Jul 12 12:25:13 kesdb kingbased[3966]: Starting KingbaseES V9:
Jul 12 12:25:13 kesdb su[3968]: (to kingbase) root on none
Jul 12 12:25:13 kesdb su[3968]: pam_unix(su-l:session): session opened for user kingbase by (uid=0)
Jul 12 12:25:14 kesdb kingbased[3969]: waiting for server to start.... done
Jul 12 12:25:14 kesdb kingbased[3969]: server started
Jul 12 12:25:14 kesdb su[3968]: pam_unix(su-l:session): session closed for user kingbase
Jul 12 12:25:14 kesdb kingbased[3966]: KingbaseES V9 started successfully
Jul 12 12:25:14 kesdb systemd[1]: Started LSB: Start and stop the kingbase server.

[root@kesdb ~]# systemctl stop kingbased
[root@kesdb ~]# systemctl start kingbased





另外一种是KINGBASE用户通过 sys_ctl start/stop/restart


[kingbase@kesdb:/home/kingbase]$ sys_ctl status -D /KingbaseES/V9/data/
sys_ctl: server is running (PID: 4013)
/KingbaseES/V9/KESRealPro/V009R002C010/Server/bin/kingbase "-D" "/KingbaseES/V9/data"
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$ sys_ctl stop -D /KingbaseES/V9/data/
waiting for server to shut down.... done
server stopped
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$ sys_ctl start -D /KingbaseES/V9/data/
waiting for server to start....2025-07-12 12:27:28.435 CST [4137] LOG:  config the real archive_command string as soon as possible to archive WAL files
2025-07-12 12:27:28.439 CST [4137] LOG:  sepapower extension initialized
2025-07-12 12:27:28.447 CST [4137] LOG:  starting KingbaseES V009R002C010
2025-07-12 12:27:28.447 CST [4137] LOG:  listening on IPv4 address "0.0.0.0", port 54321
2025-07-12 12:27:28.447 CST [4137] LOG:  listening on IPv6 address "::", port 54321
2025-07-12 12:27:28.448 CST [4137] LOG:  listening on Unix socket "/tmp/.s.KINGBASE.54321"
2025-07-12 12:27:28.548 CST [4137] LOG:  redirecting log output to logging collector process
2025-07-12 12:27:28.548 CST [4137] HINT:  Future log output will appear in directory "sys_log".
done
server started
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$
[kingbase@kesdb:/home/kingbase]$ sys_ctl status -D /KingbaseES/V9/data/
sys_ctl: server is running (PID: 4137)
/KingbaseES/V9/KESRealPro/V009R002C010/Server/bin/kingbase "-D" "/KingbaseES/V9/data"


[kingbase@kesdb:/home/kingbase]$ sys_ctl restart -D /KingbaseES/V9/data/
waiting for server to shut down.... done
server stopped
waiting for server to start....2025-07-12 12:28:35.553 CST [4156] LOG:  config the real archive_command string as soon as possible to archive WAL files
2025-07-12 12:28:35.559 CST [4156] LOG:  sepapower extension initialized
2025-07-12 12:28:35.571 CST [4156] LOG:  starting KingbaseES V009R002C010
2025-07-12 12:28:35.571 CST [4156] LOG:  listening on IPv4 address "0.0.0.0", port 54321
2025-07-12 12:28:35.571 CST [4156] LOG:  listening on IPv6 address "::", port 54321
2025-07-12 12:28:35.572 CST [4156] LOG:  listening on Unix socket "/tmp/.s.KINGBASE.54321"
2025-07-12 12:28:35.672 CST [4156] LOG:  redirecting log output to logging collector process
2025-07-12 12:28:35.672 CST [4156] HINT:  Future log output will appear in directory "sys_log".
done
server started
[kingbase@kesdb:/home/kingbase]$






欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2