一.配置文件localdata-hbase.json
{
"job": {
"setting": {
"speed": {
"channel": 5
}
},
"content": [
{
"reader": {
"name": "txtfilereader",
"parameter": {
"path": "/data/data.txt",
"charset": "UTF-8",
"column": [
{"index": 0,"type": "String"},
{"index": 1,"type": "string"},
{"index": 2,"type": "string"}
],
"fieldDelimiter": ","
}
},
"writer": {
"name": "hbase11xwriter",
"parameter": {
"hbaseConfig": {
"hbase.rootdir": "/hbase",
"hbase.cluster.distributed": "true",
"hbase.zookeeper.quorum": "cdh3:2181,cdh4:2181,cdh5:2181"
},
"table": "writer",
"mode": "normal",
"rowkeyColumn": [
{"index":0,"type":"string"}
],
"column": [
{ "index":1,"name": "cf1:q1","type": "string"},
{"index":2,"name": "cf1:q2","type": "string"}
],
"versionColumn":{
"index": -1,
"value":"123456789"
},
"encoding": "utf-8"
}
}
}
]
}
}
二.运行脚本
data.py localdata-hbase.json