Cassandra 3.11.10 Installation depends on the environment
-
JDK
1)Cassandra 3.11.10 is based on JDk8! You only need to install jdK8 of an earlier version. Jdk8_251_x64 is recommended.
2) Set the JAVA_HOME environment variable
3) Verify that the JDK is installed correctly
Command: Java version
4) Common mistakes:
Failed to write core dump. Minidumps are not enabled by… ;
Jdk8 x86 Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap
-
Python
Cassandra command client: CQLSH is developed based on Python. The Python operating environment must be installed. Python Releases for Windows
1) Python environment variable Settings (== note: Windows MSI installation will set the environment variable ==)
2) verification
Command: python
Cassandra 3.11.10 Installation
-
Download the Cassandra 3.11.10
Official image download address
-
Setting environment variables
-
Authentication: the default configuration
Command: Cassandra
-
After Cassandra starts normally, connect using the CQLSH client
Command: CQLSH
How To Install Cassandra On Windows 10
3. Cassandra cluster construction
Three computers are used to set up the cluster. The IP addresses are 192.168.2.207, 192.168.2.203, and 192.168.79.128 respectively.
-
Cassandra.yaml configuration file
1) Set the cluster name
The cluster names in cassandra.yaml of all nodes must be the same.
cluster_name: 'Test Cluster' All nodes in the cluster must have the same cluster name
Copy the code
2) Set cluster nodes
This configuration is for the Node whose IP address is 192.168.2.207.
Master = = 192.168.2.207 = =; Slave – 1 = = 192.168.2.203 = =; Slave – 2 = = 192.168.79.128 = =;
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: "192.168.79.178 192.168.2.207, 192.168.2.203,"
# default lines 416-425
Copy the code
3) Set the listening address (== Enter its own IP address for each Node ==)
This configuration is for the Node whose IP address is 192.168.2.207.
# Address or interface to bind to and tell other Cassandra nodes to connect to.
# You _must_ change this if you want multiple nodes to be able to communicate!
#
# Set listen_address OR listen_interface, not both.
#
# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
# will always do the Right Thing _if_ the node is properly configured
# (hostname, name resolution, etc), and the Right Thing is to use the
# address associated with the hostname (it might not be).
#
Setting listen_address to 0.0.0.0 is always wrong.
#
listen_address: 192.1682.207. Line 612 by default
Copy the code
4) Set RPC (enable the service and fill in its own IP for each Node)
This configuration is for the Node whose IP address is 192.168.2.207.
# Whether to start the thrift rpc server.
start_rpc: true # Default line 675 #true: on #false: off
# The address or interface to bind the Thrift RPC service and native transport
# server to.
#
# Set rpc_address OR rpc_interface, not both.
#
# Leaving rpc_address blank has the same effect as on listen_address
# (i.e. it will be based on the configured hostname of the node).
#
Note that listen_address, you can specify 0.0.0.0, but you must also
# set broadcast_rpc_address to a value other than 0.0.0.0.
#
# For security reasons, you should not expose this port to the internet. Firewall it if needed.
rpc_address: 192.1682.207. Line 689 by default
Copy the code
5) Configure the other two nodes (192.168.2.203 and 192.168.79.128)
The two nodes are distributed and configured the same as Node(192.168.2.207).
Node: 192.168.2.203
listen_address: 192.1682.203. Line 612 by default
rpc_address: 192.1682.203. Line 689 by default
- seeds: "192.168.79.178 192.168.2.203, 192.168.2.207,"
Copy the code
Node: 192.168.79.128
listen_address: 192.16879.128. Line 612 by default
rpc_address: 192.16879.128. Line 689 by default
- seeds: "192.168.2.207 192.168.79.128, 192.168.2.203,"
Copy the code
6) Start Cassandra (executed by each Node)
Cassandra -r #root requires the -r parameter
Nodetool status # Check node status
7) start CQLSH
CQSH [host name]
Example: CQSH 192.168.2.207
Reference: Cassandra3.11.4 Cluster building – OSC_QpJYwoo6 personal space – OSCHINA – Chinese open source technology exchange community