tar -zxvf datax.tar.gz
[hdfs@192-168-16-71 datax]$ cd bin
[hdfs@192-168-16-71 bin]$ ll
total 40
-rwxrwxr-x 1 hdfs hdfs 8993 Nov 24 2017 datax.py
-rwxrwxr-x 1 hdfs hdfs 6906 Nov 24 2017 dxprof.py
-rwxrwxr-x 1 hdfs hdfs 16897 Nov 24 2017 perftrace.py
[hdfs@YZ-222-16-71 bin]$ python datax.py -r hbase11xreader -w txtfilewriter
DataX (DATAX-OPENSOURCE-3.0), From Alibaba !
Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved.
Please refer to the hbase11xreader document:
https://github.com/alibaba/DataX/blob/master/hbase11xreader/doc/hbase11xreader.md
Please refer to the txtfilewriter document:
https://github.com/alibaba/DataX/blob/master/txtfilewriter/doc/txtfilewriter.md
Please save the following configuration as a json file and use
python {DATAX_HOME}/bin/datax.py {JSON_FILE_NAME}.json
to run the job.
{
"job": {
"content": [
{
"reader": {
"name": "hbase11xreader",
"parameter": {
"column": [],
"encoding": "",
"hbaseConfig": {},
"mode": "",
"range": {
"endRowkey": "",
"isBinaryRowkey": true,
"startRowkey": ""
},
"table": ""
}
},
"writer": {
"name": "txtfilewriter",
"parameter": {
"dateFormat": "",
"fieldDelimiter": "",
"fileName": "",
"path": "",
"writeMode": ""
}
}
}
],
"setting": {
"speed": {
"channel": ""
}
}
}
}
创建测试表:
hbase(main):046:0> create 'LXW','CF'
0 row(s) in 1.2120 seconds
=> Hbase::Table - LXW
hbase(main):047:0> put 'LXW','row1','CF:NAME','lxw'
0 row(s) in 0.0120 seconds
hbase(main):048:0> put 'LXW','row1','CF:AGE','18'
0 row(s) in 0.0080 seconds
hbase(main):049:0> put 'LXW','row1','CF:ADDRESS','BeijingYiZhuang'
0 row(s) in 0.0070 seconds
hbase(main):050:0> put 'LXW','row2','CF:ADDRESS','BeijingYiZhuang2'
0 row(s) in 0.0060 seconds
hbase(main):051:0> put 'LXW','row2','CF:AGE','18'
0 row(s) in 0.0050 seconds
hbase(main):052:0> put 'LXW','row2','CF:NAME','lxw2'
0 row(s) in 0.0040 seconds
hbase(main):053:0> exit