【问题标题】:DataStax Opscenter Agent doesn't connect: "Unable to locate cassandra.yaml configuration file"DataStax Opscenter 代理未连接:“无法找到 cassandra.yaml 配置文件”
【发布时间】:2013-12-23 12:21:22
【问题描述】:

我在 Windows Server 2012 R2 Datacenter 机器上安装了 Datastax Community Edition v2.0.3。 安装 vanilla 后,我无法使用 OpsCenter 连接到数据库,因为代理无法启动:页面顶部显示“已连接 1 个代理中的 0 个”。我可以使用 CQLSH 连接到数据库本身。 v2.0.2 不会出现此问题。

我的datastax_opscenter_agent-stderr.log 文件包含以下内容:

2013-12-05 16:16:54 Commons Daemon procrun stderr initialized
Exception in thread "Initialization" clojure.lang.ExceptionInfo: throw+: {:type :bad-permissions, :message "Unable to locate the cassandra.yaml configuration file. If your configuration file is not located with the Cassandra install, please set the 'conf_location' option in the Cassandra section of the OpsCenter cluster configuration file and restart opscenterd. Checked the following directories: [\"/etc/dse/cassandra/cassandra.yaml\" \"/etc/cassandra/conf/cassandra.yaml\" \"/etc/cassandra/cassandra.yaml\" \"C:\\\\Program Files\\\\DataStax Community\\\\apache-cassandra\\\\bin\\\\conf\\\\cassandra.yaml\"]"} {:object {:type :bad-permissions, :message "Unable to locate the cassandra.yaml configuration file. If your configuration file is not located with the Cassandra install, please set the 'conf_location' option in the Cassandra section of the OpsCenter cluster configuration file and restart opscenterd. Checked the following directories: [\"/etc/dse/cassandra/cassandra.yaml\" \"/etc/cassandra/conf/cassandra.yaml\" \"/etc/cassandra/cassandra.yaml\" \"C:\\\\Program Files\\\\DataStax Community\\\\apache-cassandra\\\\bin\\\\conf\\\\cassandra.yaml\"]"}, :environment {tar-location "C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml", conf nil, checked-files ["/etc/dse/cassandra/cassandra.yaml" "/etc/cassandra/conf/cassandra.yaml" "/etc/cassandra/cassandra.yaml" "C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml"]}}
    at opsagent.util.cassandra_util$cassandra_conf_location.invoke(cassandra_util.clj:118)
    at opsagent.util.cassandra_util$get_cassandra_conf.invoke(cassandra_util.clj:130)
    at opsagent.opsagent$create_thrift_conf_vars.invoke(opsagent.clj:52)
    at opsagent.opsagent$setup_thrift.invoke(opsagent.clj:138)
    at opsagent.jmx$determine_ip.invoke(jmx.clj:333)
    at opsagent.jmx$setup_jmx$fn__1309.invoke(jmx.clj:350)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Unknown Source) 

实际上在C:\Program Files\DataStax Community\apache-cassandra\conf 目录中有一个cassandra.yaml文件,它应该在。上面的消息表明它查看了C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml,不过(注意\bin)。

根据日志的建议,在opscenter\conf\clusters\local.conf 中设置conf_location 选项会导致同样的错误。

通过这一切,Windows 防火墙已被关闭。

编辑

我一直在修修补补,现在我在日志中得到了同样的异常,除了它一直在寻找 cassanda.yaml 的路径已经改变了

'C:\Program Files\DataStax Community\apache-cassandra\bin\conf\cassandra.yaml'

'C:\Program Files\DataStax Community\utils\conf\cassandra.yaml'

我不知道我做了什么来改变这一点。

我尝试将cassandra.yaml 复制到上面的目录。这消除了 datastax_opscenter_agent-stderr.log 中的异常,但 OpsCenter 仍然显示“已连接 1 个代理中的 0 个”。但是,仪表板现在在图表中显示数据。我也可以向模式中添加一个键空间,但是在我创建它之后它不会显示出来。不过,可以使用CLQSH 访问它。显然,在两个不同的地方拥有cassandra.yaml 也不理想。

【问题讨论】:

    标签: cassandra cassandra-2.0 windows-server-2012-r2


    【解决方案1】:

    我通过如下设置 conf_location 属性解决了这个问题:

    conf_location = C:\Program Files\DataStax Community\apache-cassandra\conf\cassandra.yaml
    

    最初我在路径周围使用引号,但这不起作用。删除引号就可以了。

    【讨论】:

      【解决方案2】:

      在安装 DataStax Community Edition v1.2.15 时,我在 Windows 7 x64 中遇到了同样的问题。我让它工作,然后在备份和回滚之后,我使用 Beyond Compare 来确定究竟是什么改变真正解决了这个问题。 khaledh 的其他正确答案和equivalent SF question 中存在一些歧义,因此我提供了更完整的答案。

      在C:​​\Program Files\DataStax Community\opscenter\conf\clusters\local.conf中,..的默认内容

      [cassandra]
      seed_hosts = 127.0.0.1
      

      .. 应该是 ..

      [cassandra]
      seed_hosts = 127.0.0.1
      conf_location = C:\\Program Files\\DataStax Community\\apache-cassandra\\conf\\cassandra.yaml
      

      重新启动服务,然后在 OpsCenter 中如果仍然显示“0 of 1 个代理”,请单击“立即修复”链接。就我而言,直到我单击此链接后,它才自我更新并显示“1 of 1”,而没有任何提示或警报。

      【讨论】:

      • 这在 DataStax Community 安装程序的 v1.2.15 时是一个观察到的问题,但在使用 v2.0.7 的重置机器上进行新安装时,这不是一个观察到的问题。
      • 2.1.9还是有这个问题。
      【解决方案3】:

      我通过在代理配置文件 address.yaml 中添加条目来解决此问题,

      步骤,

      1. 登录代理机器

      2. 停止代理

      3. 如果尚未添加,请添加 JAVA_HOME

      4. 编辑(如果不存在则创建)address.yaml (如果您使用包管理器安装了 OpsCenter 代理,则位于 /etc/datastax-agent/)

      5. 添加条目为

      cassandra_conf:

      1. 启动代理

      2. 重新启动 opscenter - 在您重新启动 opscenter 之前,新代理不会显示

      cassandra_conf: /usr/lib/cassandra-2.0.5/conf/cassandra.yaml

      创建如果不存在

      (适用于 Opscenter 和 Agent 的 DataStax 5.0.1 版)

      【讨论】:

        猜你喜欢
        • 2015-05-13
        • 2023-04-07
        • 2017-03-03
        • 2016-05-07
        • 2016-05-04
        • 2017-07-28
        • 2015-08-04
        • 2017-07-08
        • 2014-02-22
        相关资源
        最近更新 更多