1 Download the installation package
Http://www.planetcassandra.org/cassandra/?dlink=http://downloads.datastax.com/community/dsc-cassandra-2.1.5-bin.tar.gz
Installed in the form of a tar package, after decompression can be used; Select 2.1.5, because the Golang client gocql git home page supports the latest version 2.1.5;
2 after decompression, modify the corresponding configuration;
Modify the relevant configuration in the Cassandra.yaml in the Conf directory in tar;
(1) Modify cluster_name for the name of the cluster you want, for all node in the same cluster the configuration of the same;
(2) Data_file_directories, Canssandra the location where the data files are stored.
(3) The location of Commitlog_directory,commitlog storage; Cassandra in order to recover data, but also the use of first write log, and then write data (memory or disk) way;
(4) Listen_address, comment out, or write on the Local intranet address or the external network address, Cassandra between the use of gossip protocol for consistency check, each node can communicate with other nodes, here is each node to other nodes to provide access to the address;
(5) Rpc_address, write on this machine's external network address, this is the external RPC interface provided by this machine;
(6) Seeds, arbitrary selection of the cluster in a relatively stable number of nodes in the IP address written in, this is still related to the gossip protocol, the cluster in the start of the time do not know the other nodes in the system, to pass this seeds configuration as a bridge, Finally, each node in the cluster is aware of the effects of all the remaining nodes;
3 Starting the Cassandra Service
(1) After the configuration, run Bin/cassandra directly, start the Cassandra; if there is no information such as error, the description has been successful, the default is running in the background, if you want to run the foreground, you can use the Bin/cassandra-f
(2) Synchronize the changes in 2 to all the Cassandra instances, and start the cluster, and the installation is complete.
(3) You can use the Bin/nodetool status to see if your cluster is installed and completed;
(4) Bin/cqlsh can be used to use the Cassandra Command, Cqlsh is a command-line form of the client;
4 set user name, password
(1) By default, there is no user name password verification, need to be configured in the Conf/cassandra.yaml,
Change Authenticator:allowallauthenticator to Authenticator:passwordauthenticator
Change Authorizer:allowallauthorizer to Authorizer:cassandraauthorizer
Then you restart each node,
(2) Cassandra has a default Superuser, username is Cassandra, password is Cassandra, use
Bin/cqlsh <ip>-U cassandra-p Cassandra Landing;
First, create a new Superuser
CREATE USER username with PASSWORD ' PASSWORD ' SUPERUSER;
Then exit to log in Cqlsh with the new Superuser username and password, modify the default Cassandra password, and downgrade Cassandra to non-superuser
ALTER USER Cassandra with PASSWORD ' NewPassword ' nosuperuser;
You can use the list users command to each node to verify that the user name password changes to take effect;
5 Golang Client Installation
Run go get github.com/gocql/gocql on the premise of FQ
Cassandra Environment Construction