First, solve the problem of Talend connecting HBase:
The machine used by the company is the HDP2.2 machine, which is configured with HBase service, under the/etc/hbase/conf/hbase-site.xml of the cluster, has the following configuration:
< Property > < name >zookeeper.znode.parent</name> <value >/hbase-unsecure</value> </ Property>
This configuration is determined by Hbase master in zookeeper, which stores the root node of the data, if not specifically set, the default location is:/hbase (this pit me for a long time ...) , after a long study, finally epiphany, really difficult AH).
When setting up HBase databae, configure the following:
Testing the connectivity of ZK:
[Email protected] ~]$ Zookeeper-client-server172.28.3.61:2181[ZK:172.28.3.61:2181(CONNECTED) the]ls/[Hiveserver2, Controller_epoch, controller, brokers, zookeeper, HBase-unsecure, hadoop-ha, Rmstore, admin, consumers, Config] [ZK:172.28.3.61:2181(CONNECTED) -]ls/hbase-unsecure[replication, Meta-region-server, RS, Splitwal, Backup-masters, Table-lock, region-inch-transition, Online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table]
The final state is the connection succeeds:
After successful connection, retrive schema:
In HBase, the table information is as follows:
HBase (Main):047:0> Scan'Zhangchao'ROW COLUMN+CELL Example Column=cc2:name, timestamp=1436838509057, value=Justin example2 Column=cc1:age, timestamp=1436838869051, value= -example3 Column=cc1:sex, timestamp=1436839082133, value=Male example4 Column=cc1:age, timestamp=1436854903976, value=3344Row (s)inch 0.0270secondshbase (main):048:0> Describe'Zhangchao'DESCRIPTION ENABLED'Zhangchao', {NAME ='CC1', Bloomfilter ='ROW', VERSIONS ='1', In_mtrueEMORY='false', Keep_deleted_cells ='false', data_block_encoding ='NONE', TTL = ='FOREVER', COMPRESSION ='NONE', min_versions ='0', BL Ockcache='true', BLOCKSIZE ='65536', Replication_scope ='0'}, {NA ME='CC2', Bloomfilter ='ROW', VERSIONS ='1', in_memory ='false', Keep_deleted_cells='false', data_block_encoding ='NONE', TTL = ='FOREVER', COMPRESSION ='NONE', min_versions ='0', Blockcache ='tru E', BLOCKSIZE ='65536', Replication_scope ='0'}1Row (s)inch 0.0770Seconds
The structure of the table in MySQL is as follows:
Build the Talend model to import data from HBase into MySQL:
After execution, the table in MySQL has the HBase information:
In this way hbase to MySQL data channel even get through, the crux of the problem is actually, how to design MySQL row data, let it convert to HBase in the class data, because HBase is a column storage, according to the table, row and column cluster: column-and value of the form to store.
Talend importing data from HBase into MySQL