【问题标题】:agents can't connect to cluster after enabling encryption启用加密后代理无法连接到集群
【发布时间】:2014-12-04 06:16:08
【问题描述】:

我在 AWS 中以多区域配置安装了 Datastax enterprise 4.5.3 和 Opscenter 5.0.1。我试图通过在 opscenter 和代理之间启用节点到节点加密、客户端到节点加密和 ssl 来使通信尽可能安全。

启用客户端到节点加密后,代理出现问题。在 casssandra.yaml 中启用加密后,datastax 代理会抛出一个错误,指出它无法连接到集群。

cassandra.yaml 的一部分:

# enable or disable client/server encryption.
client_encryption_options:
    enabled: true
    keystore: /usr/share/dse/resources/dse/conf/.keystore
    keystore_password: supersecret_password
    # require_client_auth: false
    # Set trustore and truststore_password if require_client_auth is true
    truststore: /usr/share/dse/resources/dse/conf/.truststore
    truststore_password: supersecret_password
    # More advanced defaults below:
    protocol: SSL
    # algorithm: SunX509
    # store_type: JKS
    # cipher_suites [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]

在 cassandra.yaml 中启用客户端到节点加密后,代理无法连接到集群。在 /var/log/datastax-agent/agent.log 中,我反复看到这个错误:

ERROR [pdp-loader] 2014-11-10 20:06:18,902 Unable to connect to Cassandra:
me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client.
    at me.prettyprint.cassandra.connection.HConnectionManager.getClientFromLBPolicy(HConnectionManager.java:390)
    at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:244)
    at me.prettyprint.cassandra.service.AbstractCluster.describePartitioner(AbstractCluster.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:298)
    at clj_hector.core$partitioner.invoke(core.clj:42)
    at opsagent.cassandra$load_pdps_with_retry$fn__1066.invoke(cassandra.clj:211)
    at opsagent.cassandra$load_pdps_with_retry.invoke(cassandra.clj:210)
    at opsagent.cassandra$setup_cassandra$f__388__auto____1094$fn__1095$f__388__auto____1102.invoke(cassandra.clj:357)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:745)
INFO [Hector.me.prettyprint.cassandra.connection.CassandraHostRetryService-1] 2014-11-10 20:06:28,700 Not checking that 54.86.178.77(54.86.178.77):9160 is a member of the ring since there are no live hosts
WARN [Hector.me.prettyprint.cassandra.connection.CassandraHostRetryService-1] 2014-11-10 20:06:28,701 Downed 54.86.178.77(54.86.178.77):9160 host still appears to be down: Unable to open transport to 54.86.178.77(54.86.178.77):9160 , java.net.ConnectException: Connection refused

【问题讨论】:

    标签: datastax-enterprise datastax opscenter


    【解决方案1】:

    请确保您已在 address.yaml 中完成代理配置。应该设置如下:

    stomp_interface: <stomp_interface_ip of opscenterd box>
    local_interface: <broadcast or listen_address_ip in cassandra.yaml>
    cassandra_conf: "<path>/dse-4.5.1/resources/cassandra/conf/cassandra.yaml"
    use_ssl: 1
    ssl_keystore: <path to keystore>/.keystore
    ssl_keystore_password: <ks password>
    thrift_ssl_truststore: <path to truststore>/.truststore
    thrift_ssl_truststore_password: <ts password>
    hosts: ["<ip address>"]
    

    在此处查看 SSL 和 Opscenter 的其他详细配置步骤以查看 tarball 安装和此处查看 package 安装

    【讨论】:

    • 您指向的文档列出了 local_interface,而不是 listen_interface。他们是一样的吗?我将 local_interface 设置为弹性 IP。
    • 哎呀,谢谢。在答案中更正。这是 address.yaml datastax.com/documentation/opscenter/5.0/opsc/configure/… 的详细文档
    • 在 opscenter here 中设置 ssl 的文档说要复制 agentKeyStore。我是否还必须复制信任库?配置暗示我应该。有任何相关文档吗?
    • 我相信您需要将证书导入每个节点上的信任库(或复制信任库)以进行节点到节点加密。但是,我认为 OpsC 不需要它来工作。 datastax.com/documentation/datastax_enterprise/4.5/…
    猜你喜欢
    • 2015-01-18
    • 1970-01-01
    • 2014-12-31
    • 2015-01-28
    • 1970-01-01
    • 2015-08-08
    • 2019-08-10
    • 2021-11-23
    • 2020-02-08
    相关资源
    最近更新 更多