Start Cassandra on Mac

Viewed 629

I was working with Apache Cassandra on Windows and for starting it I was using a cassandra.bat file.

Now, I have to configure it on a MacBook (M1 chip, Big Sur OS). Is there an equivalent file/command?

2 Answers

I'm going to assume that you're using the binary tarball for your installation.

Starting Cassandra on a Mac is the same as it is on Linux. Use the following script:

$ cd path/to/tarball_installation
$ bin/cassandra

The logs/ and the data/ directories should all be located in the same location. Cheers!

Another way to do this (which will nicely abstract away your hardware/chipset) would be to use Docker. In fact, once you have Docker installed you can get and run the community Docker image in two quick commands:

docker pull cassandra:4.0
docker run --name my-cassandra -d -p 9042:9042 cassandra:4.0

Note: if you need to run on Cassandra 3, you can simply change the 4.0 tags in the above commands to 3.11.

Once it's up and running, you can verify it by invoking nodetool status inside the container:

docker exec -it my-cassandra nodetool status

FWIW, the same steps/commands will work on Windows, too.

Related