cassandra 3.16:格式正确的yaml出现无效的yaml文件错误

u3r8eeie  于 2021-06-13  发布在  Cassandra
关注(0)|答案(2)|浏览(680)

我正在试着安装一个3.16版本的Cassandra。在启动时,我得到一个信息:

  1. ERROR [main] 2020-05-26 11:58:42,970 CassandraDaemon.java:774 - Exception encountered during startup: Invalid yaml: file:/etc/cassandra/default.conf/cassandra.yaml
  2. Error: null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=prepared_statements_cache_size_mb for JavaBean=org.apache.cassandra.config.Config@5427c60c; For input string: "auto"; in 'reader', line 3, column 1:
  3. cluster_name: 'thehivedb'

我用一个工具检查了我的yaml文件,它说可以。
我已经将prepared\u statements\u cache\u size\u mb:'auto'添加到我的配置文件中,但仍然失败,并显示相同的错误消息。
有人能帮我吗?
谢谢
马蒂厄
Cassandra.亚马尔

  1. ---
  2. cluster_name: 'thehivedb'
  3. ######## debug ########
  4. # valeurs requises non specifiees comme telles
  5. prepared_statements_cache_size_mb: 'auto'
  6. ########
  7. num_tokens: 256
  8. hinted_handoff_enabled: true
  9. max_hint_window_in_ms: 10800000 # 3 hours
  10. hinted_handoff_throttle_in_kb: 1024
  11. max_hints_delivery_threads: 2
  12. hints_directory: /data/elasticsearch/cassandra/hints
  13. hints_flush_period_in_ms: 10000
  14. max_hints_file_size_in_mb: 128
  15. batchlog_replay_throttle_in_kb: 1024
  16. # - AllowAllAuthenticator performs no checks - set it to disable authentication.
  17. authenticator: AllowAllAuthenticator
  18. # - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
  19. authorizer: AllowAllAuthorizer
  20. role_manager: CassandraRoleManager
  21. roles_validity_in_ms: 2000
  22. permissions_validity_in_ms: 2000
  23. credentials_validity_in_ms: 2000
  24. partitioner: org.apache.cassandra.dht.Murmur3Partitioner
  25. data_file_directories:
  26. - /data/elasticsearch/cassandra/data
  27. commitlog_directory: /data/elasticsearch/cassandra/commitlog
  28. cdc_enabled: false
  29. disk_failure_policy: stop
  30. commit_failure_policy: stop
  31. prepared_statements_cache_size_mb: auto
  32. thrift_prepared_statements_cache_size_mb: auto
  33. key_cache_size_in_mb:
  34. key_cache_save_period: 14400
  35. row_cache_size_in_mb: 0
  36. row_cache_save_period: 0
  37. counter_cache_size_in_mb:
  38. counter_cache_save_period: 7200
  39. saved_caches_directory: /data/elasticsearch/cassandra/saved_caches
  40. commitlog_sync: periodic
  41. commitlog_sync_period_in_ms: 10000
  42. commitlog_segment_size_in_mb: 32
  43. seed_provider:
  44. - class_name: org.apache.cassandra.locator.SimpleSeedProvider
  45. parameters:
  46. - seeds: "127.0.0.1"
  47. concurrent_reads: 32
  48. concurrent_writes: 32
  49. concurrent_counter_writes: 32
  50. concurrent_materialized_view_writes: 32
  51. memtable_allocation_type: heap_buffers
  52. index_summary_capacity_in_mb:
  53. index_summary_resize_interval_in_minutes: 60
  54. trickle_fsync: false
  55. trickle_fsync_interval_in_kb: 10240
  56. storage_port: 7000
  57. ssl_storage_port: 7001
  58. listen_interface: eth0
  59. start_native_transport: true
  60. native_transport_port: 9042
  61. start_rpc: false
  62. rpc_address: localhost
  63. rpc_port: 9160
  64. rpc_keepalive: true
  65. rpc_server_type: sync
  66. thrift_framed_transport_size_in_mb: 15
  67. incremental_backups: false
  68. snapshot_before_compaction: false
  69. auto_snapshot: true
  70. column_index_size_in_kb: 64
  71. column_index_cache_size_in_kb: 2
  72. range_request_timeout_in_ms: 10000
  73. write_request_timeout_in_ms: 2000
  74. counter_write_request_timeout_in_ms: 5000
  75. cas_contention_timeout_in_ms: 1000
  76. truncate_request_timeout_in_ms: 60000
  77. request_timeout_in_ms: 10000
  78. slow_query_log_timeout_in_ms: 500
  79. cross_node_timeout: false
  80. endpoint_snitch: SimpleSnitch
  81. dynamic_snitch_update_interval_in_ms: 100
  82. dynamic_snitch_reset_interval_in_ms: 600000
  83. dynamic_snitch_badness_threshold: 0.1
  84. request_scheduler: org.apache.cassandra.scheduler.NoScheduler
  85. server_encryption_options:
  86. internode_encryption: none
  87. keystore: conf/.keystore
  88. keystore_password: cassandra
  89. truststore: conf/.truststore
  90. truststore_password: cassandra
  91. client_encryption_options:
  92. enabled: false
  93. optional: false
  94. keystore: conf/.keystore
  95. keystore_password: cassandra
  96. internode_compression: dc
  97. inter_dc_tcp_nodelay: false
  98. tracetype_query_ttl: 86400
  99. tracetype_repair_ttl: 604800
  100. enable_user_defined_functions: false
  101. enable_scripted_user_defined_functions: false
  102. windows_timer_interval: 1
  103. transparent_data_encryption_options:
  104. enabled: false
  105. chunk_length_kb: 64
  106. cipher: AES/CBC/PKCS5Padding
  107. key_alias: testing:1
  108. key_provider:
  109. - class_name: org.apache.cassandra.security.JKSKeyProvider
  110. parameters:
  111. - keystore: conf/.keystore
  112. keystore_password: cassandra
  113. store_type: JCEKS
  114. key_password: cassandra
  115. tombstone_warn_threshold: 1000
  116. tombstone_failure_threshold: 100000
  117. batch_size_warn_threshold_in_kb: 5
  118. batch_size_fail_threshold_in_kb: 50
  119. unlogged_batch_across_partitions_warn_threshold: 10
  120. compaction_large_partition_warning_threshold_mb: 100
  121. gc_warn_threshold_in_ms: 1000
  122. back_pressure_enabled: false
  123. back_pressure_strategy:
  124. - class_name: org.apache.cassandra.net.RateBasedBackPressure
  125. parameters:
  126. - high_ratio: 0.90
  127. factor: 5
  128. flow: FAST
  129. enable_materialized_views: true
  130. enable_sasi_indexes: true
eoxn13cs

eoxn13cs1#

正如flyx的回答中提到的,这是:

  1. prepared_statements_cache_size_mb: 'auto'

无效。如果不想将其设置为特定值,请将该行全部注解掉,或将其返回到原始状态:

  1. prepared_statements_cache_size_mb:

仔细想想,yaml中的描述可能导致了这个问题:

  1. # Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater

现在,为什么这也被报道为 cluster_name 是另一个问题。

vfwfrxfs

vfwfrxfs2#

因此,首先,良好形式和有效性是两个独立的东西。当yaml解析器能够无误地读取yaml文档时,yaml文档就是格式良好的文档。但是,它只有在包含的结构与目标数据结构匹配时才有效。因此,检查文档的格式是否正确并不能保证它是有效的。
让我们看看目标数据结构:

  1. java.lang.Long prepared_statements_cache_size_mb

此设置被声明为类型 Long . 'auto' 无法分析为 Long ,因此出现错误。您必须输入 Long 数字或 null .

相关问题