Centos之添加开机启动-yellowcong
来源:互联网 发布:react json转array 编辑:程序博客网 时间:2024/04/30 01:20
有些服务部署了之后,需要设置开机启动,不然重启服务后,可能由于服务忘记了启动,导致一些问题,所以最好先将服务配置为开机启动,修改
/etc/rc.local
,添加开机启动执行的程序
添加到开启启动
我的是服务器是三个zookeeper节点,和一个dubbo服务器
#编辑/etc/rc.local 文件vim /etc/rc.local#将下面的配置文件 配置到自己的里面,需要根据自己的路径更改#用户root#zookeeper start upsu - root -c '/usr/local/zookeeper/zookeeper-3.4.10/bin/zkServer.sh start'su - root -c '/usr/local/zookeeper2/zookeeper-3.4.10/bin/zkServer.sh start'su - root -c '/usr/local/zookeeper3/zookeeper-3.4.10/bin/zkServer.sh start'
问题集合
设置/etc/rc.local无效问题解决
由于/etc/rc.local是/etc/rc.d/rc.local的软连接,所以必须确保/etc/rc.local和/etc/rc.d/rc.local都有x权限(可执行)
执行命令,给他执行权限,就可以了
chmod +x /etc/rc.d/rc.localchmod +x /etc/rc.local#开启rc-local.service服务,不开启,设定了执行权限也没用#systemctl status rc-local.service #查看服务状态systemctl enable rc-local.servicesystemctl --system daemon-reloadsystemctl start rc-local.service
查看服务运行状态
systemctl | grep "rc.local"
user xx does not exist
这个配置文件中,/etc/rc.local
文件中,配置的用户不对,导致的
#查看服务启动的状态systemctl status rc-local.service
服务正常启动后,服务启动正常了。
阅读全文
0 0
- Centos之添加开机启动-yellowcong
- CentOS之iptables-yellowcong
- CentOS之设定界面和命令行启动-yellowcong
- Dubbo之添加到开启自动启动-yellowcong
- CentOS 7中添加开机启动脚本
- centos 服务添加开机启动项
- CentOS之Mysql安装-yellowcong
- CentOS之Java安装-yellowcong
- Centos之Keepalived安装-yellowcong
- Hadoop之添加环境变量-yellowcong
- 在CentOS 4下添加开机自启动应用程序
- CentOS 7设置开机启动服务,添加自定义系统服务
- centos 7 添加 nfs 开机启动失败解决方法
- Ubuntu15.x /CentOS 7.x 以后 设置开机启动,添加自定义系统服务,自定义开机启动
- CentOS 开机启动详解
- CentOS设置开机启动
- CentOS 开机启动详解
- CentOS设置开机启动
- gcc/g++
- WPF程序四周存在透明边框
- live555搭建rtsp服务器
- 怎样用命令行操作MySQL
- 天猫双11期间,阿里数据中心将由机器人完成巡检
- Centos之添加开机启动-yellowcong
- graphql----javascript使用
- Inno Setup入门(十)——操作注册表
- iOS 企业账号发布到web 页面
- Balanced Binary Tree
- Android4.4开机向导
- PAT --- 1018. 锤子剪刀布 (20)
- 油田采油生产业务建模之活动图实践(EA使用入门)
- 1105. Spiral Matrix (25)