Import data from Mysql database to Hbase using Sqoop

Use Sqoop to import data from the Mysql database to Hbase. After the import is successful, use the Java Hbase API on eclipse to connect to the cluster and print all the data. As a result, when the program is run, the log shows that the login configuration cannot be located. The specific information is as follows:

Java code copy code  Favorite code
  1. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.library.path=D:\soft\Java\jdk1.6.0_32\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin/server;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin;D:/soft/Java/jdk1.7.0_04/bin/../jre/lib/amd64;D:\Python;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\soft\Java\jdk1.7.0_04/bin;D:\soft\Java\jdk1.7.0_04/jre/bin ;E:\SSHClient;D:\soft\eclipse;;.  
  2. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.io.tmpdir=C:\Users\qin\AppData\Local\Temp\  
  3. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.compiler=<NA>  
  4. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.name=Windows 7  
  5. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.arch=amd64  
  6. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.version=6.1  
  7. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.name=qin  
  8. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.home=C:\Users\qin  
  9. 2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.dir=D:\eclipseworkspace\myfirst  
  10. 2013/12/29-02:20:46  INFO ZooKeeper:438 - Initiating client connection, connectString=192.168.120.129:2181 sessionTimeout=180000 watcher=hconnection  
  11. 2013/12/29-02:20:46  INFO RecoverableZooKeeper:104 - The identifier of this process is 9308@qin-PC  
  12. 2013/12/29 - 02 : 20 : 46   INFO ClientCnxn: 966 - Opening socket  connection to server namenode/ 192.168 . 120.129 : 2181 . Will not attempt to authenticate using SASL (Cannot locate login configuration)  
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.library.path=D:\soft\Java\jdk1.6.0_32\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin/server;D:/soft/Java/jdk1.7.0_04/bin/../jre/bin;D:/soft/Java/jdk1.7.0_04/bin/../jre/lib/amd64;D:\Python;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\soft\Java\jdk1.7.0_04/bin;D:\soft\Java\jdk1.7.0_04/jre/bin ;E:\SSHClient;D:\soft\eclipse;;.
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.io.tmpdir=C:\Users\qin\AppData\Local\Temp\
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:java.compiler=<NA>
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.name=Windows 7
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.arch=amd64
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:os.version=6.1
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.name=qin
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.home=C:\Users\qin
2013/12/29-02:20:46  INFO ZooKeeper:100 - Client environment:user.dir=D:\eclipseworkspace\myfirst
2013/12/29-02:20:46  INFO ZooKeeper:438 - Initiating client connection, connectString=192.168.120.129:2181 sessionTimeout=180000 watcher=hconnection
2013/12/29-02:20:46  INFO RecoverableZooKeeper:104 - The identifier of this process is 9308@qin-PC
2013/12/29-02:20:46 INFO ClientCnxn:966 - Opening socket connection to server namenode/192.168.120.129:2181. Will not attempt to authenticate using SASL (unable to locate login configuration)



In fact, this information is not an abnormality of Hbase, but that the client cannot find the resolution address of zookeeper. Since Hbase resolves the IP address (DNS) through hostname, Zookeeper will only return the domain name of Hbase, which requires the client to pass DNS or local hosts file for parsing.
Solution:
On Linux, add the domain name and IP address mapping of the Hbase Master node in the /etc/hosts file.
On Windows, modify the C:\Windows\system32\etc\hosts file and add the domain name and IP of the Hbase Master node. Address mapping.
The screenshot is as follows:








At this point, it can be used normally, start the program again, and it has been found that there is no problem just now

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326711009&siteId=291194637