访问远程cassandra数据库

时间:2018-06-11 11:11:59

标签: cassandra

我试图通过命令访问远程cassendra数据库:

command: cqlsh 
error:
Connection error: 
    ('Unable to connect to any servers', 
        {'127.0.0.1': error(111, 
        "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")}
    )

当我尝试访问localhost时,我收到错误:

Array#filter

1 个答案:

答案 0 :(得分:0)

您需要检查Cassandra是否可以通过给定的IP&您在命令行中指定的端口。如果您没有更改默认端口,则可以使用import PackageDescription let package = Package( name: "SwiftBackend", products: [ .library(name: "PerfectMongoDB", targets: ["PerfectMongoDB"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"), .package(url: "https://github.com/PerfectSideRepos/Perfect-CMongo.git", from: "0.0.0"), .package(url: "https://github.com/PerfectSideRepos/Perfect-CBSON.git", from: "0.0.0"), .package(url: "https://github.com/PerfectlySoft/PerfectLib.git", from: "3.0.0") ], targets: [ .target( name: "SwiftBackend", dependencies: ["PerfectHTTPServer" , "PerfectLib" , "PerfectMongoDB"]), ] ) 。如果它不起作用,请检查您是否没有允许在给定IP上允许流量到端口9042的防火墙。