odps同步到hbase配置文件

本文详细解析了如何配置从阿里云ODPS到HBase的数据同步流程,包括rowKey的构成、HBase表的列族设置、任务参数配置及HBase连接配置等关键步骤,为大数据平台间的数据迁移提供了实用指南。

如下,注意几个地方的配置:

(1)rowKeycolumn 主键的构成

这里是para0和para5通过"_"拼接,构成主键

(2)column中的task:hbase表的NAME

"column": [
                    {
                        "name": "task:para0",

(3)

{
    "type": "job",
    "steps": [
        {
            "stepType": "odps",
            "parameter": {
                "partition": [],
                "datasource": "odps_first",
                "column": [
                    "para0",
                    "para1",
                    "para2",
                    "para3",
                    "para4",
                    "para5"
                ],
                "emptyAsNull": false,
                "table": "table_odps"
            },
            "name": "Reader",
            "category": "reader"
        },
        {
            "stepType": "hbase",
            "parameter": {
                "mode": "normal",
                "walFlag": "false",
                "hbaseVersion": "11x",
                "rowkeyColumn": [
                    {
                        "index": "0",
                        "type": "string"
                    },
                    {
                        "index": "-1",
                        "type": "string",
                        "value": "_"
                    },
                    {
                        "index": "5",
                        "type": "string"
                    }
                ],
                "nullMode": "skip",
                "column": [
                    {
                        "name": "task:para0",
                        "index": "0",
                        "type": "string"
                    },
                    {
                        "name": "task:para1",
                        "index": "1",
                        "type": "string"
                    },
                    {
                        "name": "task:para2",
                        "index": "2",
                        "type": "string"
                    },
                    {
                        "name": "task:para3",
                        "index": "3",
                        "type": "string"
                    },
                    {
                        "name": "task:para4",
                        "index": "4",
                        "type": "string"
                    },
                    {
                        "name": "task:para5",
                        "index": "5",
                        "type": "string"
                    }
                ],
                "writeMode": "api",
                "encoding": "utf-8",
                "table": "table_hbase",
                "hbaseConfig": {
                    "hbase.zookeeper.quorum": "xxx.hbase.rds.aliyuncs.com:xxxx",
                    "hbase.rootdir": "hdfs://xxx.hbase.rds.aliyuncs.com:9099/xxx",
                    "hbase.cluster.distributed": "true"
                }
            },
            "name": "Writer",
            "category": "writer"
        }
    ],
    "version": "2.0",
    "order": {
        "hops": [
            {
                "from": "Reader",
                "to": "Writer"
            }
        ]
    },
    "setting": {
        "errorLimit": {
            "record": ""
        },
        "speed": {
            "throttle": false,
            "concurrent": "2"
        }
    }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值