Datastax dse graph installation - cassandra

I am experimenting with Datastax Dse 5.0.5 graph on ubuntu machine.
I am mostly interested in graph part of Datastax enterprise package.
I have executed these below commands on different terminals
./bin/dse cannandra
./bin/dse gremlin-console
./datastax-studio/bin/server.sh
I am successfully able to start datastax-studio at localhost but with this error
All DSE gremlin server hosts are currently down or don't have the 'graph' workload set. Please, make sure that hosts are available and have the 'graph' workload and retry
What I want to do is?
I want to create vertex and edges using a java program and want to visualize it on datastax-studio.
For that I have written java program following dse docs but I am confused at which port I should connect my to database and even I am not sure about is I am really going on a right path.
Could you please guide me for installation dse graph and studio in a proper way?

./bin/dse cassandra will start just the Cassandra workload.
Since it appears you are using a tarball install
./bin/dse cassandra -g will start DSE in Graph mode
You can also do:
./bin/dse cassandra -s -g to enable search functionality for fuzzy/text/geospatial searching within Graph or Cassandra
./bin/dse cassandra -k -g to enable Spark to run OLAP style traversals and Spark analytics on Cassandra data
./bin/dse cassandra -s -k -g to enable all workload types for ease of experimentation.
For more info see:
https://docs.datastax.com/en/datastax_enterprise/5.0/datastax_enterprise/admin/startDseStandalone.html

Go to Below Link (if you have installed DSE without service ) : -
/usr/share/dse/resources/graph/gremlin-console/conf
Or go to path where your remote.yaml file is kept .
then check/configure the settings : -
hosts: [127.0.0.1]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
config: { serializeResultToString: true, ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry] }}
connectionPool: {
maxContentLength: 65536000
}
Check your host and port . Then stop and restart dse .

Related

unable to start cassandra on windows 10

