java - 未检测到 Yaml 更改,启动期间遇到异常 : Invalid yaml: file:/etc/cassandra/cassandra. yaml

标签 java cassandra yaml

我更改了 Cassandra 配置文件

cat /etc/cassandra/cassandra.yaml | grep -n 'seed'
416:seed_provider:
423:          # seeds is actually a comma-delimited list of addresses.
425:          - seeds:"84.208.89.132,192.168.0.23,192.168.0.25,192.168.0.28"

还有集群名称

10:cluster_name: 'Petter Cluster'

我很惊讶地看到 system.log 显示的内容

INFO  [main] 2018-01-27 17:20:51,343 YamlConfigurationLoader.java:89 - Configuration location: file:/etc/cassandra/cassandra.yaml
ERROR [main] 2018-01-27 17:20:51,427 CassandraDaemon.java:706 - Exception encountered during startup: Invalid yaml: file:/etc/cassandra/cassandra.yaml
 Error: while parsing a block mapping; expected <block end>, but found FlowEntry;  in 'reader', line 425, column 34:
              - seeds: "192.168.0.13","192.168.0.23","192.168.0.25"," ... 
                                     ^
INFO  [main] 2018-02-03 20:35:48,528 YamlConfigurationLoader.java:89 - Configuration location: file:/etc/cassandra/cassandra.yaml
ERROR [main] 2018-02-03 20:35:48,844 CassandraDaemon.java:706 - Exception encountered during startup: Invalid yaml: file:/etc/cassandra/cassandra.yaml
 Error: null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=seed_provider for JavaBean=org.apache.cassandra.config.Config@551bdc27; java.lang.reflect.InvocationTargetException;  in 'reader', line 10, column 1:
    cluster_name: 'Test Cluster'
    ^
INFO  [main] 2018-02-03 20:39:08,311 YamlConfigurationLoader.java:89 - Configuration location: file:/etc/cassandra/cassandra.yaml
ERROR [main] 2018-02-03 20:39:08,647 CassandraDaemon.java:706 - Exception encountered during startup: Invalid yaml: file:/etc/cassandra/cassandra.yaml
 Error: null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=seed_provider for JavaBean=org.apache.cassandra.config.Config@551bdc27; java.lang.reflect.InvocationTargetException;  in 'reader', line 10, column 1:
    cluster_name: 'Test Cluster'

如何解决这个问题?更改后如何初始化系统?

最佳答案

您似乎遇到了集群名称问题,如果您愿意更改它,应该在所有节点上更改它。

以下是更改集群名称的说明: 1.登录cqlsh 2. cqlsh> UPDATE system.local SET cluster_name = 'Petter Cluster' where key='local'; (您需要在要更改集群名称的每个节点上发出此命令。) system.local 仅在本地更改 3. cqlsh> 退出; 4.$nodetool刷新系统 5. 将 cassandra.yaml 集群名称编辑为 YOUR_CLUSTER_NAME。 6. 重新启动 Cassandra 。

另请检查此链接: https://surbhinosqldba.wordpress.com/2015/07/23/how-to-rename-modify-cassandra-cluster-name/

关于java - 未检测到 Yaml 更改,启动期间遇到异常 : Invalid yaml: file:/etc/cassandra/cassandra. yaml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48608390/

相关文章:

Java JNI,dll的多个版本: How to specify which dll is being used for native calls (matlab jvm)

nosql - 在我的场景中提高 Cassandra 读取性能的方法

java - Spring Cloud Contract - 如何在 .yaml 文件中传递 "+"(加号)作为查询参数

javascript - 将 yaml 字符串转换为 JSON 对象

Java Applet,GridLayout 水平拉伸(stretch)文本字段

java - AmazonSQSClient.setRegion() 必要吗?

cassandra - 通过 CQLsh (Cassandra) 插入硬编码的 UUID

Azure 应用服务容器镜像强制从 Docker Hub(而不是 ACR)拉取

java - 什么会使用更多的内存

cassandra - 轻量级事务是否支持带有 if 的删除语句?