Search code examples
cassandraportshutdown

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.


Solution

  • 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