I am new to this field and was trying to use cassandra (Datastax). I inatlled JDK and cassandra as per the instruction given on their site.
but while I am trying to run CQL shell I am getting below error. I searched to find a solution but couldnt find one.
did re-install the cassandra but didnt help. can you sggest any solution ?
C:\Program Files\DataStax-DDC\apache-cassandra\bin>cqlsh 127.0.0.1 9042
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(10061, "Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it")})
When installed, DataStax Cassandra adds a service for running the Cassandra Server. However, the service may not run at startup and may refuse to run.
Try the following command:
net start DataStax_DDC_Server
if you see a message like this:
The DataStax DDC Server 3.8.0 service could not be started.
Then you are having this problem.
If you are using Community Edition (like me), support has been discontinued so I would not expect a fix in the future.
Meanwhile, a manual workaround is available.
Firstly, append C:\Program Files\DataStax-DDC\apache-cassandra\bin to your PATH variable in your environment, to make life easier.
Now open two CLIs (or Powershell windows).
In the first, run the command:
cassandra -f
Watch the output. Look for a line such as:
INFO nn:nn:nn Starting listening for CQL clients on /<ip address>:<port>
The server is now listening for connections.
Leave the first CLI running, and switch to the second. Run the command:
cqlsh <ip address> <port>
And hopefully it should work.
Addendum: You cannot tab-complete in Windows 10 Datastax Cassandra by default. To fix this, the pyreadline python modules need to be copied into the DataStax-DDC\python\Lib\site-packages folder (copied, not installed. The DataStax python distribution has no ability to install modules).
For 64bit v3.0.9 (I installed through the .msi found here
If you didn't leave "Automatically start DataStax Cassandra Community Service" checked when installing you'll want to reinstall and leave it checked.
Goto C:\Program Files\DataStax Community and rename the file cassandra.ymal.orig to cassandra.yaml and leave it in the folder it's already in and then start Cassandra CQL Shell.
Note: I don't know if it's needed but I backed up my cassandra.ymal.orig before doing this.
Also, if anyone could shed light on what the command for windows would be to start Cassandra that would be awesome. It seems at least in part this issue is the service just won't start

Connecting to Cassandra Instance Remotely using Linux Shell Script

I want to connect to Cassandra installed in a remote server from my dev environment. Dev Environment doesn't have cassandra installed and hence it is not allowing me to do the below for connecting to my cassandra server running on a different machine.
Client System - Dev System without Cassandra
Destination System - Prod Environment where Cassandra is installed
I am trying the below command over my dev terminal to connect to Prod Cassandra.
/opt/cassandra/dse-4.8.7/bin/cqlsh -e "select * from
/"IasService/"./"Table/" limit 10"
remote.stress.py1.s.com 9160 -u test-p test2;
Any leads would be helpful.
tldr;
Remove the 9160 from your command.
It would be easier to help you if you provided the error message or result of your command.
That being said, DSE 4.8.7 has Cassandra 2.1.14 at its core. As of Cassandra 2.1, cqlsh connects using the native binary protocol on port 9042. So forcing it to 9160 (as you are) will definitely not work.
$ cqlsh -e "SELECT release_version FROM system.local" 192.168.6.5 9042
-u cassdba -p superSecret
release_version
-----------------
2.1.13
(1 rows)
And since 9042 is the default port used by cqlsh now, you don't need to specify it at all.

Cannot start Cassandra - Snitch's Datacenter Differs from Previous

Im trying to start DSE 5.0.1 Cassandra (Single node) in my local.
Getting below error:
CassandraDaemon.java:698 - Cannot start node if snitch's data center
(Cassandra) differs from previous data center (Graph). Please fix the
snitch configuration, decommission and rebootstrap this node or use
the flag -Dcassandra.ignore_dc=true
If you are using GossipingPropertyFileSnitch, start Cassandra with the option
-Dcassandra.ignore_dc=true
If it starts successfully, execute:
nodetool repair
nodetool cleanup
Afterwards, Cassandra should be able to start normally without the ignore option.
This occurs when the node starts and see's that it has information indicating that it was previously part of a different datacenter. This occurs if the datacenter was different on a prior boot and was then changed.
In your case you are most likely using DseSimpleSnitch which names the Datacenter based on the workload of that node. Previously the node was started with Graph enabled which turned the name to Graph. Now trying to start it without Graph enabled leads to it naming the Datacenter Cassandra which is the default.
Using the -Dcassandra.ignore_dc=true flag will allow you to proceed but a better solution would be to switch to GossipingPropertyFileSnitch and give this machine a dedicated datacenter name.
Another option (if you are just testing) is to wipe out the data directory as this will clear out the information previously labeling the datacenter for the node. This will most likely be sudo rm -R /var/lib/cassandra/
This issue will happen when you change Datacenter name in this below respective file /etc/dse/cassandra/cassandra-rackdc.properties
To resolve please follow the below 3 steps
Clear the below-mentioned directories(Note:- if have data please take a backup with cp command )
cd /var/lib/cassandra/commitlog
sudo rm -rf *
cd /var/lib/cassandra/data
sudo rm -rf *
now start the dse service with the below command
service dse start
command to check the list node's status
nodetool -h ::FFFF:127.0.0.1 status

Cassandra cqlsh Unable to connect to any servers - 127.0.0.1:9160 (closed)> is already closed

I installed Cassandra on OSX.
When trying to run cqlsh from /bin/, I get the following error:
> Connection error: ('Unable to connect to any servers', {'127.0.0.1':
> ConnectionShutdown('Connection <AsyncoreConnection(4522252560)
> 127.0.0.1:9160 (closed)> is already closed',)})
I had difficulty installing Cassandra, and had used brew install cassandra, installed DSE from datastax, and downloaded a binary from Apache.
I think the issue was the result of having a previous installation that wasn't properly uninstalled. My user .cassandra directory had some default configs, that must have been for a different version, and prevented cqlsh from starting.
rm -Rf ~/.cassandra
After that, I could run cqlsh properly.
$ bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>
Running cassandra helped me to troubleshot the problem:
> cassandra
Cassandra 3.0 and later require Java 8u40 or later.
and:
> java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-3)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
After installing Java 8 it worked.
Cassandra-2.1 uses 9042 as cqlsh port.Connect on this it is default port.If you want to connect on 9160 port then change it by setting environment variable CQLSH_PORT and CQLSH_HOST but for setting this you have to change rpc_port from default 9160 to any other port.
Well, I faced same issue and this is what i did on Mac.
$cd /usr/local/Cellar/cassandra/3.10_1/bin/
Or wherever your cassandra is installed.
$cassandra
this initializes all configuration in your local system to start cassandra.
$./cqlsh
This lets you enter cql query mode.
I resolved this in DSE-5.0 by editing below file:
vi ~/.cassandra/cqlshrc
And editing below configs to current IP address (192.168.1.6) of the machine I am running. In my case it's my MacBook.
[connection]
hostname = 192.168.1.6
port = 9042
; factory = cqlshlib.kerberos_ssl.kerberos_ssl_transport_factory
; [kerberos]
; hostname = 192.168.1.6
; service = cassandra
; optional
; principal = bill/cassandra-admin#foo.example.com
I hope it will help someone.
Thanks,
Chandan
I faced this issue when I was trying to connect to Cassandra 2.0.1 version using cqlsh 5.0.1
[cqlsh 4.1.1 | Cassandra 2.0.11.83 | CQL spec 3.1.1 | ]
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 ]
This is just one of the reasons for the error "Connection error: ('Unable to connect to any servers',".
When I used the cqlsh client compatible with Cassandra 2.0.1, I was able to connect to the cluster.
Hope this helps to find the root cause.
I got the same error after moving from Java 8 to Java 11. From https://github.com/nosan/embedded-cassandra/issues/21, Apache Cassandra does not yet have support for java 11.
Reverting to the system's current java version to Java 8 solved the problem.
Just add/modify the following into the cassandra.yaml:
rpc_address: 127.0.0.1
seeds: "127.0.0.1"
listen_address: 127.0.0.1
Note that, the values in all these fields must be same.
That means, if you are pointing to a static IP, then the same IP should be used. And if you are just pointing the localhost, then localhost must be used in all fields.
I got myself into a mess so here was my scenario if anyone else runs into it:
I followed this tutorial
http://www.datastax.com/2012/01/working-with-apache-cassandra-on-mac-os-x
(which is somewhat outdated).
I got everything installed and working - all good. Then I decided to download Datastax Enterprise tools to try them out
Ran into errors during the install but the install went through. Again following the tutorial above, tried running the ./datastax-agent program and it failed. Decided to just bag it so ran their uninstaller in their installation folder.
Tried to go back to original cassandra folder (what I had working in step 2) and run "sudo ./cassandra" then I started getting JMX error (message "Unable to bind JMX, is Cassandra already running?") which led me to this link about changing the port which i did (not really fixing the issue but working around it) run two cassandra versions in the same machine.
Got the server service running underneath a new port but when trying to connect with the client "sudo ./cqlsh" would not work (would get "Error=none" or destination not found).
Did the remove step #Peter mentioned above and tried again and still did not work.
Decided to go back and see what was holding onto the original port cassandra was using which I changed in step 4 Who is listening on a given TCP port on Mac OS X?
Determined that JAVA.app was hanging onto it so killed it within Activity Monitor.
Reran the remove command #Peter mentioned above again and decided to download the stable release (v2.0.13) instead of the dev release and walk through the tutorial from step 1 again.
Exited and re-opened terminal. Ran "sudo ./cassandra" - worked perfect running under standard ports. Open another terminal window and ran "sudo ./cqlsh" and this also worked correctly.
I believe between Java hanging onto the default port 9042 (maybe from the DataStax install errors), version/host/port settings within ~/.cassandra/cqlshrc and using the dev version of cassandra these were all causing me fits.
I was having trouble connecting Cassandra from the terminal
[
and then I tried to connect using /usr/local/Cellar/
[
and then invoke cassandra. Then opened a new terminal and typed cqlsh the Cassandra started.
Hope this may also applicable one to resolve Cassandra issue.
install java jdk and Set JAVA_HOME in Environment Variables or set JAVA_HOME = java path in command prompt.
after
run cassandra.bat
it will show the logs if you get any error
You need to start Cassandra form the install_location's bin directory.
For example, this command will start Cassandra in the foreground:
$ ./cassandra -f
Then open another terminal tab (command + t) and run cqlsh
$ ./cqlsh
Ensure that DEFAULT_HOST = '127.0.0.1' in script cqlsh.py is pointing to the node IP where you have done your cassandra installation.
In my case I had installed cassandra on 10.160.1.5, edited above file and it started working.
Running cqlsh gets this error for me but running bin/cqlsh from the cassandra directory works.
I faced the same issue. I ran cassandra.bat --> This appears to have started the server. Then I opened a new command prompt (run as an administrator), changed directory to the cassandra/bin location. When I ran the command cqlsh, voila it worked!
I solve this issue by just simply restarting cassandra sudo systemctl restart cassandra
In case of MacOSX, it worked to just run
cassandra
rather than running it through brew services start cassandra.
I was having the same problem with Cassandra configured with SSL.
cqlsh --ssl
Solves connects correctly.

Error rename cassandra cluster name 1.2.6

I am using cassandra 1.2.6 in cluster with a single node. I am trying to rename the cluster using the instructions in:
Cassandra clustername mismatch
After doing all the steps indicate I continue with the same error when I start cassandra after change the cassandra.yaml file
Do anyone Know if it is a problem of cassandra 1.2.6?
Thanks
Empty the /var/lib/cassandra/data ,/var/lib/cassandra/commitlog ,/var/lib/cassandra/saved_caches directory and restart Casandra after changing cluster name . This works very well in version 1.2.4 ,try with your version .
It is recommended to use stable release of in envelopment product, if not done with above use 1.2.5 or 1.2.4 instead.
Executing the following command using cqlsh worked for me (on Cassandra 1.2.9):
update system.local set cluster_name='$CLUSTER_NAME' where key='local';
You'll need to get it working first to access the cluster by setting cluster_name in cassandra.yaml to the old name. Afterwards, you can run a nodetool flush, update cassandra.yaml, and restart Cassandra.
Clear /var/lib/cassandra/data, /var/lib/cassandra/commitlog, /var/lib/cassandra/saved_caches directories and restart Casandra after changing cluster name. This works very well in version 2.0.2

Resources