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

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

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

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
 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:
    cluster_name: 'thehivedb'

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

---

cluster_name: 'thehivedb'

######## debug ########

# valeurs requises non specifiees comme telles

prepared_statements_cache_size_mb: 'auto'

######## 

num_tokens: 256

hinted_handoff_enabled: true

max_hint_window_in_ms: 10800000 # 3 hours

hinted_handoff_throttle_in_kb: 1024

max_hints_delivery_threads: 2

hints_directory: /data/elasticsearch/cassandra/hints

hints_flush_period_in_ms: 10000

max_hints_file_size_in_mb: 128

batchlog_replay_throttle_in_kb: 1024

# - AllowAllAuthenticator performs no checks - set it to disable authentication.

authenticator: AllowAllAuthenticator

# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.

authorizer: AllowAllAuthorizer

role_manager: CassandraRoleManager

roles_validity_in_ms: 2000

permissions_validity_in_ms: 2000

credentials_validity_in_ms: 2000

partitioner: org.apache.cassandra.dht.Murmur3Partitioner

data_file_directories:
    - /data/elasticsearch/cassandra/data

commitlog_directory: /data/elasticsearch/cassandra/commitlog

cdc_enabled: false

disk_failure_policy: stop

commit_failure_policy: stop

prepared_statements_cache_size_mb: auto

thrift_prepared_statements_cache_size_mb: auto

key_cache_size_in_mb:

key_cache_save_period: 14400

row_cache_size_in_mb: 0

row_cache_save_period: 0

counter_cache_size_in_mb:

counter_cache_save_period: 7200

saved_caches_directory: /data/elasticsearch/cassandra/saved_caches

commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000

commitlog_segment_size_in_mb: 32

seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          - seeds: "127.0.0.1"

concurrent_reads: 32
concurrent_writes: 32
concurrent_counter_writes: 32

concurrent_materialized_view_writes: 32

memtable_allocation_type: heap_buffers

index_summary_capacity_in_mb:

index_summary_resize_interval_in_minutes: 60

trickle_fsync: false
trickle_fsync_interval_in_kb: 10240

storage_port: 7000

ssl_storage_port: 7001

listen_interface: eth0

start_native_transport: true
native_transport_port: 9042

start_rpc: false

rpc_address: localhost

rpc_port: 9160

rpc_keepalive: true

rpc_server_type: sync

thrift_framed_transport_size_in_mb: 15

incremental_backups: false

snapshot_before_compaction: false

auto_snapshot: true

column_index_size_in_kb: 64

column_index_cache_size_in_kb: 2

range_request_timeout_in_ms: 10000
write_request_timeout_in_ms: 2000
counter_write_request_timeout_in_ms: 5000
cas_contention_timeout_in_ms: 1000
truncate_request_timeout_in_ms: 60000
request_timeout_in_ms: 10000

slow_query_log_timeout_in_ms: 500

cross_node_timeout: false

endpoint_snitch: SimpleSnitch

dynamic_snitch_update_interval_in_ms: 100
dynamic_snitch_reset_interval_in_ms: 600000
dynamic_snitch_badness_threshold: 0.1

request_scheduler: org.apache.cassandra.scheduler.NoScheduler

server_encryption_options:
    internode_encryption: none
    keystore: conf/.keystore
    keystore_password: cassandra
    truststore: conf/.truststore
    truststore_password: cassandra

client_encryption_options:
    enabled: false
    optional: false
    keystore: conf/.keystore
    keystore_password: cassandra

internode_compression: dc

inter_dc_tcp_nodelay: false

tracetype_query_ttl: 86400
tracetype_repair_ttl: 604800

enable_user_defined_functions: false

enable_scripted_user_defined_functions: false

windows_timer_interval: 1

transparent_data_encryption_options:
    enabled: false
    chunk_length_kb: 64
    cipher: AES/CBC/PKCS5Padding
    key_alias: testing:1
    key_provider:
      - class_name: org.apache.cassandra.security.JKSKeyProvider
        parameters:
          - keystore: conf/.keystore
            keystore_password: cassandra
            store_type: JCEKS
            key_password: cassandra

tombstone_warn_threshold: 1000
tombstone_failure_threshold: 100000

batch_size_warn_threshold_in_kb: 5

batch_size_fail_threshold_in_kb: 50

unlogged_batch_across_partitions_warn_threshold: 10

compaction_large_partition_warning_threshold_mb: 100

gc_warn_threshold_in_ms: 1000

back_pressure_enabled: false
back_pressure_strategy:
    - class_name: org.apache.cassandra.net.RateBasedBackPressure
      parameters:
        - high_ratio: 0.90
          factor: 5
          flow: FAST

enable_materialized_views: true

enable_sasi_indexes: true
eoxn13cs

eoxn13cs1#

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

prepared_statements_cache_size_mb: 'auto'

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

prepared_statements_cache_size_mb:

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


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

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

vfwfrxfs

vfwfrxfs2#

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

java.lang.Long        prepared_statements_cache_size_mb

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

相关问题