为interbase创建jdbc连接器源

mccptt67  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(441)

我正在尝试使用curl命令为kafka创建jdbc连接器。请帮我纠正这个命令。

curl -X POST -H "Content-Type: application/json"  --data "{ \"name\": 
\"ib_connector\",\"config\": { \"connector.class\": \"io.confluent.connect.jdbc.JdbcSourceConnector\", \"tasks.max\": 1,
\"connection.url\": \"jdbc:interbase://ip:3050;Database=TEST2;user=SYSDBA;password=masterkey\",\"mode\": \"timestamp+incrementing\", \"incrementing.column.name\": \"id\",\"timestamp.column.name\": \"modified\", \"topic.prefix\": \"test-interbase-\", \"poll.interval.ms\": 1000 } }"
http://localhost:8083/connectors

在命令提示符中显示以下错误

curl: (52) Empty reply from server

我正在运行docker-compose.yml文件

version: '3.7'
services:
  zookeeper:
    image: confluentinc/cp-zookeeper:${CONFLUENT_VERSION}
    networks:
      - kafka
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000
      KAFKA_JMX_PORT: 39999

  kafka:
    image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
    depends_on:
      - zookeeper
    ports:
      - 9092:9092
    networks:
      - kafka
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_JMX_PORT: 49999

  schema-registry:
    image: confluentinc/cp-schema-registry:${CONFLUENT_VERSION}
    depends_on:
      - zookeeper
      - kafka
    networks:
      - kafka
    environment:
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
      SCHEMA_REGISTRY_HOST_NAME: schema-registry

  connect:
    image: confluentinc/cp-kafka-connect:${CONFLUENT_VERSION}
    depends_on:
      - zookeeper
      - kafka
      - schema-registry
    ports:
      - 8083:8083
    networks:
      - kafka
    volumes:
      - ${KAFKA_CONNECT_JARS_PATH}:/etc/kafka-connect/jars
    environment:
      CONNECT_BOOTSTRAP_SERVERS: 'kafka:9092'
      CONNECT_REST_ADVERTISED_HOST_NAME: connect
      CONNECT_REST_PORT: 8083
      CONNECT_GROUP_ID: compose-connect-group
      CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-configs
      CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
      CONNECT_OFFSET_FLUSH_INTERVAL_MS: 10000
      CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets
      CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
      CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status
      CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
      CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
      CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: 'http://schema-registry:8081'
      CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
      CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: 'http://schema-registry:8081'
      CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
      CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
      CONNECT_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars'

networks:
  kafka:
    driver: bridge

Kafka正在运行,我已经使用了命令 docker-compose up -d 我得到了成功的信息。我正在windows上运行它。下面是容器的状态。
当我运行docker compose up-d时,它显示为kafka\u manager正在启动。但我一检查状态就会显示255出口。它是否影响将配置保存到端口8083。

原因可能是什么。kafka connect处于活动状态,并在端口8083中运行。请帮忙

sf6xfgos

sf6xfgos1#

Kafka在9092上运行,而连接工人在8083上运行。
您正在8083上发布配置,因此请确保已启动并运行工作程序。

相关问题