如何在cassandra

时间:2017-12-04 12:01:22

标签: c amazon-ec2 yaml cassandra-3.0 backpressure

我正在尝试在Ec2 snitch配置中完成单个cassandra节点启动。

我为此配置更改的yaml属性是:

seeds : 'ip-address of machine'
listen: 'ip_address of machine'
rpc_address:'ip_address of machine'
snitch : Ec2Snitch

所有其他节俭,rpc_broadcast,广播都被评论并且未启用。

我在尝试启动连接时收到此错误

  

INFO [main] 2017-12-04 16:54:15,021 RateBasedBackPressure.java:123 -   初始化背压高比率:0.9,因子:5,流量:快速,   窗口大小:2000。INFO [主要] 2017-12-04 16:54:15,022   DatabaseDescriptor.java:725 - 使用策略禁用背压   org.apache.cassandra.net.RateBasedBackPressure {high_ratio = 0.9,   factor = 5,flow = FAST}。例外   (org.apache.cassandra.exceptions.ConfigurationException)遇到了   在启动期间:实例化snitch类时出错   ' org.apache.cassandra.locator.Ec2Snitch&#39 ;.   org.apache.cassandra.exceptions.ConfigurationException:错误   实例化snitch class' org.apache.cassandra.locator.Ec2Snitch'。     在   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:543)     在   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:521)     在   org.apache.cassandra.config.DatabaseDescriptor.createEndpointSnitch(DatabaseDescriptor.java:1035)     在   org.apache.cassandra.config.DatabaseDescriptor.applySnitch(DatabaseDescriptor.java:959)     在   org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:318)     在   org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:142)     在   org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:645)     在   org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:580)     在   org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689)   引起:java.net.NoRouteToHostException:没有到主机的路由(主机   java.net.PlainSocketImpl.socketConnect(本机方法)     在   java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)     在   java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)     在   java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)     在java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at   java.net.Socket.connect(Socket.java:589)at   java.net.Socket.connect(Socket.java:538)at   sun.net.NetworkClient.doConnect(NetworkClient.java:180)at   sun.net.www.http.HttpClient.openServer(HttpClient.java:463)at   sun.net.www.http.HttpClient.openServer(HttpClient.java:558)at at   sun.net.www.http.HttpClient。(HttpClient.java:242)at   sun.net.www.http.HttpClient.New(HttpClient.java:339)at at   sun.net.www.http.HttpClient.New(HttpClient.java:357)at at   sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)     在   sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)     在   sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)     在   sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)     在   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)     在   java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)     在   org.apache.cassandra.locator.Ec2Snitch.awsApiCall(Ec2Snitch.java:78)     在org.apache.cassandra.locator.Ec2Snitch。(Ec2Snitch.java:55)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   方法)at   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在java.lang.Class.newInstance(Class.java:442)at   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:528)     ... 8更多错误[主要] 2017-12-04 16:54:18,308   CassandraDaemon.java:706 - 启动时遇到异常   org.apache.cassandra.exceptions.ConfigurationException:错误   实例化snitch class' org.apache.cassandra.locator.Ec2Snitch'。     在   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:543)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:521)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.config.DatabaseDescriptor.createEndpointSnitch(DatabaseDescriptor.java:1035)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.config.DatabaseDescriptor.applySnitch(DatabaseDescriptor.java:959)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:318)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:142)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:645)   [apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:580)   [apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689)   [apache-cassandra-3.11.1.jar:3.11.1]引起:   java.net.NoRouteToHostException:没有到主机的路由(主机不可达)     at java.net.PlainSocketImpl.socketConnect(Native Method)   〜[na:1.8.0_151] at   java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)   〜[na:1.8.0_151] at   java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)   〜[na:1.8.0_151] at   java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)   〜[na:1.8.0_151] at   java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)   〜[na:1.8.0_151] java.net.Socket.connect(Socket.java:589)   〜[na:1.8.0_151] java.net.Socket.connect(Socket.java:538)   〜[na:1.8.0_151] at   sun.net.NetworkClient.doConnect(NetworkClient.java:180)   〜[na:1.8.0_151] at   sun.net.www.http.HttpClient.openServer(HttpClient.java:463)   〜[na:1.8.0_151] at   sun.net.www.http.HttpClient.openServer(HttpClient.java:558)   〜[na:1.8.0_151] at   sun.net.www.http.HttpClient。(HttpClient.java:242)   〜[na:1.8.0_151] at   sun.net.www.http.HttpClient.New(HttpClient.java:339)〜[na:1.8.0_151]     在sun.net.www.http.HttpClient.New(HttpClient.java:357)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)   〜[na:1.8.0_151] at   sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)   〜[na:1.8.0_151] at   java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)   〜[na:1.8.0_151] at   org.apache.cassandra.locator.Ec2Snitch.awsApiCall(Ec2Snitch.java:78)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   org.apache.cassandra.locator.Ec2Snitch。(Ec2Snitch.java:55)   〜[apache-cassandra-3.11.1.jar:3.11.1] at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)   〜[na:1.8.0_151] at   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)   〜[na:1.8.0_151] at   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)   〜[na:1.8.0_151] at   java.lang.reflect.Constructor.newInstance(Constructor.java:423)   〜[na:1.8.0_151]在java.lang.Class.newInstance(Class.java:442)   〜[na:1.8.0_151] at   org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:528)   〜[apache-cassandra-3.11.1.jar:3.11.1] ...省略了8个常见框架

我无法弄清楚错误的最初原因。我已经检查过初始化rack-dc和topology-properties文件中的任何属性。但我没有找到任何值得引起这个问题的东西。 该节点甚至没有初始化初始模式。有人可以帮我解决这个问题吗?如果可能,请帮助我在Ec2 snitch配置中提供设置多节点设置的说明。我已经尝试了所有可能的方法来建立具有Ec2配置的单节点。所以,我想把它发布在SO中,让大脑帮我解决问题。

提前致谢。

1 个答案:

答案 0 :(得分:1)

这应该适合你(我测试过) - 检查拼写错误,或者你的yaml文件中缺少字符/空格。

  • cluster_name:'tomer-test-cluster'
  • 种子:“[internal_ip]”
  • listen_address:[internal_ip]
  • native_transport_port:9042
  • endpoint_snitch:Ec2Snitch
  • rpc_address:0.0.0.0
  • rpc_port:9160
  • broadcast_rpc_address:[internal_ip]