I am unable to complete the
"Exercise 6 - Node" from DS201: Foundations of Apache Cassandra™ and DataStax Enterprise
From "Exercise 6 - Node", I followed all the steps provided. See the exception , I am unable to complete successfully. Could you please help , what is that I am doing wrong, why I am unable to varify the status of NODE#1. using the command. /home/ubuntu/node1/bin/nodetool status
Here is the erro rmessage, "error: No nodes present in the cluster. Has this node finished starting up?"
I am trying to setup the cluster by creating two cassandra DB node ( ie. node1 and node2 ) in the same host machine ( 127.0.0,1 ).
- To make a two-node cluster, we will unzip the DataStax Enterprise™ tarball twice making two folders: node1 and node2. In your terminal, execute the following commands within the /home/ubuntu directory:
tar -xf dse-6.0.0-bin.tar.gz mv dse-6.0.0 node1 labwork/config_node 1 tar -xf dse-6.0.0-bin.tar.gz mv dse-6.0.0 node2 labwork/config_node 2
Open the /home/ubuntu/node2/resources/cassandra/conf/cassandra.yaml file in vi, nano or any other text editor.
Change the initial_token value and set it to 9223372036854775807 (note you need a space between the colon and the value). This node will manage the second half of the token range--the positive tokens.
# initial_token allows you to specify tokens manually. While you can use it with # vnodes (num_tokens > 1, above) -- in which case you should provide a # comma-separated list -- it's primarily used when adding nodes to legacy clusters # that do not have vnodes enabled. initial_token: 9223372036854775807 Save the changes to the file and exit the text editor.
In your terminal, start the first node via /home/ubuntu/node1/bin/dse cassandra Wait for the node to start up. Once it has done so, press enter to get back to the prompt.
Run the /home/ubuntu/node1/resources/cassandra/bin/nodetool status command to verify the node is working properly.
ubuntu@ds201-node1:~$ /home/ubuntu/node1/resources/cassandra/bin/nodetool status Datacenter: Cassandra ===================== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Owns Host ID Token Rack UN 127.0.0.1 114.83 KiB ? e2ba30fc-1589-4ae4-8f98-69051151c44f 0 rack1 The UN indicates UP NORMAL meaning the node is ready to go. Load indicates current disk space usage. Owns indicates how many tokens this node is responsible for (it is the only node in the ring at the moment). Token should be 0 (the same value set in the cassandra.yaml file). We discuss racks later in the course.
Start the second node via /home/ubuntu/node2/bin/dse cassandra command. This node will take longer to bootstrap and join the cluster. Wait for the second node to finish bootstrapping before continuing.
Use /home/ubuntu/node1/resources/cassandra/bin/nodetool status again to view the current state of the cluster.
ubuntu@ds201-node1:~$ /home/ubuntu/node1/resources/cassandra/bin/nodetool status Datacenter: Cassandra ===================== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns Host ID Rack UN 127.0.0.1 124.53 KiB 1 ? 2f06ea12-e5cc-40fd-aca5-24a1accedc39 rack1 UN 127.0.0.2 117.34 KiB 1 ? 6025f510-1054-45d7-8c9d-cb40c60b5787 rack1 Notice both nodes are now up and normal. If not, please consult your instructor
Exception detail (2.1) NODE#1
$ /home/ubuntu/node1/bin/nodetool status 2023-03-19 23:51:15,589: error: No nodes present in the cluster. Has this node finished starting up? -- StackTrace -- java.lang.RuntimeException: No nodes present in the cluster. Has this node finished starting up? at org.apache.cassandra.dht.Murmur3Partitioner.describeOwnership(Murmur3Partitioner.java:267) at org.apache.cassandra.service.StorageService.effectiveOwnership(StorageService.java:5807) at org.apache.cassandra.service.StorageService.effectiveOwnership(StorageService.java:213) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260) at java.management/com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at java.management/com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at java.management/com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at java.management/com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) param@siva-Lenovo-Edge-15:/home/ubuntu/node1/bin$ /home/ubuntu/node1/bin$ ./cqlsh 127.0.0.1 9041 Connected to Test Cluster at 127.0.0.1:9041. [cqlsh 6.8.0 | DSE 6.8.33 | CQL spec 3.4.5 | DSE protocol v2] Use HELP for help. cqlsh> (2.1) NODE#2
/home/ubuntu/node2/bin$ ./nodetool status Datacenter: Cassandra ===================== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving/Stopped -- Address Load Owns (effective) Host ID Token Rack UN 127.0.0.2 238.88 KiB 100.0% 644cbad7-75d2-4f1c-ab05-427b1017b96f 0 rack1 /home/ubuntu/node2/bin$ ./cqlsh 127.0.0.1 9042 Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 6.8.0 | DSE 6.8.33 | CQL spec 3.4.5 | DSE protocol v2] Use HELP for help. cqlsh> diff of node1 cassandra.yaml and node2 cassandra.yaml
param@:/home/ubuntu/node1/resources/cassandra/conf$ diff /home/ubuntu/node1/resources/cassandra/conf/cassandra.yaml /home/ubuntu/node2/resources/cassandra/conf/cassandra.yaml 42c42 < initial_token: 0 --- > initial_token: 9223372036854775807 75c75 < hints_directory: /home/ubuntu/node1/data/hints --- > hints_directory: /home/ubuntu/node2/data/hints 208c208 < - /home/ubuntu/node1/data/data --- > - /home/ubuntu/node2/data/data 218c218 < commitlog_directory: /home/ubuntu/node1/data/commit-log --- > commitlog_directory: /home/ubuntu/node2/data/commit-log 229c229 < cdc_raw_directory: /home/ubuntu/node1/data/cdc_raw --- > cdc_raw_directory: /home/ubuntu/node2/data/cdc_raw 353c353 < saved_caches_directory: /home/ubuntu/node1/data/saved-caches --- > saved_caches_directory: /home/ubuntu/node2/data/saved-caches 573c573 < listen_address: 127.0.0.1 --- > listen_address: 127.0.0.1 608c608 < native_transport_port: 9041 --- > native_transport_port: 9042 :/home/ubuntu/node1/resources/cassandra/conf$