Nicolas Charles
Nicolas Charles

Reputation: 33

Error while trying to cleanup Cassandra node

I am facing issue while launching cleanup command with nodetool.

Cleanup did work fine until now. I did'nt find any modification on my configuration. I have no clue on what could have change.

nodetool > cleanup
error: Expecting URI in variable: [cassandra.config]. Found[cassandra.yaml]. Please prefix the file with [file:///] for local files and [file://<server>/] for remote files. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
-- StackTrace --
org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Found[cassandra.yaml]. Please prefix the file with [file:///] for local files and [file://<server>/] for remote files. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
        at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:80)
        at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100)
        at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:262)
        at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:180)
        at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:151)
        at org.apache.cassandra.tools.NodeProbe.checkJobs(NodeProbe.java:281)
        at org.apache.cassandra.tools.NodeProbe.forceKeyspaceCleanup(NodeProbe.java:288)
        at org.apache.cassandra.tools.nodetool.Cleanup.execute(Cleanup.java:55)
        at org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:255)
        at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:169)

Any idea ?

Regards,

Nicolas

Upvotes: 1

Views: 276

Answers (2)

Nicolas Charles
Nicolas Charles

Reputation: 33

I did find a solution that works for me (but i think it's specific to my prod environment).

Somewhere, something should have used /etc/alternative/cassandra symlink, which was heading to my empty default cassandra configuration. After i correct it :

[root@myhost ~]# ll /etc/alternatives/
total 116
lrwxrwxrwx 1 root root 30 Oct  2 12:40 cassandra -> /etc/cassandra/my-cassandra-instance

That done, i was able to cleanup my cassandra clusters.

Didn't find time to work this case much more.

Anyway thanks for the clues, it was a context issue.

Nicolas

Upvotes: 1

Chris Lohfink
Chris Lohfink

Reputation: 16400

Nodetool uses cassandra.yaml to to find the number of concurrent compactors. Since you have cassandra.config set its using that cassandra.yaml, but the cassandra.config has an invalid value so the nodetool is choking on it.

Upvotes: 1

Related Questions