2017-05-09 1 views
1

나는 인증 중에 Zookeeper에 연결되는 (동일하게 실행중인) AuthenticationProvider을 만들고이 사용자가 올바른 암호를 주었으면 노드를 체크인합니다.Zookeeper의 AuthenticationProvider에서 Zookeeper에 연결하기

기본적 흐름은 다음과 같이 떨어지게 같습니다

@Override 
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { 
     final String usernameColonPassword = new String(authData); 
     String[] split = usernameColonPassword.split(":"); 
     final String username = split[0]; 
     final String password = split[1]; 

     byte[] binary = curator.getData().forPath(ATUH_NODE); // here error is thrown 
     // check is password is correct 
} 

문제는 항상 내가 큐레이터가 데이터를 얻을 줄에서 KeeperErrorCode = ConnectionLoss을 얻고 있다는 점이다. 이 행동의 이유는 무엇입니까? 인증 과정에서 클라이언트 인증을하는 사육사와의 연결을 허용하지 않습니까? 전체 스택 트레이스 아래

는 :

org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for XXX 
     at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) 
     at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) 
     at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045) 
     at org.apache.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:172) 
     at org.apache.curator.framework.imps.ExistsBuilderImpl$2.call(ExistsBuilderImpl.java:161) 
     at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107) 
     at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:157) 
     at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:148) 
     at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:36) 

답변

0

나는 그것이 불가능하다 발견. 이 시점에서 사육사는 어떤 종류의 잠금/세마포어를 가지고 있으며이 스레드로부터 새로운 연결을 수락하지 않습니다.

관련 문제