iam using hadoop apache 2.7.1 on centos 7 and my cluster is ha cluster and iam using zookeeper quorum for automatic failover

but i want to automate zookeeper start process and ofcourse in the shell script we have to stop firewall first in order to let other quorum elements able to contact current zookeeper element

iam writing the following script in /etc/rc.d/rc.local

hostname jn1

systemctl stop firewalld

ZOOKEEPER='/usr/local/zookeeper-3.4.9/' source /etc/rc.d/init.d/functions

source $ZOOKEEPER/bin/zkEnv.sh

daemon --user root $ZOOKEEPER/bin/zkServer.sh start

but iam facing the problem that when iam issuing the command

systemctl stop firewalld in rc.local

and issuing zkServer status after host boots iam getting the error

ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper-3.4.9/bin/../conf/zoo.cfg Error contacting service. It is probably not running.

but if i execute the same commands with out a script i mean after my host boots as normal process

systemctl status firewalld

zkServer start

there is no problem and zkstatus shows its mode

i have noticed the difference in zookeeper.out log between executing rc.local script and normal commands after the host boots

and the difference is reading server environments in normal commands execute

what could be the effect of stopping firewall at rc.local script to server environment and how to handle it ?


i have abig headache about stopping and restarting firewall scenarios

and i discovered that stopping firewall at rc.local is a fake stopping

so because idon't want fire wall to work at all i ended up with the following solution

systemctl disable firewalld


so firewall is not going to work again at any boot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.