I am newbie to cassandra and needed help with starting cassandra server on Unix machine. I have a cassandra installation and while executing ./bin/cassandra -f I am getting the following error -
./bin/cassandra: test: unknown operator >
Another error is while executing cqlsh in the same directory.
cqlsh: syntax error at line 21: `print' unexpected
I have jdk 1.8 and python 2.4.4 in my environment. Also I tried using tcsh and bash both.
Kindly provide suggestions and appreciate for solutions.
There are definitely some tricks to getting Cassandra to run on certain brands of UNIX. It would also help to know which version of Cassandra you are trying to run.
First of all, you should definitely run it from Bash.
./bin/cassandra: test: unknown operator >
Next, this is happening because conf/cassandra-env.sh
is trying to check your Java version. Depending on which version of Cassandra you have, it's trying to do something like this:
if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" \> "1.6.0" ]
In Bash on Linux that works fine. But for some brands of UNIX that operator may not work the same way. Honestly, as long as you know your version of Java is good, you should be able to edit conf/cassandra-env.sh
and comment-out those checks.
cqlsh: syntax error at line 21: `print' unexpected
This error is happening because of this line:
python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
&& exec python "`python -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@"
It is probably due to the fact that the cqlsh wrapper script is failing to find an appropriate version of Python on your machine. I'm not aware of cqlsh being able to work with Python 2.4, so I'd try upgrading that to 2.7.
In short though, you'll have much better chances for success if you can get a flavor of Linux to run Cassandra on. Even if you get around these errors, my bet is that you'll get hit with a few more, so it'll probably be easier just to change to Linux now.