service zookeeper does not support chkconfig解决办法

一 问题描述

部署好ZooKeeper后,需要设置启动脚本并设置开机自动启动。

cp /opt/app/zookeeper/bin/zkServer.sh /etc/init.d/zookeeper

更改脚本的参数

 ZOOBIN=/opt/app/zookeeper/bin
 ZOOBINDIR=/opt/app/zookeeper/bin
 ZOO_LOG_DIR=/opt/logs/zookeeper

这个三个参数随意自己定义

执行service zookeeper start 正常,但是执行chkconfig --level 35 zookeeper on报以下错误

service zookeeper does not support chkconfig

二 问题解决

以上的问题和chkconfig这个命令有关。查阅chkconfig命令的man手册进行了解。

需要让chkconfig管理的服务需要在/etc/init.d目录下的启动脚本中添加几行代码。如下:

#!/bin/bash
#
# zookeeper  ---  this script is used to start and stop zookeeper
#
# chkconfig:   - 80 12
# description:  zookeeper is a centralized service for maintaining configuration information,naming,providing distributed synchronization,and providing group services. 
# processname: zookeeper

chkconfig: 一行告诉chkconfig这个服务默认将以什么级别启动,启动和关闭的优先级是多少。- 表示任意级别

description: 一行是这个服务的描述信息

添加这两行后就可以正常使用chkconfig设置开机启动了

参考文章:

http://maosheng.iteye.com/blog/2224962

时间: 2024-08-07 11:36:41

service zookeeper does not support chkconfig解决办法的相关文章

service httpd does not support chkconfig

pache 作为linux启动就运行服务程序 cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd 但是在执行: chkconfig --add httpd chkconfig httpd on 的时候出现错误:service httpd does not support chkconfig 解决办法: 打开 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面) #chkconfig: 2345 10

service redis does not support chkconfig

添加redis到自启动服务: [[email protected] redis]# chkconfig --add redis service redis does not support chkconfig 解决方法:(在/etc/init.d/redis添加两行注释) #!/bin/sh #添加的两行注释内容如下: # chkconfig:   2345 90 10 # description:  Redis is a persistent key-value database # 注释的意

service zabbix does not support chkconfig

#chkconfig --add zabbix service zabbix does not support chkconfig 解决方法#vi /etc/init.d/myservice#!/bin/bash 之后添加以下内容: # chkconfig: 2345 10 90 其中2345是默认启动级别,级别有0-6共7个级别. 等级0表示:表示关机 等级1表示:单用户模式 等级2表示:无网络连接的多用户命令行模式 等级3表示:有网络连接的多用户命令行模式 等级4表示:不可用 等级5表示:带

service xxx does not support chkconfig

#chkconfig --add myservice 常常会出现 service myservice does not support chkconfig 我们一般在脚本开头加入下面两句就好了 添加下面两句到 #!/bin/bash 之后. # chkconfig: 2345 10 90 # description: myservice .... 其中2345是默认启动级别,级别有0-6共7个级别. 等级0表示:表示关机 等级1表示:单用户模式 等级2表示:无网络连接的多用户命令行模式 等级3表

chkconfig添加服务错误service memcached does not support chkconfig

chkconfig添加服务错误,提示XXX服务不支持 故障原文: [[email protected] ~]# chkconfig --add memcached service memcached does not support chkconfig 故障说明: 无法添加提示该错误是在服务的启动脚本里面没添加chkconfig的级别 解决方案: 我们一般在脚本开头加入下面两句就好了 #gedit /etc/init.d/memecached 添加下面两句到 #!/bin/bash 之后. #

Shell脚本安装成服务加入系统启动-service XX does not support chkconfig

背景:Shell脚本是linux运维人员必备利器,怎么样把shell脚本安装成服务且加入系统启动,然后就可以使用服务来管理,这是一个很重要的问题. 当我们运行安装服务的命令时候,假设服务名为myservice #chkconfig --add myservice 常常会出现 service myservice does not support chkconfig 下面讲解正确方法: 1.1给服务脚本添加注释. #vim /etc/init.d/myservice 添加下面两句到 #!/bin/b

linux service等命令不能使用的解决办法

主要是路径没添加进来: 在shell里面输入这条命令:export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin 注意:中间没有换行! linux service等命令不能使用的解决办法

linux下安装tomcat——service tomcat does not support chkconfig

linux下安装tomcat: 1 //解压 2 # tar zxvf apache-tomcat-7.0.92.tar.gz 3 //复制到init.d目录下 4 # cp -p /usr/tomcat/apache-tomcat-7.0.92/bin/catalina.sh /etc/init.d/tomcat 5 # chmod 755 /etc/init.d/tomcat 6 # chkconfig --add tomca 7 //添加tomcat和java目录 8 # vim /etc

问题:webservice浏览后 无法输入参数;结果:调试Web Service时不能输入参数的解决办法

使用.NET 开发Web Service,有一个很方便的功能就是可以通过IE直接测试Web Service.当你的Web Service的参数都是元数据类型,那么只要你使用IE浏览Web Service就可以页面的输入框中输入必需的参数,点击调用,即可完成Web Service的测试调用.方便! 但是,在有些情况下,虽然我们开发的Web Service都使用元数据类型的参数,为什么死活都无法直接调用测试呢?点击方法链接也只是出现SOAP消息的格式定义?原来这个问题一直都没有解 决,google一