作者:IT邦德
中国DBA联盟(ACDU)成员,目前从事DBA及程序编程
(Web\java\Python)工作,主要服务于生产制造
现拥有 Oracle 11g OCP/OCM、
Mysql、Oceanbase(OBCA)认证
分布式TBase\TDSQL数据库、国产达梦数据库以及红帽子认证
从业8年DBA工作,在数据库领域有丰富的经验
详情关注公众号:IT邦德
QQ群:168797397、587159446
单独在linux 7中为ohasd设置一个服务。
步骤如下
1. 创建服务文件并赋予权限
##root用户执行
touch /usr/lib/systemd/system/ohas.service
chmod 777 /usr/lib/systemd/system/ohas.service
2. 服务文件添加启动相关信息
vi /usr/lib/systemd/system/ohas.service
##以下部分的内容添加到文件里面
[Unit]
Description=Oracle High Availability Services
After=syslog.target
[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
3. 加载,启动服务
重新加载守护进程
systemctl daemon-reload
设置守护进程自动启动
systemctl enable ohas.service
手工启动ohas服务
systemctl start ohas.service
4. 重新运行root.sh脚本
sh root.sh
报错消失
5、查看ohas服务状态
systemctl status ohas.service
可以看到ohasd已经处于running的状态