本文介绍了带有AWS-Lambda的MCS返回错误一致性级别LOCAL_ONE不支持此操作.支持的一致性级别为:LOCAL_QUORUM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为课程项目使用带有AWS Lambda的AWS Managed Cassandra Service(MCS).我正在尝试执行写操作,并且从MCS收到响应错误,指出此操作不支持一致性级别LOCAL_ONE.支持的一致性级别为:LOCAL_QUORUM .几天前它运行良好,并且我没有更改Lambda函数或MCS Keyspace中的任何内容. AWS Lambda和AWS MCS托管在us-east-2区域.我该如何解决?读取操作正常.从AWS CloudWatch Management获取的日志的屏幕截图,它描述了我的查询错误:

I am using AWS Managed Cassandra Service(MCS) with AWS Lambda for my course project. I am trying to perform write operations and I am getting Response Errors from MCS stating Consistency level LOCAL_ONE is not supported for this operation. Supported consistency levels are: LOCAL_QUORUM. It was working fine a few days ago and I did not change anything from my Lambda function or in my MCS Keyspace. AWS Lambda and AWS MCS are hosted on us-east-2 regions. How do I solve this?Read operations are working fine.Screen Shot of the logs taken from AWS CloudWatch Management which describes the error for my query :

推荐答案

添加新参数

执行查询.下面是一个例子.

to the query execution. Below is an example of the same.

之前->不起作用

 addtempuser = 'INSERT into tempbotusers (mobilenumber,name,email) values (?,?,?)';
 checkaddtempuser_result = await client.execute(addtempuser,[mobilenumber,'NoName','NoEmail']);

添加新参数后->工作

 addtempuser = 'INSERT into tempbotusers (mobilenumber,name,email) values (?,?,?)';
 checkaddtempuser_result = await client.execute(addtempuser,[mobilenumber,'NoName','NoEmail'], { consistency: cassandra.types.consistencies.localQuorum });

这篇关于带有AWS-Lambda的MCS返回错误一致性级别LOCAL_ONE不支持此操作.支持的一致性级别为:LOCAL_QUORUM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 04:23