我已经在Ubuntu 16.04.2 LTS上安装了cassandra 2.2.12。当我转到/ bin并运行./cassandr之后,我们遇到了一些错误。 Cassandra没有运行,我们是否需要在Cassandra.yaml文件中进行更改?
步骤如下:
#cd /tmp/
#sudo wget http://archive.apache.org/dist/cassandra/2.2.12/apache-
cassandra-
2.2.12-bin.tar.gz
#tar -xvf apache-cassandra-2.2.12-bin.tar.gz
#sudo rm -rf apache-cassandra-2.2.12-bin.tar.gz
#cd apache-cassandra-2.2.12/
#cd /bin/
#./cassandra
运行Cassandra之后,我得到了错误:
owner@STS-YYC-UBUNTU:/etc/apache-cassandra-2.2.12/bin$ ./cassandra
owner@STS-YYC-UBUNTU:/etc/apache-cassandra-2.2.12/bin$ CompilerOracle: inline org/apache/cassandra/db/AbstractNativeCell.compareTo (Lorg/apache/cassandra/db/composites/Composite;)I
CompilerOracle: inline org/apache/cassandra/db/composites/AbstractSimpleCellNameType.compareUnsigned (Lorg/apache/cassandra/db/composites/Composite;Lorg/apache/cassandra/db/composites/Composite;)I
CompilerOracle: inline org/apache/cassandra/io/util/Memory.checkBounds (JJ)V
CompilerOracle: inline org/apache/cassandra/io/util/SafeMemory.checkBounds (JJ)V
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.selectBoundary (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;II)I
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.strictnessOfLessThan (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare (Ljava/nio/ByteBuffer;[B)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare ([BLjava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/lang/Object;JI)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: Invalid yaml: file:/etc/apache-cassandra-2.2.12/conf/cassandra.yaml
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml: file:/etc/apache-cassandra-2.2.12/conf/cassandra.yaml
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:118)
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:85)
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:149)
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:507)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:642)
Caused by: Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=rpc_port for JavaBean=org.apache.cassandra.config.Config@5427c60c; For input string: "0.1.2.234"
in 'reader', line 10, column 1:
cluster_name: 'Test Cluster'
^
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:333)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141)
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481)
at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:475)
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:111)
... 5 more
Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create property=rpc_port for JavaBean=org.apache.cassandra.config.Config@5427c60c; For input string: "0.1.2.234"
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:299)
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331)
... 11 more
Caused by: java.lang.NumberFormatException: For input string: "0.1.2.234"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.math.BigInteger.<init>(BigInteger.java:479)
at org.yaml.snakeyaml.constructor.SafeConstructor.createNumber(SafeConstructor.java:228)
at org.yaml.snakeyaml.constructor.SafeConstructor.access$100(SafeConstructor.java:45)
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlInt.construct(SafeConstructor.java:211)
at org.yaml.snakeyaml.constructor.Constructor$ConstructScalar.constructStandardJavaInstance(Constructor.java:459)
at org.yaml.snakeyaml.constructor.Constructor$ConstructScalar.construct(Constructor.java:365)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:296)
... 13 more
ERROR 04:44:58 Exception encountered during startup
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml: file:/etc/apache-cassandra-2.2.12/conf/cassandra.yaml
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:118) ~[apache-cassandra-2.2.12.jar:2.2.12]
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:85) ~[apache-cassandra-2.2.12.jar:2.2.12]
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:149) ~[apache-cassandra-2.2.12.jar:2.2.12]
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133) ~[apache-cassandra-2.2.12.jar:2.2.12]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:507) [apache-cassandra-2.2.12.jar:2.2.12]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:642) [apache-cassandra-2.2.12.jar:2.2.12]
Caused by: org.yaml.snakeyaml.constructor.ConstructorException: null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=rpc_port for JavaBean=org.apache.cassandra.config.Config@5427c60c; For input string: "0.1.2.234"; in 'reader', line 10, column 1:
cluster_name: 'Test Cluster'
^
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:333) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:475) ~[snakeyaml-1.11.jar:na]
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:111) ~[apache-cassandra-2.2.12.jar:2.2.12]
... 5 common frames omitted
Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create property=rpc_port for JavaBean=org.apache.cassandra.config.Config@5427c60c; For input string: "0.1.2.234"
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:299) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:189) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331) ~[snakeyaml-1.11.jar:na]
... 11 common frames omitted
Caused by: java.lang.NumberFormatException: For input string: "0.1.2.234"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_181]
at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_181]
at java.math.BigInteger.<init>(BigInteger.java:479) ~[na:1.8.0_181]
at org.yaml.snakeyaml.constructor.SafeConstructor.createNumber(SafeConstructor.java:228) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.SafeConstructor.access$100(SafeConstructor.java:45) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlInt.construct(SafeConstructor.java:211) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.Constructor$ConstructScalar.constructStandardJavaInstance(Constructor.java:459) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.Constructor$ConstructScalar.construct(Constructor.java:365) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[snakeyaml-1.11.jar:na]
at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:296) ~[snakeyaml-1.11.jar:na]
... 13 common frames omitted
如果有人知道如何解决此错误,请提供帮助?
答案 0 :(得分:0)
您将rpc_port
设置为0.1.2.234
,无法将其转换为端口号,因此引发了NumberFormatException。