-
Star
(221)
You must be signed in to star a gist -
Fork
(61)
You must be signed in to fork a gist
-
-
Save hkhamm/a9a2b45dd749e5d3b3ae to your computer and use it in GitHub Desktop.
| Installing Cassandra on Mac OS X | |
| ================================ | |
| Install Homebrew | |
| ---------------- | |
| Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy: | |
| ``` | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| ``` | |
| Install Python | |
| -------------- | |
| Mac OS X has a copy of Python preinstalled, but this makes sure you get the newest version. | |
| ``` | |
| brew install python | |
| ``` | |
| Install cql | |
| ----------- | |
| To use cqlsh, the Cassandra query language shell, you need to install cql: | |
| ``` | |
| pip install cql | |
| ``` | |
| Install Cassandra | |
| ----------------- | |
| This installs Apache Cassandra: | |
| ``` | |
| brew install cassandra | |
| ``` | |
| Starting/Stopping Cassandra | |
| ------------------ | |
| Use this command to start: | |
| ``` | |
| launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist | |
| ``` | |
| user this command to stop: | |
| ``` | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist | |
| ``` | |
| On Mavericks, Homebrew failed to move the plist file into LaunchAgents. Which gives this error message: | |
| ``` | |
| launchctl: Couldn't stat("/Users/MNCH/Library/LaunchAgents/homebrew.mxcl.cassandra.plist"): No such file or directory | |
| ``` | |
| To fix this just issue the following command. Then, try using the ```launchctl load``` command again: | |
| ``` | |
| cp /usr/local/Cellar/cassandra/homebrew.mxcl.cassandra.plist ~/Library/LaunchAgents/ | |
| ``` | |
| Cassandra file locations | |
| ------------------------ | |
| Properties: /usr/local/etc/cassandra | |
| Logs: /usr/local/var/log/cassandra | |
| Data: /usr/local/var/lib/cassandra/data | |
| Have fun with Cassandra! |
Thank you
Thanks a lot.
Thanks alot
start / stop service with brew services is easy
brew services {start|stop} cassandra
This really helps, thank you!
As undefined_variable commented, Java 8, instead of 9, worked just fine. Thanks everyone for trying to help.
I wasted my time with this issue...
On a Mac you may have problems with cql requiring the python library 'six', which has a protected installation on the Mac since ~2015 up to at least High Sierra.
The problem and it's work-around over the years is all documented here:
pypa/pip#3165
For cql, use this:
sudo pip install cql --upgrade --ignore-installed six
I am trying to install Stratio plugin and in the guiding here they say:
Copy the generated JAR to the lib folder of your compatible Cassandra installation: cp plugin/target/cassandra-lucene-index-plugin-*.jar <CASSANDRA_HOME>/lib/
my question is where is CASSANDRA_HOME because i couldn't find any directory including cassandra and has lib as subdirectory?
Thanks alot, this was very helpful
Hi everyone,
I got error when I connect run
cqlsh
it shows
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
What should I do to make this work
System macOS 10.14.5
Hello Everyone,
Even I am facing the same issue as mentioned by jamesaq12wsx.
Please help!
Hi everyone,
I got error when I connect run
cqlsh
it shows
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
What should I do to make this workSystem macOS 10.14.5
I'm having the same problem and there's no solution for it available over the internet!
Any help would be appreciated.
Hello jamesaq12wsx, thasleembasha and BamdadNouri, I'm running Mohave 10.14.5 and I installed Cassandra 3.11.4 and I was facing the exact same issue that you were. Whenever I tried to run the cqlsh command I would get back the same error than you. So I tried running the command cassandra first and then I would get back: Cassandra 3.0 and later require Java 8u40 or later.
After doing my research I found that my JDK version was 6.1,(you can run the command $ ls /Library/Java/JavaVirtualMachines/) in my case was 1.6, so I went to
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and downloaded/installed the JDK 8.2.11 (I choose this version cause, when i check on System Preferences/JAVA/Update tab, my JRE version is the same 8.2.11).
So after I did that, then I went to the terminal, and initiated cqlsh and everything worked as expected, I really hope this helps.
Thanks,
Hello jamesaq12wsx, thasleembasha and BamdadNouri, I was facing the exact same problem for much of today. I am running Mojave 10.14.5 as well with JDK 1.8. The problem went away after I ran the command cassandra. I have no idea what it did but it solved my problem.
Thanks a lot!
Hello jamesaq12wsx, thasleembasha and BamdadNouri, I'm running Mohave 10.14.5 and I installed Cassandra 3.11.4 and I was facing the exact same issue that you were. Whenever I tried to run the cqlsh command I would get back the same error than you. So I tried running the command cassandra first and then I would get back: Cassandra 3.0 and later require Java 8u40 or later.
After doing my research I found that my JDK version was 6.1,(you can run the command $ ls /Library/Java/JavaVirtualMachines/) in my case was 1.6, so I went to
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and downloaded/installed the JDK 8.2.11 (I choose this version cause, when i check on System Preferences/JAVA/Update tab, my JRE version is the same 8.2.11).So after I did that, then I went to the terminal, and initiated cqlsh and everything worked as expected, I really hope this helps.
Thanks,
I got the same issue with java 11. Then changed java version to 1.8 and ran the cassandra f. then the cqlsh word as normal.
cqlsh Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. cqlsh>
it seems like again there is an issue with java 11 here.
Hello jamesaq12wsx, thasleembasha and BamdadNouri, I was facing the exact same problem for much of today. I am running Mojave 10.14.5 as well with JDK 1.8. The problem went away after I ran the command
cassandra. I have no idea what it did but it solved my problem.
LMAO this is hilarious. Also this worked for me. Might also try running
cassandra -f
thank you :)
thank you :)
^^
Thank you :)
I'm on mojave, and instead of running pip install cql, I had to use pip3 install cql.
that is because you have python 3 and not python 2. mac os version doesn't matter
It seems like the URL in Install Homebrew section is 404 not found. And I found a new one that works:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Hope it's helpful.
I am still facing the same issue on running cqlsh. Using Catalina OS - 10.15.7
So, what i have:
This is not working (there is infinite loop in logs):
brew services start cassandra
But this is working:
JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_275` cassandra -f
And i wondering how to update /usr/local/Cellar/cassandra/3.11.9_1/homebrew.mxcl.cassandra.plist properly?
I tried this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.cassandra</string>
<key>ProgramArguments</key>
<array>
<string>JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_275`</string>
<string>/usr/local/opt/cassandra/bin/cassandra</string>
<string>-f</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var/lib/cassandra</string>
</dict>
</plist>and this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.cassandra</string>
<key>ProgramArguments</key>
<array>
<string>JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home</string>
<string>/usr/local/opt/cassandra/bin/cassandra</string>
<string>-f</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var/lib/cassandra</string>
</dict>
</plist>without any success
UPD: the final variant
/usr/local/Cellar/cassandra/3.11.9_1/homebrew.mxcl.cassandra.sh (don't forget chmod +x):
#!/bin/sh
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
/usr/local/bin/cassandra -f/usr/local/Cellar/cassandra/3.11.9_1/homebrew.mxcl.cassandra.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.cassandra</string>
<key>Program</key>
<string>/usr/local/Cellar/cassandra/3.11.9_1/homebrew.mxcl.cassandra.sh</string>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var/lib/cassandra</string>
</dict>
</plist>@a0s 🙇
@a0s literally a savior, thanks!
I am trying to install Stratio plugin and in the guiding here they say:
Copy the generated JAR to the lib folder of your compatible Cassandra installation: cp plugin/target/cassandra-lucene-index-plugin-*.jar <CASSANDRA_HOME>/lib/
my question is where is CASSANDRA_HOME because i couldn't find any directory including cassandra and has lib as subdirectory?
@ramialbatal you manage to solve this issue?
pip install cql has been deprecated. cqlsh now comes with brew install cassandra.
Thanks a lot.