Cassandra Environment Construction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.