AKIWEB
AKIWEB

Reputation: 19632

Shutdown Cassandra server and then restart it in windows 7

I installed single node cluster in my local dev box which is running Windows 7 and it was working fine. Due to some reason, I need to restart my desktop and then after that whenever I am doing like this on the command prompt, it always gives me the below exception-

S:\Apache Cassandra\apache-cassandra-1.2.3\bin>cassandra -f
Starting Cassandra Server
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 7199; nested exception is:
        java.net.BindException: Address already in use: JVM_Bind

Meaning port being used somewhere. I have made some changes in cassandra.yaml file so I need to shutdown the Cassandra server and then restart it again.

Can anybody help me with this?

Thanks for the help.

Upvotes: 3

Views: 8810

Answers (3)

Akshay Raut
Akshay Raut

Reputation: 565

If your are using Cassandra bundled with DataStax Community Edition and running as a service on startup of your machine then you can execute following commands to start and stop Cassandra server.

Start command prompt with admin rights

run following commands

      net start DataStax_Cassandra_Community_Server

      net stop DataStax_Cassandra_Community_Server

Upvotes: 3

kuntala sinha
kuntala sinha

Reputation: 71

in windows7, with apache cassandra, a pid.txt file gets created at the root folder of cassandra. Give following instruction to stop the server:

d:/cassandra/bin> stop-server -p ../pid.txt -f

Upvotes: 7

Lyuben Todorov
Lyuben Todorov

Reputation: 14173

Running -f starts the server as a service, you can stop it through the task manager.

It sounds like your Cassandra server starts on it's own as a service in the background when your machine boots. You can configure windows startup services. To run cassandra in the foreground on windows simply use:

> cassandra.bat

Upvotes: 3

Related Questions