记录一下openGauss自启动的设置
目录
- 0.碎碎念
- 1.版本
- 2.配置
0.碎碎念
看了好几篇笔记照抄都不行,搞不明白,东拼西凑又成功了,顺便记录一下,希望能帮到别人。
1.版本
iso:openEuler-22.03-LTS-SP4-aarch64-dvd.iso
openGauss:openGauss-Server-6.0.0-openEuler22.03-x86_64.tar.bz2
我是安装的单机
安装路径:/opt/software/openGauss/openGauss
2.配置
在/usr/lib/systemd/system
下创建opengauss.service
[Unit]
Description=openGauss
Documentation=openGauss Server
After=syslog.target
After=network.target[Service]
Type=forkingUser=omm
Group=sftgrpEnvironment=PGDATA=/opt/software/openGauss/openGauss/data
Environment=GAUSSHOME=/opt/software/openGauss/openGauss
Environment=LD_LIBRARY_PATH=/opt/software/openGauss/openGauss/libExecStart=/opt/software/openGauss/openGauss/bin/gs_ctl start -D /opt/software/openGauss/openGauss/data/single_node -Z single_node
ExecStop=/opt/software/openGauss/openGauss/bin/gs_ctl stop -D /opt/software/openGauss/openGauss/data/single_node
ExecReload=/opt/software/openGauss/openGauss/bin/gs_ctl restart -D /opt/software/openGauss/openGauss/data/single_node -Z single_nodeKillMode=mixed
KillSignal=SIGINT
TimeoutSec=0[Install]
WantedBy=multi-user.target
具体含义可以看这个大佬的帖子:openGauss 开机自启动
创建之后走三个命令:
systemctl daemon-reload
systemctl enable opengauss.service
systemctl start opengauss.service
然后我再去看就可以了…
systemctl status opengauss.service
#其他命令
systemctl restart opengauss.service