Let me explain my situation first:
In the HBase shell interface, you can run it with commands, but not with Java API.
HBase and zookeeper configuration files are all OK.
During Java API operation, it is stuck and cannot be connected. Look at the HBase and zookeeper logs. There is no information available.
When the program runs for a long time, it reports an error (intercept a useful line):
java. net. UnknownHostException: can not resolve hadoop01,16020,164077701361
Maybe I can’t recognize Hadoop 01. What’s this?It’s my node hostname.
Here’s how to view it:
1 zkServer.SH check whether there are any leaders, followers, etc. in zookeeper.Mine (is it a zookeeper configuration problem)
2. Check the zookeeper log and enter the logs directory. One of mine is Hadoop 01 and the other is master (previous host name).
At this point, I probably know where the problem is
Possible
1 . Host name and configuration conflict
2 . HBase version data conflict (I have installed different versions)
Solution:
1. Close HBase and zookeeper
2 delete the data file of zookeeper (violence works miracles). Mine is in the data. Pay attention not to delete myid (all three nodes are deleted)
3 restart zookeeper and HBase
Run java code
Finish work