Microsoft SQL Server Certification Course
- 5k Enrolled Learners
- Weekend
- Live Class
Before we start the CQLSH make sure that the Cassandra server installed on windows is running. If it is running fine, you will find the below image.
To start cqlsh we need to have python installed on your machine.
Please download the Python installer according to system configuration.
Below is my system configuration.
How to open CQLSH of Cassandra installed on Windows
Please use the below link if your system is 32-bit version.
https://drive.google.com/file/d/0Bw3sqswQlMb4WFJndXBKNDVzSGs/edit?usp=sharing
Please use the below link if your system is 64-bit version.
https://drive.google.com/file/d/0Bw3sqswQlMb4Y2x3ak1VQXFqQkE/edit?usp=sharing
As my system is 64-bit, I have downloaded the 64-bit version of Python.
After downloading it, double click on it and click on Run.
How to open CQLSH of Cassandra installed on Windows
Click on Next
How to open CQLSH of Cassandra installed on Windows
When it asks for destination folder, let it take the default folder and click on Next.
Click next
How to open CQLSH of Cassandra installed on Windows
Let it install
How to open CQLSH of Cassandra installed on Windows
You will get the below image and finally click on Finish
How to open CQLSH of Cassandra installed on Windows
We have successfully installed Python on Windows.
Now Let us set the path for Python.
Right click on My Computer and go to Properties.
How to open CQLSH of Cassandra installed on Windows
Under System variables select the Variable Path and Click on Edit
How to open CQLSH of Cassandra installed on Windows
Append “;C:Python27” to the value of path as in the below image and click on ok.
How to open CQLSH of Cassandra installed on Windows
Now download the Python Thrift module from the below link.
https://drive.google.com/file/d/0Bw3sqswQlMb4UHpNSHJtMVdEY1U/edit?usp=sharing
After downloading it, extract it to C Drive.
If it is extracted, you will find it in C: as in the below image.
How to open CQLSH of Cassandra installed on Windows
Now open the command prompt and give the below commands.
• cd C: hrift-0.9.1
python setup.py install
You will get the below image.
How to open CQLSH of Cassandra installed on Windows
Now give the below commands to start the cqlsh
• cd c:cassandrain
python cqlsh localhost 9160
We have successfully started the cqlsh of Cassandra installed on windows.
To check if it is working fine, give the command help and check.
How to open CQLSH of Cassandra installed on Windows
If you receive the above output, then we have started the cqlsh successfully.
Congratulations! You have successfully started the CQLSH….!!
If you wish to learn more about SQL, then check out our SQL Certification.
edureka.co
Hi I got following error as
C:Program FilesDataStax Communityapache-cassandrabin>python cqlsh localhost 9042
File “cqlsh”, line 19
python “`dirname “$0″`/cqlsh.py” “$@”
^
SyntaxError: invalid syntax
Hey Prem, it depends on which version of Python you are using.
You can try changing the line:
python “dirname “$0″/cqlsh.py” “$@”
to
python2 “dirname “$0″/cqlsh.py” “$@”
We hope this solves your issues. Cheers :)
I’m trying to run :
py cqlsh localhos 9160
Would you help me ?
Thank you
https://uploads.disquscdn.com/images/84a673dac2d74ab67f6fc9932e29c2250b71f29949d28708b4ae320912866ae5.png
links to google drives are not working .. please let me know if you have any other paths to install python .
Hi , Can you please help me to understand where i am missing something , I am not able to understand complete cassandra on windows 7 machine .
https://uploads.disquscdn.com/images/80c6097b95be630038efa03ed024a49a3eb80ad16352e77db968de01dc80de81.png
When I’m trying to run the command python cqlsh localhost 9160, then I’m getting the below error ”
Connection error: (‘Unable to connect to any servers’, {‘127.0.0.1’: error(10061, “Tried connecting to [(‘127.0.0.1’, 9160)]. Last error: xcfxeexe4xeaxebxfexf7xe5xedxe8xe5 xedxe5 xf3xf1xf2xe0xedxeexe2xebxe5xedxee,”)})”
Please help me out with the same.
Thanks
Yulia
Hey Yulia, thanks for checking out our blog. With regard to the error you’re facing, you need to edit cassandra.yaml on the node you are trying to connect to and set the node ip address for rpc_address and listen_address and restart Cassandra.
rpc_address is the address on which Cassandra listens to the client calls.
Hope this helps. Cheers!
do we need to install java and python in the Windows of VM instance
Hey Divya, thanks for checking out our blog. Java and python are compulsory to be installed in windows instance. Could you please elaborate on the query so we can answer your query better? Cheers!
Recently I have downloaded latest cassandra version(3.0.10) and followed your instruction but I am getting error when trying to open cqlsh
File “cqlsh” line 20 python-c’ import sys; sys.exist(not (0x020700b0<sys hexversion/dev/null
^
syntaxError: invalid sysntax
https://uploads.disquscdn.com/images/414e6023108f4b8b33ce6c29c409157a6e8909c7dcb9addcdeac369c434842f7.jpg
Can you please help?
Hey Kamlesh, thanks for checking out our blog. You’re facing the error because the Java path is not set correctly. Please install the latest version: JRE 7, set JAVA_HOME to point to it, and restart the computer. Please refer to this blog for more information: https://www.edureka.co/blog/how-to-open-cqlsh-of-cassandra-installed-on-windows/. Hope this helps. Cheers!
https://uploads.disquscdn.com/images/7b062df9aa9a1d4693a7cf1d99eb03f31afd414b350fc63cb2c3b13e8b3d751a.png I also got the same error but i cannot resolve using your solution.I set the java path correctly and also installed latest version of java.Yet it is showing SyntaxError. Please help me out in resolving this issue.
Hey Sravya, thanks for checking out our blog. Try running ./cqlsh in the CASSANDRA_HOME/bin directory directly from command line.
Try prefixing the command with “.”, ./ only works on Unix-like Operating Systems.
Hope this helps. Cheers!
please use the following command
cqlsh localhost 9160
It will work
When I am trying to run the command python setup.py install under (C:thrift-0.9.1), then I am getting the below error-
“python: cant open file ‘setup.py’: [Errno 2] No such file or directory.”
Please help me out with the same.
Thanks
Vipul Jain
Hey Vipul, thanks for checking out the blog. You may be getting the error because you are running the command from the wrong path:
Here we have to go into the directory that you are going to “setup”.
For example, if you are installing numpy, and you have git-cloned it, then it probably is located at ~/numpy.
So first cd into ~/numpy, and the type the commend like “python setup.py build” there.
Hope this helps. Cheers!
Hi, Thanks for your reply.
You mean I have to go into the directory in which the setup file – “python-2.7.3.amd64.msi”
is present on the computer?
Thanks!
Hey Vipul, yes you’re correct. You have installed this Python so it will be the location. Cheers!
Hi,
https://uploads.disquscdn.com/images/80c6097b95be630038efa03ed024a49a3eb80ad16352e77db968de01dc80de81.png I am facing this problem can you help me in that?
where is this cassandrabin folder?
how to get it?
Hey Shamika, thanks for checking out the blog. By default the location will be: /usr/bin
Hope this helps. Cheers!
Thank you for the great explanation. there is bit confusion on the folder to maintain. Is that to have three folders separately for python, cassandrabin and thrift-0.9.1 on Drive “c”?
Yes Prasanth!! We need to maintain these 3 different folders in C Drive.