标签:数据 思路 start port 启动 简单 注意 ansi 存储
以前在测试streamsets 的时候就发现中文乱码,后边也每太注意,因为支持问题,今天跑了下单元
测试代码,已经使用本机运行,发现都没有问题,然后运行以前的配置,使用jjs 发现模式的编码为
ANSI_X3.4-1968
version: "3"
services:
sets:
image: streamsets/datacollector
volumes:
- "./ms/data:/data"
- "./ms/logs:/logs"
- "./ms/tmp:/tmp"
ports:
- "8000:8000"
- "18630:18630"
redis:
image: redis
ports:
- "6379:6379"
mongodb:
image: mongo
ports:
- "27017:27017"
docker-compose exec sets sh
var s = Java.type("java.lang.System")
print(s.getProperty("file.encoding"))
print(s.getProperty("sun.jnu.encoding"))
结果为上边说的ANSI_X3.4-1968
修改默认编码为utf-8
FROM streamsets/datacollector:3.12.0-latest
ENV SDC_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=utf-8"
ENV SDC_JAVA8_OPTS="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=utf-8"
version: "3"
services:
sets:
build: ./
volumes:
- "./ms/data:/data"
- "./ms/logs:/logs"
- "./ms/tmp:/tmp"
ports:
- "8000:8000"
- "18630:18630"
redis:
image: redis
ports:
- "6379:6379"
mongodb:
image: mongo:3.0
ports:
- "27017:27017"
expression 处理
mongodb
启动pipeline很简单, 点击start 即可
curl -i -X POST http://localhost:8000/rest/v1/user --header "X-SDC-APPLICATION-ID:microservice" -d ‘{"ID":1, "NAME": "Sample Name 荣", "AGE":34, "ADDRESS": "2333 San Francisco"}‘
以上处理的方法比较简单,主要是记录下一个处理的问题的思路以及解决方法
https://streamsets.com/documentation/datacollector/latest/help/datacollector/UserGuide/Configuration/DCEnvironmentConfig.html#concept_rng_qym_qr
https://github.com/streamsets/datacollector-docker
标签:数据 思路 start port 启动 简单 注意 ansi 存储
原文地址:https://www.cnblogs.com/rongfengliang/p/11960898.html