cql-proxy: error: 必须提供 bundle 路径、令牌或联系点中的其中之一

huangapple go评论46阅读模式
英文:

cql-proxy: error: must provide either bundle path, token, or contact points

问题

如何解决此错误:
cql-proxy: 错误: 必须提供捆绑包路径、令牌或联系点之一
这是我的docker-compose.yml:

cassandra-service:
    image: datastax/cql-proxy:v0.1.2
    container_name: cassandra-container
    hostname: cassandra-service
    ports:
    - 9042:9042
    networks:
    - clicknrate-network
    restart: always
    volumes:
    - ./secure-connect-clicknrate.zip:/secrets/secure-connect-clicknrate.zip
    environment:
    - ASTRA-TOKEN=AstraCS:********
    - ASTRA-DATABASE-ID=*******
    - ASTRA-API-URL=https://api.astra.datastax.com
    - PORT=9042
    - DATA-CENTER=dc1
    - USERNAME=******
    - PASSWORD=*****
    - KEYSPACE=clicknrate
    - ASTRA-BUNDLE=/secrets/secure-connect-clicknrate.zip
    - CONTACT-POINTS=cassandra-service
    - SCHEMA_ACTION=CREATE_IF_NOT_EXISTS

我的应用是一个使用Docker Compose运行的Java Spring Boot应用程序。

英文:

How to resolve this error:
cql-proxy: error: must provide either bundle path, token, or contact points
This is my docker-compose.yml:

cassandra-service:
    image: datastax/cql-proxy:v0.1.2
    container_name: cassandra-container
    hostname: cassandra-service
    ports:
    - 9042:9042
    networks:
    - clicknrate-network
    restart: always
    volumes:
    - ./secure-connect-clicknrate.zip:/secrets/secure-connect-clicknrate.zip
    environment:
    - ASTRA-TOKEN=AstraCS:********
    - ASTRA-DATABASE-ID=*******
    - ASTRA-API-URL=https://api.astra.datastax.com
    - PORT=9042
    - DATA-CENTER=dc1
    - USERNAME=******
    - PASSWORD=*****
    - KEYSPACE=clicknrate
    - ASTRA-BUNDLE=/secrets/secure-connect-clicknrate.zip
    - CONTACT-POINTS=cassandra-service
    - SCHEMA_ACTION=CREATE_IF_NOT_EXISTS

My application is a java spring boot application running with docker-compose.

答案1

得分: 1

以下是翻译好的部分:

配置有点矛盾 - 您有一个安全的捆绑包路径、Astra数据库ID和Astra令牌 - 但然后您指定了一个联系点,这应该是在不连接到Astra时使用cql-proxy的情况下才需要。

根据文档 (https://github.com/datastax/cql-proxy#configuration)

-c, --contact-points=CONTACT-POINTS,...
集群的联系点。如果使用捆绑包路径或令牌选项 ($CONTACT_POINTS),则将被忽略。

原始帖子中的错误详细信息不清楚,但“必须提供捆绑包路径、令牌或联系点之一”表明,您正在指定两者。

虽然在描述中说“被忽略”,但那是针对CLI参数的情况,我不确定容器会如何对待这个变量。如果要连接到Astra,请移除联系点环境变量,并在帖子中提供完整的错误信息。

英文:

The configuration is a bit contradictory - you have a secure bundle path, Astra Database ID and Astra Token - but then you specify a contact point, which would be for using cql-proxy when not connecting to Astra.

As per the docs (https://github.com/datastax/cql-proxy#configuration)

 -c, --contact-points=CONTACT-POINTS,...                 
Contact points for cluster. Ignored if using the bundle path 
or token option ($CONTACT_POINTS).

The error details from the original post are unclear but must provide either bundle path, token, or contact points indicates as above, you are specifying both.

While it says 'ignored' in the description, thats for a CLI parameter, I'm not sure how the container would react to the variable. If connecting to Astra, remove the contact points environment variable, and provide the full error within the post please.

huangapple
  • 本文由 发表于 2023年5月25日 02:56:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76326629.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定