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.
Changing the TCSH to Bash and editing the cassandra scripts solved it.
The best reference for working on solaris -https://blogs.oracle.com/partnertech/entry/how_to_build_and_run
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.
Related
I'm trying to build JXcore on Windows 7 (64 bits).
In fact I have two identical virtual machines, but when i run vcbuild.bat it fails for one of them. I get the following error:
C:\jxcore\vcbuild.bat
File "configure", line 339
'''
^
SyntaxError: Missing parentheses in call to 'print'
Failed to create vc project files.
On the second machine I don't have this problem. As far as I remember, I've created them both identical. Where is the problem then?
Are those two VMs really equal? I can bet, that the one which fails, has Python 3.X installed, while the JXcore docs are stating about Python 2.6 or 2.7.
Nevertheless, we've just made an update, and the error that you've posted should not show up any more. Instead you should see something like this:
C:\jxcore>vcbuild.bat
You need Python 2.6 or 2.7 for the script to run. Currently installed version: 3.4.3
I hope that solves your problem. Thanks for using JXcore!
I need to programatically create a RethinkDB database from the command line. However...I have no clue how to do this.
I know that I can do this from the web UI or from a client driver, but isn't there a command that does this?
As mlucy mentioned, you can create databases and tables using the query language. If you'd like to run RethinkDB queries directly from the command line, you may want to try one of these libraries:
reql-cli: https://github.com/Workshape/reql-cli
recli: https://github.com/stiang/recli
If you have the Python driver you can do the following:
echo -e 'import rethinkdb as r; \nr.connect("localhost", 28015).repl() \nr.db_create("NAME_OF_YOUR_DATABASE").run()' | python
To install the Python driver, you can just use pip:
pip install rethinkdb
This might not be the best way of doing this, but it might be the easiest way of achieving this if you want to create a database in one line from the command line.
If you a Node.js developer, I would recommend using the two CLIS mglukhovsky mentioned.
As of RethinkDB 2.0 I believe you can only do this with the web UI or a client driver. Is there a reason why shelling out to Python or Ruby doesn't work here?
I'm new to both python, pythonbrew and ubuntu. I need python 2.6 and currently have 2.7 on my ubuntu precise system. Searching online revealed that I should not try to uninstall 2.7 as that would pretty much destroy the OS, but get pythonbrew instead, that manages multiple python installations.
I tried installing pythonbrew, but the curl install (curl -kL https://raw.githubusercontent.com/utahta/pythonbrew/master/pythonbrew-install | bash) did not work for me: it was not picking up my http proxy from env, and then not passing it to the install script, once I provided it on the command line. I downloaded the pythonbrew bits manually and then used python setup.py install to install it. I did it as root and it seemed to work (installing under /root/.pythonbrew, which was not the best), however I could not use it as a different user on the system (permission problems). After some more reading I executed the script correctly as root user and it installed pythonbrew to /usr/local/pythonbrew (yay).
Now, when I execute the following as root or non root user, it waits for a while and then the prompt comes back with no error or any other information (--verbose makes no difference):
root#xxx:~/.pythonbrew/scripts/pythonbrew# pythonbrew install 2.6
root#xxx:~/.pythonbrew/scripts/pythonbrew#
Any ideas? I'm guessing this has something to do with the proxy again, but I'm completely new to python so any pointers are welcome.
Following the "which pythonbrew" and doing some guessing the following solved my problem: I changed the curl.py file under /usr/local/pythonbrew/scripts/pythonbrew adding proxy setting to read, readheader and fetch functions as follows:
before modification:
p = Popen('curl -skL "%s"' % url, stdout=PIPE, shell=True)
after modification:
p = Popen('curl -x http://<proxy host>:<proxy port> -skL "%s"' % url, stdout=PIPE, shell=True)
I am not sure why there was no output without the proxy setting, but now the install works!
I also faced this issue today, while installing py2.7.14 with pythonbrew.
The reason it silently fails to install is when it gets the header from the python server (src of py2.7.14), it checks for a return status of success. It implements HTTP/1.1 method check (only) where successful return status is 200 OK.
However, python server uses HTTP/2 and the success return code is in the form 200, there's no trailing OK.
So, to fix it, I added 2 lines of code below following 2 lines in /opt/.pythonbrew/scripts/pythonbrew/curl.py, routine readheader().
if re.match('^HTTP.*? 200 OK$', line):
break
Added this code below above code:
elif re.match('^HTTP.*? 200$', line):
break
I did't want to change pythonbrew's code, hence added it with an elif.
This works.
I note that several other people using pyenv also mentions of similar issue, I am presuming similar issue may exist there.
I wrote this script https://gist.github.com/1313611 to ease my installs for rvm. The whole script simply installs rvm, installs 1.9.2, rails and creates a default gemset. All of that works and I can verify that inside the .rvm folder. However after installing a I get:
bash: ~/.rvm/scripts/rvm: line 14: syntax error near unexpected token `do'
bash: ~/.rvm/scripts/rvm: line 14: ` do'
I've also tried using curl -sB. I'm guessing it has to do with my environment but can't seem to figure out the problem (obviously, ha).
Thanks for any input
CLARIFICATION: I'm on an Fedora 14 Desktop - I have it working with no edits to my script on a shared hosting account at Dreamhost.
Not sure it helps (planning to dig into a bit more) but the computer it fails on is managed by the school which means the Home dir I install to is on NFS. Another environment oddity is that the default shell (ypchsh won't let me change yet [working with boss to change]) is tcsh, but I always run bash when I open a terminal. I'm thinking this last bit is a problem.
BLAST - Apparently there was a script being loaded that is basically a universal bashrc for our school where someone set and alias to 'for' because it had something to do with fortran.
So I just copied that rc to my directory to fix up that alias and now reference that file rather than the universal rc.
Well we learned something today - when in this much doubt check all aliases.
I am trying to build GNU Radio. But I am getting the following error when I am trying to run make.
I followed the steps mentioned in README.building-boost
$ export LD_LIBRARY_PATH=$BOOST_PREFIX/lib
$ cd <path-to-top-of-gnuradio-tree>
$ ./bootstrap
$ ./configure --with-boost=$BOOST_PREFIX # plus whatever config args you usually use
But when I run make, I get this error :
/usr/local/lib/libgruel-3.4.1git.so.0: undefined reference to `boost::thread::start_thread()'
I wrote a simple program using Boost Thread and was able to compile and run it.
Any idea how to fix the build issue?
I know this is an old question, but if you use Ubuntu, then use this script:
www.sbrac.org/files/build-gnuradio
it works really good, you may have to run it 2 times to get everything working, but it saves a lot of time fixing the problems of dependency like the one you were dealing with.