hadoop-cos-2.x.x-${version}.jar
및 cos_api-bundle-${version}.jar
를 Datax 압축 해제 경로 plugin/reader/hdfsreader/libs/
및plugin/writer/hdfswriter/libs/
에 복사하십시오.CLASS_PATH = ("%s/lib/*:%s/plugin/reader/hdfsreader/libs/*:%s/plugin/writer/hdfswriter/libs/*:.") % (DATAX_HOME, DATAX_HOME, DATAX_HOME)
{"job": {"setting": {"speed": {"byte": 10485760},"errorLimit": {"record": 0,"percentage": 0.02}},"content": [{"reader": {"name": "hdfsreader","parameter": {"path": "testfile","defaultFS": "cosn://examplebucket-1250000000/","column": ["*"],"fileType": "text","encoding": "UTF-8","hadoopConfig": {"fs.cosn.impl": "org.apache.hadoop.fs.CosFileSystem","fs.cosn.userinfo.region": "ap-beijing","fs.cosn.tmp.dir": "/tmp/hadoop_cos","fs.cosn.userinfo.secretId": "COS_SECRETID","fs.cosn.userinfo.secretKey": "COS_SECRETKEY"},"fieldDelimiter": ","}},"writer": {"name": "hdfswriter","parameter": {"path": "/user/hadoop/","fileName": "testfile1","defaultFS": "cosn://examplebucket-1250000000/","column": [{"name": "col","type": "string"},{"name": "col1","type": "string"},{"name": "col2","type": "string"}],"fileType": "text","encoding": "UTF-8","hadoopConfig": {"fs.cosn.impl": "org.apache.hadoop.fs.CosFileSystem","fs.cosn.userinfo.region": "ap-beijing","fs.cosn.tmp.dir": "/tmp/hadoop_cos","fs.cosn.userinfo.secretId": "COS_SECRETID","fs.cosn.userinfo.secretKey": "COS_SECRETKEY"},"fieldDelimiter": ":","writeMode": "append"}}}]}}
cosn://examplebucket-1250000000/
와 같이 쓸 수 있습니다.ap-beijing
등)으로 변경합니다. 자세한 내용은 리전과 액세스 도메인을 참조하십시오.bin/datax.py job/hdfs_job.json
2020-03-09 16:49:59.543 [job-0] INFO JobContainer -[total cpu info] =>averageCpu | maxDeltaCpu | minDeltaCpu-1.00% | -1.00% | -1.00%[total gc info] =>NAME | totalGCCount | maxDeltaGCCount | minDeltaGCCount | totalGCTime | maxDeltaGCTime | minDeltaGCTimePS MarkSweep | 1 | 1 | 1 | 0.024s | 0.024s | 0.024sPS Scavenge | 1 | 1 | 1 | 0.014s | 0.014s | 0.014s2020-03-09 16:49:59.543 [job-0] INFO JobContainer - PerfTrace not enable!2020-03-09 16:49:59.543 [job-0] INFO StandAloneJobContainerCommunicator - Total 2 records, 33 bytes | Speed 3B/s, 0 records/s | Error 0 records, 0 bytes | All Task WaitWriterTime 0.000s | All Task WaitReaderTime 0.033s | Percentage 100.00%2020-03-09 16:49:59.544 [job-0] INFO JobContainer -작업 활성화 시간 : 2020-03-09 16:49:48작업 종료 시간 : 2020-03-09 16:49:59작업 총 소요 시간 : 11s작업 평균 트래픽 : 3B/s기록 입력 속도 : 0rec/s읽은 기록 총 횟수 : 2읽기/쓰기 실패 총 횟수 : 0
문제 해결에 도움이 되었나요?