Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What should I do if I start zookeeper to report an error?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to start the zookeeper error report, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Start zookeeper and report an error: ERROR [main:QuorumPeerMain@85]-Invalid config, exiting abnormally

Scene:

1. Install zookeeper cluster error for three machines: ERROR [main:QuorumPeerMain@85]-Invalid config, exiting abnormally

two。 Environment description

System: CentOS 7.6

Zookeeper version: 3.4.6

Installation directory: / opt/zookeeper-3.4.6

Installed user: hadoop

Zookeeper data directory: / opt/zookeeper-3.4.6/zookeepertmp-- need to be created manually

Zookeepertmp directory: / opt/zookeeper-3.4.6/zookeepertmp/log-- need to be created manually

Host names of three machines: note01, note02, and note03

Resolve:

The error message is as follows:

$vi zookeeper.out2019-03-31 22 INFO 483422 [myid:]-INFO [main:QuorumPeerConfig@103]-Reading configuration from: / opt/zookeeper-3.4.6/bin/../conf/zoo.cfg2019-03-31 22 48 ERROR [main:QuorumPeerConfig@340]-Defaulting to majority quorums2019-03-31 22 48 [myid:]-ERROR [main:QuorumPeerMain@85]-Invalid config Exiting abnormallyorg.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing / opt/zookeeper-3.4.6/bin/../conf/zoo.cfg at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse (QuorumPeerConfig.java:123) at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun (QuorumPeerMain.java:101) at org.apache.zookeeper.server.quorum.QuorumPeerMain.main (QuorumPeerMain.java:78) Caused by: java.lang.IllegalArgumentException: / opt/zookeeper-3.4.6/zookeepertmp/myid file is missing at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties (QuorumPeerConfig.java:350) at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse (QuorumPeerConfig.java:119)... 2 moreInvalid config Exiting abnormally

1. A lot of online feedback is due to the lack of creation of myid files and mismatch of configuration files (embarrassing, after all, a novice)

two。 Starting with the myid file, it is true that the myid file was not created when it was first started, but the myid file was created on three machines and the machine id number was written.

Create a myid in note01

$cd / opt/zookeeper-3.4.6/zookeepertmp

$echo "1" > myid

Create a myid in note02

$cd / opt/zookeeper-3.4.6/zookeepertmp

$echo "2" > myid

Create a myid in note03

$cd / opt/zookeeper-3.4.6/zookeepertmp

$echo "3" > myid

3. Delete all files and folders in the zookeeper data directory except the log folder and myid

$rm zookeeper_server.pid-rf

$rm zookeeper.out-rf

$rm version-2-rf

4. Check again whether the zoo.cfg file is configured correctly

And finally found that the last

Server.1=note2:2888:3888

Server.2=note3:2888:3888

Server.3=note4:2888:3888

The previous hostname is wrong, and the correct one should be

Server.1=note02:2888:3888

Server.2=note03:2888:3888

Server.3=note04:2888:3888

5. Try to start zookeeper again

Execute startup commands on three machines

$zkServer.sh start

Execute the view status command on three machines

$zkServer.sh status

6. I can't believe you made a mistake, you shouldn't have! A dead horse is a doctor. Restart the machine.

$exit

# reboot

7. Try to start zookeeper again

Execute startup commands on three machines

$zkServer.sh start

Execute the view status command on three machines

[hadoop@note03 zookeepertmp] $zkServer.sh status

JMX enabled by default

Using config: / opt/zookeeper-3.4.6/bin/../conf/zoo.cfg

Mode: leader

[hadoop@note04 zookeepertmp] $zkServer.sh status

JMX enabled by default

Using config: / opt/zookeeper-3.4.6/bin/../conf/zoo.cfg

Mode: follower

[hadoop@note02 zookeepertmp] $zkServer.sh status

JMX enabled by default

Using config: / opt/zookeeper-3.4.6/bin/../conf/zoo.cfg

Mode: follower

See here to prove that zookeeper starts normally, done!

After reading the above, do you have any further understanding of what to do when starting zookeeper to report an error? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report