我在所有这些节点上使用了三个节点的集群我已经将Java从1.7
升级到1.8
,之后我无法在其中任何一个上启动cassandra。
抛出以下错误
此外,当我清除其中一个节点上的数据并尝试启动它时。我认为这是一些java问题。对此有什么解决方案吗?
INFO 10:10:59 Initializing cw.usedcareventsbyprofileidnew
INFO 10:10:59 Opening /usr/local/hadoop/cassandra2112/data/data/cw/usedcareventsbyprofileidnew-5edbdef0ad4311e5856d07fc426478ef/cw-usedcareventsbyprofileidnew-ka-25 (174 bytes)
ERROR 10:10:59 Exception encountered during startup java.lang.NullPointerException: null at java.util.HashMap.<init>(HashMap.java:294)
~[na:1.7.0_95] at org.apache.cassandra.db.index.composites.CompositesIndex.validateOptions(CompositesIndex.java:156)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.index.SecondaryIndex.createInstance(SecondaryIndex.java:364)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.index.SecondaryIndexManager.addIndexedColumn(SecondaryIndexManager.java:283)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:386)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:523)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:494)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:335)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:275)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.Keyspace.open(Keyspace.java:121)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.db.Keyspace.open(Keyspace.java:98)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:328)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:562)
~[apache-cassandra-2.1.12.jar:2.1.12] at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:651)
~[apache-cassandra-2.1.12.jar:2.1.12] java.lang.NullPointerException at java.util.HashMap.<init>(HashMap.java:294)
at org.apache.cassandra.db.index.composites.CompositesIndex.validateOptions(CompositesIndex.java:156)
at org.apache.cassandra.db.index.SecondaryIndex.createInstance(SecondaryIndex.java:364)
at org.apache.cassandra.db.index.SecondaryIndexManager.addIndexedColumn(SecondaryIndexManager.java:283)
at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:386)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:523)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:494)
at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:335)
at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:275)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:121)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:98)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:328)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:562)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:651)
Exception encountered during startup: null
答案 0 :(得分:0)
如果indexOptions为null,则将其设置为 Collections.emptyMap()
public void validateOptions() throws ConfigurationException {
ColumnDefinition columnDef = columnDefs.iterator().next();
Map<String, String> indexOptions = columnDef.getIndexOptions();
if (indexOptions == null) {
indexOptions = Collections.emptyMap();
}
Map<String, String> options = new HashMap<>(indexOptions);
// We used to have an option called "prefix_size" so skip it silently for backward compatibility sake.
options.remove("prefix_size");
if (columnDef.type.isCollection())
{
options.remove(SecondaryIndex.INDEX_VALUES_OPTION_NAME);
options.remove(SecondaryIndex.INDEX_KEYS_OPTION_NAME);
}
if (!options.isEmpty())
throw new ConfigurationException("Unknown options provided for COMPOSITES index: " + options.keySet());
}