Addax 备忘

下载编译好的二进制文件

https://github.com/wgzhao/Addax/releases/download/4.0.2/addax-4.0.2.tar.gz

tar -xzf addax-4.0.2.tar.gz
cd addax-4.0.2

读http写pssql配置文件

{
    "job": {
        "setting": {
            "speed": {
                "channel": 1,
                "bytes": -1
            }
        },
        "content": [
            {
                "reader": {
                    "name": "httpreader",
                    "parameter": {
                        "connection": [
                            {
                                "url": "http://127.0.0.1/dsideal_yy/admin/new_base/depinfo_getOrgTree"
                            }
                        ],
                        "reqParams": {
                            "org_id": ${org_id}
                        },
                        "resultKey": "list",
                        "method": "GET",
                        "column": [
                            "id",
                            "name"
                        ],
                        "username": "",
                        "password": "",
                        "headers": {
                            "X-Powered-by": "Addax"
                        }
                    }
                },
                "writer": {
                    "name": "postgresqlwriter",
                    "parameter": {
                        "column": [
                            "id",
                            "name"
                        ],
                        "preSql": [
                            "truncate table @table"
                        ],
                        "connection": [
                            {
                                "jdbcUrl": "jdbc:postgresql://127.0.0.1:5432/edu_db",
                                "table": [
                                    "test"
                                ]
                            }
                        ],
                        "username": "root",
                        "password": "123456",
                        "writeMode": "insert"
                    }
                }
            }
        ]
    }
}

执行(-p加动态参数 -D)

bin/addax.sh -p "-Dorg_id=400195" job/http2stream.json

 

Addax 备忘

上一篇:CentOS 8.0与CentOS7.0 防火墙端口设置


下一篇:【Docker】基本介绍