雪花连接器“无法连接到雪花”

时间:2021-04-29 07:13:12

标签: apache-kafka snowflake-cloud-data-platform apache-kafka-connect confluent-cloud

我正在使用 Kafka 并尝试将雪花与它连接,但它没有连接。 它给出了某种区域错误,即服务器和集群应该在同一区域,我在本地 Kafka 上尝试过,但不接受“snowflake.url.name”。

这里是分布式模式下的配置文件。

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d '
{
  "name":"XYZCompanySensorData",
  "config":{
    "connector.class":"com.snowflake.kafka.connector.SnowflakeSinkConnector",
    "tasks.max":"2",
    "topics":"MysqlJConfluent.source.user_details",
    "buffer.count.records":"10000",
    "buffer.flush.time":"60",
    "buffer.size.bytes":"5000000",
    "snowflake.url.name":"fk79721.europe-west2.gcp.snowflakecomputing.com",
    "snowflake.user.name":"********",
    "snowflake.private.key":"********************************************",
    "snowflake.database.name":"DEMO_DB",
    "snowflake.schema.name":"PUBLIC",
    "key.converter":"org.apache.kafka.connect.storage.StringConverter",
    "value.converter":"com.snowflake.kafka.connector.records.SnowflakeAvroConverter"
  }
}'

日志文件:

HTTP/1.1 100 Continue

HTTP/1.1 400 Bad Request
Date: Wed, 28 Apr 2021 11:50:41 GMT
Content-Type: application/json
Content-Length: 368
Server: Jetty(9.4.33.v20201020)

{"error_code":400,"message":"Connector configuration is invalid and contains the following 3 error(s):\nsnowflake.url.name: Cannot connect to Snowflake\nsnowflake.user.name: Cannot connect to Snowflake\nsnowflake.private.key: Cannot connect to Snowflake\nYou can also find the above list of errors at the endpoint `/connector-plugins/{connectorType}/config/validate`"}

请告诉我如何连接。

1 个答案:

答案 0 :(得分:0)

这一行:

"snowflake.url.name":"fk79721.europe-west2.gcp.snowflakecomputing.com

表明您没有关闭引号,它应该是这样的:

"snowflake.url.name":"fk79721.europe-west2.gcp.snowflakecomputing.com:443"