You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2023/05/04 13:05:11 UTC

[GitHub] [rocketmq-connect] liuxiaocs7 commented on issue #490: rocketmq-connect worker runtime cannot start normally

liuxiaocs7 commented on issue #490:
URL: https://github.com/apache/rocketmq-connect/issues/490#issuecomment-1534747606

   `bin/connect-standlone.sh` last line modify `sh` to `bash` works, like this:
   
   ```shell
   exec bash ${CONNECT_HOME}/bin/runconnect.sh org.apache.rocketmq.connect.runtime.StandaloneConnectStartup $@
   ```
   
   Also in wsl2, We can't seem to use 127.0.0.1, use localhost or real ip instead.
   
   ```shell
   curl -X POST -H "Content-Type: application/json" http://{localhost/real_ip}:8082/connectors/fileSourceConnector -d '{"connector.class":"org.apache.rocketmq.connect.file.FileSourceConnector","filename":"test-source-file.txt","connect.topicname":"fileTopic"}'
   
   curl -X POST -H "Content-Type: application/json" http://{localhost/real_ip}:8082/connectors/fileSinkConnector -d '{"connector.class":"org.apache.rocketmq.connect.file.FileSinkConnector","filename":"test-sink-file.txt","connect.topicnames":"fileTopic"}'
   ```
   
   show all connectors available by `curl -X GET http://localhost:8082/connectors/list`
   
   ```
   {
   	"status": 200,
   	"body": {
   		"fileSinkConnector": {
   			"status": {
   				"name": "fileSinkConnector",
   				"connector": {
   					"state": "RUNNING",
   					"trace": null,
   					"workerId": "standalone-worker"
   				},
   				"tasks": [{
   					"state": "RUNNING",
   					"trace": null,
   					"workerId": "standalone-worker",
   					"id": 0
   				}],
   				"type": "SINK"
   			},
   			"info": {
   				"name": "fileSinkConnector",
   				"config": {
   					"connector.class": "org.apache.rocketmq.connect.file.FileSinkConnector",
   					"filename": "test-sink-file.txt",
   					"connect.topicnames": "fileTopic"
   				},
   				"tasks": [{
   					"connector": "fileSinkConnector",
   					"task": 0
   				}],
   				"type": "SINK"
   			}
   		},
   		"fileSourceConnector": {
   			"status": {
   				"name": "fileSourceConnector",
   				"connector": {
   					"state": "RUNNING",
   					"trace": null,
   					"workerId": "standalone-worker"
   				},
   				"tasks": [{
   					"state": "RUNNING",
   					"trace": null,
   					"workerId": "standalone-worker",
   					"id": 0
   				}],
   				"type": "SOURCE"
   			},
   			"info": {
   				"name": "fileSourceConnector",
   				"config": {
   					"connector.class": "org.apache.rocketmq.connect.file.FileSourceConnector",
   					"filename": "test-source-file.txt",
   					"connect.topicname": "fileTopic"
   				},
   				"tasks": [{
   					"connector": "fileSourceConnector",
   					"task": 0
   				}],
   				"type": "SOURCE"
   			}
   		}
   	}
   }
   ```
   
   And result is right:
   
   ```
   [liuxiao@dev rocketmq-connect-0.0.1-SNAPSHOT]$ cat test-sink-file.txt
   Hello \r\nRocketMQ\r\n Connect
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org