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
Related
I have installed cassandra 3.11.4 as per the below link http://cassandra.apache.org/download/ and when I'm trying to run cqlsh and nodetool command its showing command not found.
when run sudo service cassandra status,cassandra is running.
Please help
First, you need to verify that the service is healthy and operational
verify that the process is running:
ps -efa | grep cassandra
The expected outcome is a valid java process being executed
verify the log file as defined in $CASSANDRA_HOME/conf/logback.xml
tail -n 100 cassandra/system.log
The expected outcome is to not find errors
Try to replicate the issue in a new instance of the command line
You need to verify the services whether it is running or not in the configured port and IPs.
Also, you can check the system.log for any error. if still issue and data is not important you can delete the /data /commitlog /savedcache and restart the cassandra services again.
once started just check
ps -ef | grep cassandra
Currently commitlog directory is pointing to Directory1. I want to change it different directory D2. How should the migration be ?
This is how we did it. We have a load-balanced client that talks to Cassandra 1.1.2, and each client lives on each Cassandra node.
Drain your service.
Wait for the load balancer to remove the node.
Stop your service on the local node to halt direct Client-Cassandra writes: systemctl stop <your service name>
At this point there should be no more writes and greatly reduced disk activity:
iostat 2 - Disk activity should be near zero
nodetool gossipinfo
Disable Cassandra gossip protocol to mark the node dead and halt Cassandra-Cassandra writes: nodetool disablegossip
Flush all contents of the commit log into SSTables: nodetool flush
Drain the node – this command is more important than nodetool flush, (and might include all the behaviour of nodetool flush): nodetool drain
Stop the cassandra process: systemctl stop cassandra
Modify Cassandra config file(s), e.g. vi /etc/cassandra/default.conf/cassandra.yaml
Start Cassandra: systemctl start cassandra
Wait 10-20 minutes. Tail Cassandra logs to follow along, e.g. tail -F /var/log/cassandra/system.log
Confirm ring is healthy before moving on to next node: nodetool ring
Re-start client service: systemctl start <your service here>
Note that there was no need for us to do manual copying of the commitlog files themselves. Flushing and draining took care of that. The files then slowly reappeared in the new commitlog_dir location.
You can change the commit log directory in cassandra.yaml (key: "commitlog_directory") and copy all logs to the new destination (see docs) :
commitlog_directory
commitlog_directory
The directory where the commit log is stored. Default locations:
Package installations: /var/lib/cassandra/commitlog
Tarball installations: install_location/data/commitlog
For optimal write performance, place the commit log be on a separate disk partition, or (ideally) a separate physical device from
the data file directories. Because the commit log is append only, an
HDD is acceptable for this purpose.
If you are using bitnami/cassandra containers, this should be done using this env var (see docs):
CASSANDRA_COMMITLOG_DIR: Directory where the commit logs will be
stored. Default: /bitnami/cassandra/data/commitlog
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 .
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
My Cassandra used to work with no problems.
I was able to connect with no problems but now for some reason it doesn't work anymore.
[default#unknown] connect localhost/9160;
Exception connecting to localhost/9160. Reason: Connection refused.
I am in Ubuntu server
Thanks in-advance
The solution to this question was provided to you on the pycassa google group:
https://groups.google.com/d/topic/pycassa-discuss/Bai7bvkHYU4/discussion
This is not a pycassa problem. The problems you are having are specific to starting a Cassandra instance and not following the documentation in the README.txt that is in the root folder of the distribution:
Getting started
This short guide will walk you through getting a basic one node cluster up
and running, and demonstrate some simple reads and writes.
tar -zxvf apache-cassandra-$VERSION.tar.gz
cd apache-cassandra-$VERSION
sudo mkdir -p /var/log/cassandra
sudo chown -R whoami /var/log/cassandra
sudo mkdir -p /var/lib/cassandra
sudo chown -R whoami /var/lib/cassandra
Note: The sample configuration files in conf/ determine the file-system
locations Cassandra uses for logging and data storage. You are free to
change these to suit your own environment and adjust the path names
used here accordingly.
Now that we're ready, let's start it up!
bin/cassandra -f
Running the startup script with the -f argument will cause Cassandra to
remain in the foreground and log to standard out.
Now let's try to read and write some data using the command line client.
bin/cassandra-cli --host localhost
The command line client is interactive so if everything worked you should
be sitting in front of a prompt...
Connected to: "Test Cluster" on localhost/9160
Welcome to cassandra CLI.
Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit.
[default#unknown]
As the banner says, you can use 'help;' or '?' to see what the CLI has to
offer, and 'quit;' or 'exit;' when you've had enough fun.
Verify the following:
Cassandra process is running and thrift is listening on 9160 (netstat-tulpn)
9160 port not being blocked by a firewall rule or similar
If the above are true, then check the cassandra log for additional information.
Other than that your description is pretty vague. So any other information about what may have changed in the environment would be helpful.
I faced the same problem and the reason was that I had configured Cassandra to listen on the Server IP and not on localhost.
/etc/dse/cassandra/cassandra.yaml
listen_address: 10.102.8.71
So try this and check if it works for you:
cassandra-cli --host "your host name"