|
|
(7 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| =Installing and configuring Cassandra= | | =Installing and configuring Cassandra= |
− | __TOC__
| |
− | Before you start installing and configuring Web Services and Applications, first you have to install and configure Cassandra version 1.2. The procedures below are meant to serve as a quick guide on how to do this — for more information, see the {{#Widget:ExtLink|link=http://www.datastax.com/documentation/cassandra/1.2/cassandra/features/featuresTOC.html|displaytext=Cassandra 1.2 documentation}}.
| |
| | | |
− | ==Installing Cassandra==
| + | Before you start installing and configuring Web Services and Applications, first you have to install and configure Cassandra. Web Services support Cassandra version 1.2 or 2.2. |
− | Complete this procedure for each Cassandra node.
| |
| | | |
− | '''Prerequisites'''
| + | For new deployments starting from version 8.5.201.41, we recommend Cassandra 2.2. The procedures below are meant to serve as a quick guide on how to do this. For more detailed information, see the [https://docs.datastax.com/en/archived/cassandra/2.2/index.html Cassandra 2.2 documentation]. |
− | *You have installed the latest {{#Widget:ExtLink|link=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html|displaytext=Java 1.7 JDK 64bit for Linux}}. For more information, refer to the {{#Widget:ExtLink|link=http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html|displaytext=Java documentation}}.
| |
| | | |
− | '''Start'''<br/>
| + | For general instructions and guidelines, select one of the following links: |
− | | |
− | #{{#Widget:ExtLink|link=http://cassandra.apache.org/download/|displaytext=Download the latest 1.2.x version of Cassandra}}.<br/>
| |
− | #Copy the Cassandra archive to the installation directory. For example, '''/usr/local'''<br/>
| |
− | #Use a tar utility to extract the files. For example, <tt>tar -zxvf apache-cassandra-1.2.15-bin.tar.gz</tt><br/>
| |
− | #Add directories for data, commitlog, and saved_caches. You can create these directories anywhere or in the default locations configured in the '''''Cassandra_install_dir''/conf/cassandra.yaml''' file. For example:
| |
− | #* '''/var/lib/cassandra/data'''
| |
− | #* '''/var/lib/cassandra/commitlog'''
| |
− | #* '''/var/lib/cassandra/saved_caches'''
| |
− | #Add a directory for logging. You can create this directory anywhere, such as '''/var/log/cassandra/'''.
| |
− | '''End'''
| |
− | | |
− | ==Configuring Cassandra==
| |
− | The procedures below describe how to create the Cassandra keyspace for the following scenarios:
| |
− | *Development — 1 Cassandra node (appropriate for a development or lab environment)
| |
− | *Single Datacenter — 1 datacenter with a minimum of three Cassandra nodes
| |
− | {{NoteFormat|For more complex Cassandra deployments, please consult with Genesys}}
| |
− | Select a tab below for the procedure that matches your deployment scenario.
| |
− | <tabber>
| |
− | Development=
| |
− | ===Configuring Cassandra (1 Cassandra node)===
| |
− | {{NoteFormat|The files modified in this procedure are typically found in the '''''Cassandra_install_dir''/conf''' directory.}}
| |
− | '''Prerequisites'''
| |
− | * [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
| |
− | '''Start'''
| |
− | <ol>
| |
− | <li>Modify the '''cassandra.yaml''' file:</li>
| |
− | <ol type="a">
| |
− | <li>Set <tt>seeds</tt> to the list of host name of the node. For example: <tt>-seeds: “127.0.0.1”</tt></li>
| |
− | <li>Set <tt>listen_address</tt> and <tt>rpc_address</tt> to the host name.</li>
| |
− | <li>Set <tt>data_file_directories</tt>, <tt>commitlog_directory</tt>, and <tt>saved_caches_directory</tt> to the directories you created in Step 4 of [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]].</li>
| |
− | </ol>
| |
− | <li>Save your changes and close the file.</li>
| |
− | <li>Open the '''log4j-server.properties''' file and set the <tt>log4j.appender.R.File</tt> property to the directory you created in Step 5 of [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]].</li>
| |
− | <li>Save your changes and close the file.</li>
| |
− | </ol>
| |
− | '''End'''
| |
− | |-|
| |
− | Single Datacenter=
| |
− | ===Configuring Cassandra (1 datacenter)===
| |
− | Complete the steps below for each node.
| |
− | {{NoteFormat|The files modified in this procedure are typically found in the '''''Cassandra_install_dir''/conf''' directory.}}
| |
− | '''Prerequisites'''
| |
− | * [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
| |
− | '''Start'''<br/>
| |
− | <ol>
| |
− | <li>Modify the '''cassandra.yaml''' file:</li>
| |
− | <ol type="a">
| |
− | <li>Set the <tt>cluster_name</tt>. It must be the same name on all nodes.</li>
| |
− | <li>Set the <tt>initial_token</tt> according to the node's place in ring. It must be one of the following:
| |
− | <source lang="text">
| |
− | Node #1: -9223372036854775808
| |
− | Node #2: -3074457345618258603
| |
− | Node #3: 3074457345618258602
| |
− | </source>
| |
− | </li>
| |
− | {{NoteFormat|The tokens shown here can be used for a three-node Cassandra cluster in a single datacenter. If you are using a different topology or cluster size, {{#Widget:ExtLink|link=http://www.datastax.com/documentation/cassandra/1.2/cassandra/configuration/configGenTokens_c.html|displaytext=consult the Cassandra documentation}}.}}
| |
− | <li>Set <tt>seeds</tt> to the list of host names of all nodes. For example: <tt>-seeds: "node1, node2, node3"</tt></li>
| |
− | <li>Set <tt>listen_address</tt> and <tt>rpc_address</tt> to the host name.</li>
| |
− | <li>Set <tt>data_file_directories</tt>, <tt>commitlog_directory</tt>, and <tt>saved_caches_directory</tt> to the directories you created in Step 4 of [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]].</li>
| |
− | <li>Change <tt>endpoint_snitch</tt> to <tt>PropertyFileSnitch</tt>. </li>
| |
− | </ol>
| |
− | <li>Save your changes and close the file.</li>
| |
− | <li>Open the '''log4j-server.properties''' file and set the <tt>log4j.appender.R.File</tt> property to the directory you created in Step 5 of [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]].</li>
| |
− | <li>Save your changes and close the file.</li>
| |
− | <li>Open the '''cassandra-topology.properties''' file and update for you cluster topology. For each node in your cluster, add the following line:
| |
− | <source lang="text">
| |
− | [node]=[datacenter]:[rack]</nowiki>
| |
− | *<tt>[node]</tt> — The IP address of the node
| |
− | *<tt>[datacenter]</tt> — The name of the datacenter for this node.
| |
− | *<tt>[rack]</tt> — The name of the rack for this node.
| |
− | </source>
| |
− | The following is a sample '''cassandra-topology.properties''' file for a Single Datacenter scenario:
| |
− | <source lang="text">
| |
− | 192.0.2.10=datacenter1:rack1
| |
− | 192.0.2.11=datacenter1:rack1
| |
− | 192.0.2.12=datacenter1:rack1
| |
− | </source>
| |
− | </li>
| |
− | <li>Save your changes and close the file.</li>
| |
− | </ol>
| |
− | '''End'''
| |
− | </tabber>
| |
− | | |
− | ==Verifying the Cassandra installation==
| |
− | '''Prerequisites'''
| |
− | * [[InstallingAndDeployingCassandra#Configuring_Cassandra|Configuring Cassandra]]
| |
− | '''Start'''<br/>
| |
− | <ol>
| |
− | <li>Start all Cassandra nodes using the following command:
| |
− | <tt>''Cassandra_install_dir''/bin/cassandra</tt>
| |
− | </li>
| |
− | <li>Use the nodetool utility to verify that all nodes are connected by entering the following command:
| |
− | <tt>''Cassandra_install_dir''/bin/nodetool -h ''Cassandra_host'' ring</tt>
| |
− | <br/><br/>
| |
− | The following is sample output for a Single Datacenter scenario with three Cassandra nodes:
| |
− | <source lang="text">
| |
− | /genesys/apache-cassandra-1.2/bin$ ./nodetool ring
| |
− | Address DC Rack Status State Load Owns Token
| |
− | 192.0.2.10 datacenter1 rack1 Up Normal 14.97 MB 100.00% -9223372036854775808
| |
− | 192.0.2.11 datacenter1 rack1 Up Normal 14.97 MB 100.00% -3074457345618258603
| |
− | 192.0.2.12 datacenter1 rack1 Up Normal 14.97 MB 100.00% 3074457345618258602
| |
− | </source>
| |
− | | |
− | The following is sample output for a Development scenario with a single Cassandra node:
| |
− | <source lang="text">
| |
− | /genesys/apache-cassandra-1.2/bin$ ./nodetool ring
| |
− | Address DC Rack Status State Load Effective-Ownership Token
| |
− | 127.0.0.1 datacenter1 rack1 Up Normal 1.89 MB 100.00% 76880863635469966884037445232169973201
| |
− | </source>
| |
− | </li>
| |
− | </ol>
| |
− | '''End'''
| |
− | | |
− | ==Next step==
| |
− | *[[InstallationProcedures|Installing Web Services and Applications]]
| |
| | | |
| + | * [[InstallCassandra2x|Installing and Deploying Cassandra 2.2]] |
| + | * [[UpgradingCassandraTo2x|Upgrading to Cassandra 2.2]] |
| | | |
| [[Category:V:HTCC:8.5.2DRAFT]] | | [[Category:V:HTCC:8.5.2DRAFT]] |