CQLSH : NoHostAvailable错误 Cassandra更新失败更新。

问题描述 投票:2回答:1

这是我的钥匙空间

CREATE KEYSPACE db_space WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

这是我的桌子

CREATE TABLE **db_space.user12** (
    id text PRIMARY KEY,
    details map<text, text>,
    services map<text, frozen<user_services>>
) WITH additional_write_policy = '99p'
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '16', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair = 'BLOCKING'
    AND speculative_retry = '99p';

下面的查询工程

update user12 set details=details + {'name':'raj'} where id = '2';

但是,当我试图用UDT更新一个字段时。

update user12 set services = {'1298182':{'id':'2','title':'2','description':'2'}} where id = '2';

出现了一个错误。没有可用的主机

这个问题只发生在这个特定的领域?我在网上搜索,并尝试改变网络策略 , 群集名称 , nodetool维修和大量的cassandra重启. 这显示了错误

cassandra cql cqlsh
1个回答
1
投票

你的查询是不正确的--UDT中的字段名不应该被引用,所以应该是这样的。

update user12 set services = {'1298182':{id:'2', title:'2', description:'2'}} 
   where id = '2';

虽然我不知道为什么它显示NoHostAvailable - 你需要检查服务器端的日志。查看 system.log 的节点。

© www.soinside.com 2019 - 2024. All rights reserved.