zookeeper问题汇总

创建节点报错,原因不详细,搜索发现可以删除data目录下的version-2解决。删除之后 会报其他的错误。后面,发现是不支持zkclient不支持递归创建节点的问题。需要先将父节点创建。
https://blog.csdn.net/wo541075754/article/details/65625481

org.I0Itec.zkclient.exception.ZkNoNodeException: org.apache.zookeeper.KeeperException NoNodeException:KeeperErrorCode=NoNodefor/mutex/lockatorg.I0Itec.zkclient.exception.ZkException.create(ZkException.java:47)atorg.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:1000)atorg.I0Itec.zkclient.ZkClient.create(ZkClient.java:527)atorg.I0Itec.zkclient.ZkClient.create(ZkClient.java:498)atorg.I0Itec.zkclient.ZkClient.createEphemeralSequential(ZkClient.java:589)atcom.sitech.zk.lock.client.BaseDistributedLock.createLockNode(BaseDistributedLock.java:36)atcom.sitech.zk.lock.client.BaseDistributedLock.attemptLock(BaseDistributedLock.java:175)atcom.sitech.zk.lock.client.SimpleDistributedLockMutex.internalLock(SimpleDistributedLockMutex.java:18)atcom.sitech.zk.lock.client.SimpleDistributedLockMutex.acquire(SimpleDistributedLockMutex.java:32)atcom.sitech.zk.lock.client.TestDistributedLock.main(TestDistributedLock.java:16)Causedby:org.apache.zookeeper.KeeperException N o N o d e E x c e p t i o n : K e e p e r E r r o r C o d e = N o N o d e f o r / m u t e x / l o c k a t o r g . I 0 I t e c . z k c l i e n t . e x c e p t i o n . Z k E x c e p t i o n . c r e a t e ( Z k E x c e p t i o n . j a v a : 47 ) a t o r g . I 0 I t e c . z k c l i e n t . Z k C l i e n t . r e t r y U n t i l C o n n e c t e d ( Z k C l i e n t . j a v a : 1000 ) a t o r g . I 0 I t e c . z k c l i e n t . Z k C l i e n t . c r e a t e ( Z k C l i e n t . j a v a : 527 ) a t o r g . I 0 I t e c . z k c l i e n t . Z k C l i e n t . c r e a t e ( Z k C l i e n t . j a v a : 498 ) a t o r g . I 0 I t e c . z k c l i e n t . Z k C l i e n t . c r e a t e E p h e m e r a l S e q u e n t i a l ( Z k C l i e n t . j a v a : 589 ) a t c o m . s i t e c h . z k . l o c k . c l i e n t . B a s e D i s t r i b u t e d L o c k . c r e a t e L o c k N o d e ( B a s e D i s t r i b u t e d L o c k . j a v a : 36 ) a t c o m . s i t e c h . z k . l o c k . c l i e n t . B a s e D i s t r i b u t e d L o c k . a t t e m p t L o c k ( B a s e D i s t r i b u t e d L o c k . j a v a : 175 ) a t c o m . s i t e c h . z k . l o c k . c l i e n t . S i m p l e D i s t r i b u t e d L o c k M u t e x . i n t e r n a l L o c k ( S i m p l e D i s t r i b u t e d L o c k M u t e x . j a v a : 18 ) a t c o m . s i t e c h . z k . l o c k . c l i e n t . S i m p l e D i s t r i b u t e d L o c k M u t e x . a c q u i r e ( S i m p l e D i s t r i b u t e d L o c k M u t e x . j a v a : 32 ) a t c o m . s i t e c h . z k . l o c k . c l i e n t . T e s t D i s t r i b u t e d L o c k . m a i n ( T e s t D i s t r i b u t e d L o c k . j a v a : 16 ) C a u s e d b y : o r g . a p a c h e . z o o k e e p e r . K e e p e r E x c e p t i o n NoNodeException: KeeperErrorCode = NoNode for /mutex/lock-
at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:99)
at org.I0Itec.zkclient.ZkClient 3.call(ZkClient.java:530)atorg.I0Itec.zkclient.ZkClient 3. c a l l ( Z k C l i e n t . j a v a : 530 ) a t o r g . I 0 I t e c . z k c l i e n t . Z k C l i e n t 3.call(ZkClient.java:527)
at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:990)
… 8 more

将data目录下的version-2目录删除,报下面的错误,查找以前保存的节点失败。后来,将logs目录下的version-2目录也删除,不再报下面错误。

2018-05-22 13:28:33,165 [myid:1] - ERROR [main:QuorumPeerMain@89] - Unexpected exception, exiting abnormally
java.lang.RuntimeException: Unable to run quorum server
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:454)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:409)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:151)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.io.IOException: Failed to process transaction type: 1 error: KeeperErrorCode = NoNode for /dubbo/com.sitech.prm.channel.s98B00.s98B10.s8B14.service.S8B14AutoService/providers
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:153)
at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:417)
… 4 more
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /dubbo/com.sitech.prm.channel.s98B00.s98B10.s8B14.service.S8B14AutoService/providers
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.processTransaction(FileTxnSnapLog.java:211)
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:151)
… 6 more

你可能感兴趣的:(运维)