Dolphinscheduler使用Datax同步mongodb到doris

1、dolphinscheduler与datax集成环境变量配置

export JAVA_HOME=/opt/soft/java
export  PYTHON_HOME=/usr/bin/python
export  DATAX_HOME=/opt/soft/datax
export  PATH=$PYTHON_HOEM:$DATAX_HOME/bin:$JAVA_HOME/bin:$PATH

截图如下:

注意服务器上安装python2.7,以及datax安装在对应目录下。 

2、同步mongodb 到doris

{
    "job": {
        "content": [
            {
                "reader": {
                    "name": "mongodbreader", 
                    "parameter": {
                        "address": ["xxx:27017","xxxx:27017","xxxx:27017"], 
                        "collectionName": "leases", 
                        "column": [
                        {
                        "name":"_id",
                        "type":"string"
                        },
                        {
                        "name":"id",
                        "type":"string"
                        },
                        {
                        "name":"storeid",
                        "type":"string"
                        },
                        {
                        "name":"storename",
                        "type":"string"
                        },
                        {
                        "name":"title",
                        "type":"string"
                        },
                        {
                        "name":"source",
                        "type":"string"
                        },
                        {
                        "name":"code",
                        "type":"string"
                        },
                        {
                        "name":"codeyear",
                        "type":"string"
                        },
                        {
                        "name":"codemonth",
                        "type":"string"
                        },
                        {
                        "name":"codesort",
                        "type":"string"
                        },
                        {
                        "name":"classify",
                        "type":"string"
                        },
                        {
                        "name":"property",
                        "type":"string"
                        },
                        {
                        "name":"propertydir",
                        "type":"string"
                        },
                        {
                        "name":"leaseduration",
                        "type":"string"
                        },
                        {
                        "name":"leasestartdate",
                        "type":"string"
                        },
                        {
                        "name":"leaseenddate",
                        "type":"string"
                        },
                        {
                        "name":"calcacreage",
                        "type":"string"
                        },
                        {
                        "name":"acreage",
                        "type":"string"
                        },
                        {
                        "name":"insidespace",
                        "type":"string"
                        },
                        {
                        "name":"residentialpoolarea",
                        "type":"string"
                        },
                        {
                        "name":"handoverdate",
                        "type":"string"
                        },
                        {
                        "name":"billingdate",
                        "type":"string"
                        },
                        {
                        "name":"deposit",
                        "type":"string"
                        },
                        {
                        "name":"rental",
                        "type":"string"
                        },
                        {
                        "name":"otherdeposit",
                        "type":"string"
                        },
                        {
                        "name":"quitedat",
                        "type":"string"
                        },
                        {
                        "name":"quitamount",
                        "type":"string"
                        }
                        ], 
                        "dbName": "xxxx", 
                        "authDb":"admin",
                        "userName": "xxxx", 
                        "userPassword": "xxxx"
                    }
                }, 
                "writer": {
                    "name": "doriswriter", 
                    "parameter": {
                        "column": ["_id","id","storeid","storename","title","source","code","codeyear","codemonth","codesort","classify","property","propertydir","leaseduration","leasestartdate","leaseenddate","calcacreage","acreage","insidespace","residentialpoolarea","handoverdate","billingdate","deposit","rental","otherdeposit","quitedat","quitamount"], 
                        "connection": [
                            {
                                "jdbcUrl": "jdbc:mysql://xxxx:9030/ODS", 
                                "selectedDatabase":"ODS",
                                "table": ["test"]
                            }
                        ], 
                        "loadProps":{},
                        "loadUrl":["xxxx"],
                        "password": "****",
                        "postSql":[],  
                        "username": "root", 
                    }
                }
            }
        ], 
        "setting": {
            "speed": {
                "channel": "1"
            }
        }
    }
}

3、mogodb中json格式的集合,datax可用如下方式获取属性

                       {
                        "name":"tenant.company_phone",
                        "type":"document.string"
                        },

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值