2014-09-18 2 views
0

우리의 RegionServers가 ZooKeeper에 자주 연결된다는 것을 발견했습니다. 그들은 끊임없이 세션을 설정하고 닫은 다음 ZooKeeper를 다시 연결하는 것 같습니다. 다음은 서버 및 클라이언트 측 로그입니다. 왜 이런 일이 일어나고 어떻게 처리 할 수 ​​있는지 잘 모르겠다. 우리는 HBase 0.94.11과 ZooKeeper 3.4.4를 사용하고 있습니다.HBase가 ZooKeeper와 세션을 설정하고 즉시 세션을 닫습니다.

HBase를 RegionServer에서 로그 :

 
2014-09-18,16:38:17,867 INFO org.apache.zookeeper.ZooKeeper: Initiating client connection, connectString=10.2.201.74:11000,10.2.201.73:11000,10.101.10.67:11000,10.101.10.66:11000,10.2.201.75:11000 sessionTimeout=30000 watcher=catalogtracker-on-org.apache.h[email protected]69d892a1 
2014-09-18,16:38:17,868 INFO org.apache.zookeeper.client.ZooKeeperSaslClient: Client will use GSSAPI as SASL mechanism. 
2014-09-18,16:38:17,868 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server lg-hadoop-srv-ct01.bj/10.2.201.73:11000. Will attempt to SASL-authenticate using Login Context section 'Client' 
2014-09-18,16:38:17,868 INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: The identifier of this process is [email protected] 
2014-09-18,16:38:17,868 INFO org.apache.zookeeper.ClientCnxn: Socket connection established to lg-hadoop-srv-ct01.bj/10.2.201.73:11000, initiating session 
2014-09-18,16:38:17,870 INFO org.apache.zookeeper.ClientCnxn: Session establishment complete on server lg-hadoop-srv-ct01.bj/10.2.201.73:11000, sessionid = 0x248782700e52b3c, negotiated timeout = 30000 
2014-09-18,16:38:17,876 INFO org.apache.zookeeper.ZooKeeper: Session: 0x248782700e52b3c closed 
2014-09-18,16:38:17,876 INFO org.apache.zookeeper.ClientCnxn: EventThread shut down 
2014-09-18,16:38:17,878 INFO org.apache.hadoop.hbase.replication.regionserver.ReplicationSink: Total replicated: 24 

의 사육사 서버에서 로그 :

 
2014-09-18,16:38:17,869 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: [myid:2] Accepted socket connection from /10.2.201.76:55621 
2014-09-18,16:38:17,869 INFO org.apache.zookeeper.server.ZooKeeperServer: [myid:2] Client attempting to establish new session at /10.2.201.76:55621 
2014-09-18,16:38:17,870 INFO org.apache.zookeeper.server.ZooKeeperServer: [myid:2] Established session 0x248782700e52b3c with negotiated timeout 30000 for client /10.2.201.76:55621 
2014-09-18,16:38:17,872 INFO org.apache.zookeeper.server.auth.SaslServerCallbackHandler: [myid:2] Successfully authenticated client: authenticationID=hbase_srv/[email protected]; authorizationID=hbase_srv/[email protected] 
2014-09-18,16:38:17,872 INFO org.apache.zookeeper.server.auth.SaslServerCallbackHandler: [myid:2] Setting authorizedID: hbase_srv 
2014-09-18,16:38:17,872 INFO org.apache.zookeeper.server.ZooKeeperServer: [myid:2] adding SASL authorization for authorizationID: hbase_srv 
2014-09-18,16:38:17,877 INFO org.apache.zookeeper.server.NIOServerCnxn: [myid:2] Closed socket connection for client /10.2.201.76:55621 which had sessionid 0x248782700e52b3c 

답변

0

마지막으로 나는 근본 원인을 발견했다.

그렇습니다. ReplicationSink에 대한 것이므로 로그 "2014-09-23,14 : 58 : 01,736 DEBUG org.apache.hadoop.hbase.replication.regionserver.ReplicationSink : table online_miliao_recent 복제"를 발견했습니다.

그런 다음 관련 코드를 살펴본 후 replicateEntries()를 호출 할 때마다 sharedHBaseAdmin.tableExists (table)도 호출한다는 것을 알았습니다.

sharedHBaseAdmin.tableExists()는 ZooKeeper 클라이언트 인 새로운 CatalogTracker 객체를 만듭니다.

이 방법을 종료하면 ZooKeeper 클라이언트와 세션이 정리됩니다.

그래서이 로그는 복제가 실행 중이므로 적당합니다. 그러나 tableExists()는 약간 무거 우므로 entires를 복제 할 때마다 호출해야한다고 생각하지 않습니다. 또한 CatalogTracker는 0.94.11 이후에 ReplicationSink에 없으므로 이후 버전에서는 문제가되지 않습니다.

ReplicationSink에서 CatalogTracker를 제거하는 jira를 찾으면 좋을 것입니다.

관련 문제