gpt4 book ai didi

rust - 如何从使用rust 连接scylladb

转载 作者:行者123 更新时间:2023-12-03 11:33:06 24 4
gpt4 key购买 nike

我正在尝试从Rust代码连接到scyllaDB,这给出了错误

thread 'main' panicked at 'General("timed out waiting for connection")'


代码是
pub fn create_db_session() -> CDRSResult<CurrentSession> {
println!("connecting to db");
let auth = NoneAuthenticator;
let node = NodeTcpConfigBuilder::new("9.78.45.122:32028", auth).build();
let cluster_config = ClusterTcpConfig(vec![node]);
new_session(&cluster_config, SingleNode::new())
}
我正在使用的依赖项
[dependencies]
cdrs = "2"
cdrs_helpers_derive = "0.1.0"
uuid = "0.7"
time = "0.1"
从Python,我可以连接到相同的IP/PORT,但不能使用Rust。
可用的Python代码
dynamodb_client = boto3.client('dynamodb', region_name='None')
dynamodb = boto3.resource('dynamodb', endpoint_url=scylla_host,
region_name='None', aws_access_key_id='None', aws_secret_access_key='None')
Rust代码有什么问题?

最佳答案

看一下这篇博客文章,该文章解释了如何使用CDRS Rust驱动程序连接到Scylla https://www.scylladb.com/2020/04/21/using-the-cdrs-rust-driver-with-scylla/
最近,我们还在Hackathon期间开发了一个完全异步驱动程序的非常实验性的版本,您可以在这里https://github.com/scylladb/scylla-rust-driver找到它。

关于rust - 如何从使用rust 连接scylladb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64784804/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com