ceph-mon and 添加开机启动脚本

一、ceph-mon and 添加开机启动脚本

[root@controller1 ~]# cat /etc/rc.d/rc.local
#!/bin/bash
ceph-mon --id=mon1
ceph-osd --id=0
ceph-osd --id=1
ceph-osd --id=2

#在controller2 and controller3上面增加这两行

sleep 5
systemctl restart mariadb

#授权

chmod a+x /etc/rc.d/rc.local

 

[root@controller1 ~]# cat /usr/lib/systemd/system/rc-local.service
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

#添加如下两行

[Install]
WantedBy=multi-user.target

 

#重启服务

systemctl daemon-reload

systemctl enable rc-local.service

 

posted @ 2018-03-21 17:42  努力哥  阅读(783)  评论(0)    收藏  举报