无法使用cqlsh连接到cassandra
我想连接到cassandra但出现此错误:
I want to connect to cassandra but got this error:
$ bin/cqlsh
Connection error: ('Unable to connect to any servers', {'192.168.1.200': error(10061, "Tried connecting to [('192.168.1.200', 9042)]. Last error: No connection could be made because the target machine actively refused it")})
非常简单。
计算机正在主动拒绝,因为您的系统上没有运行cassandra。请按照以下步骤完全摆脱此麻烦:
The machine is actively refusing it because your system does not have cassandra running on it. Follow the following steps to completely get rid of this trouble :
- 从DataStax(Datastax-DDC;安装 Cassandra Cassandra版本3)。
- 转到
〜\安装\路径\DataStax-DDC\apache-cassandra\bin
。 - 在那里打开
cmd
。 (如果出现以下情况,请使用Alt
+F
+P
打开它您使用的是Windows 8或更高版本的Windows。) - 键入
cassandra -f
,这会在窗口上产生很多东西,您必须得到最后一行作为INFO 11:32:31创建默认的超级用户角色'cassandra'
- 现在打开另一个
cmd
窗口在同一文件夹中。 - 键入
cqlsh
- Install Cassandra from DataStax (Datastax-DDC; Cassandra version 3).
- Go to
~\installation\path\DataStax-DDC\apache-cassandra\bin
. - Open up
cmd
there. (UseAlt
+F
+P
to open it if you are on windows 8 or later). - type
cassandra -f
this will generate a lot of stuff on the window and you must get the last line asINFO 11:32:31 Created default superuser role 'cassandra'
- Now open another
cmd
window in the same folder. - Type
cqlsh
这应该提示您,没有任何错误。
This should give you a prompt, without any error.
我还发现如果我使用在此处
I also discovered that this error doesn't pop up if I use cassadra v2.x found here Archived version of Cassandra. I don't know why :( (If you find out please comment).
因此,如果上述步骤不起作用,您可以随时回到Cassandrav2.x。
So, if the above steps do not work, you can always go back to Cassandra v2.x.
干杯。