Jump to: navigation, search
Line 1: Line 1:
 
=Installing and Configuring Cassandra=
 
=Installing and Configuring Cassandra=
 
__TOC__
 
__TOC__
Cassandra version 1.2 is mandatory for Workspace Web Edition & Web Services and must be installed and configured prior to starting the installation and configuration of Workspace Web Edition & Web Services.
+
Before you start installing and configuring Workspace Web Edition & Web Services, 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 [http://www.datastax.com/documentation/cassandra/1.2/cassandra/features/featuresTOC.html Cassandra 1.2 documentation].
 
 
<!-- Available styles: (default)-Important, 2-Tip, 3-Warning -->
 
<!-- Important: equal signs (=) will not work in a note. Use the equivalent HTML code (&#61;) instead.-->
 
{{NoteFormat|For more details about Cassandra, refer to the [http://www.datastax.com/documentation/cassandra/1.2/cassandra/features/featuresTOC.html Cassandra documentation for version 1.2].}}
 
 
 
The procedures on this page are intended to serve as a quick guide to installing and configuring Cassandra.
 
  
 
==Installing Cassandra==
 
==Installing Cassandra==
Line 18: Line 12:
  
 
#[http://cassandra.apache.org/download/ Download the latest 1.2.x version of Cassandra].<br/>
 
#[http://cassandra.apache.org/download/ Download the latest 1.2.x version of Cassandra].<br/>
#Copy the Cassandra archive to the installation directory. For example, <tt>/usr/local</tt><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/>
 
#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 <tt>cassandra.yaml</tt>. For example:
+
#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/data'''
#* /var/lib/cassandra/commitlog
+
#* '''/var/lib/cassandra/commitlog'''
#* /var/lib/cassandra/saved_caches
+
#* '''/var/lib/cassandra/saved_caches'''
#Add a directory for logging. You can create this directory anywhere, such as <tt>/var/log/cassandra/</tt>.
+
#Add a directory for logging. You can create this directory anywhere, such as '''/var/log/cassandra/'''.
 
'''End'''
 
'''End'''
  
 
==Configuring Cassandra with Multiple Nodes==
 
==Configuring Cassandra with Multiple Nodes==
This procedure shows you how to configure a three-node Cassandra cluster in a single datacenter.
+
This procedure shows you how to configure a three-node Cassandra cluster in a single datacenter. Complete the steps below for each node.
<!-- Available styles: (default)-Important, 2-Tip, 3-Warning -->
+
{{NoteFormat|The files modified in this procedure are typically found in the '''''Cassandra_install_dir''/conf''' directory.}}
<!-- Important: equal signs (=) will not work in a note. Use the equivalent HTML code (&#61;) instead.-->
 
{{NoteFormat|The files modified in this procedure are typically found in the <tt>[Cassandra install dir]/conf</tt> directory.}}
 
 
'''Prerequisites'''
 
'''Prerequisites'''
 
* [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
 
* [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
 
'''Start'''<br/>
 
'''Start'''<br/>
Complete the following steps for each Cassandra node:
 
 
<ol>
 
<ol>
<li>Modify the <tt>cassandra.yaml</tt> file:</li>
+
<li>Modify the '''cassandra.yaml''' file:</li>
 
<ol type="a">
 
<ol type="a">
 
<li>Set the <tt>cluster_name</tt>. It must be the same name on all nodes.</li>
 
<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: </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">
<nowiki>Node #1:  -9223372036854775808
+
Node #1:  -9223372036854775808
 
Node #2:  -3074457345618258603
 
Node #2:  -3074457345618258603
Node #3:  3074457345618258602</nowiki>
+
Node #3:  3074457345618258602
<!-- Available styles: (default)-Important, 2-Tip, 3-Warning -->
+
</source>
<!-- Important: equal signs (=) will not work in a note. Use the equivalent HTML code (&#61;) instead.-->
+
</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, [http://www.datastax.com/documentation/cassandra/1.2/cassandra/configuration/configGenTokens_c.html consult the Cassandra documentation].}}
 
{{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, [http://www.datastax.com/documentation/cassandra/1.2/cassandra/configuration/configGenTokens_c.html 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>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>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 the [[Prerequisites#Installing_Cassandra|Installing Cassandra]] procedure.</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>
 
<li>Change <tt>endpoint_snitch</tt> to <tt>PropertyFileSnitch</tt>. </li>
 +
</ol>
 
<li>Save your changes and close the file.</li>
 
<li>Save your changes and close the file.</li>
</ol>
+
<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>Open the <tt>log4j-server.properties</tt> file and set the <tt>log4j.appender.R.File</tt> property to the directory you created in Step 5 of the [[Prerequisites#Installing_Cassandra|Installing Cassandra]] procedure.</li>
 
 
<li>Save your changes and close the file.</li>
 
<li>Save your changes and close the file.</li>
<li>Open the <tt>cassandra-topology.properties</tt> file and update for you cluster topology. For each node in your cluster, add the following line: </li>
+
<li>Open the '''cassandra-topology.properties''' file and update for you cluster topology. For each node in your cluster, add the following line:  
<nowiki>[node]=[datacenter]:[rack]</nowiki>
+
<source lang="text">
 +
[node]=[datacenter]:[rack]</nowiki>
 
*<tt>[node]</tt> &mdash; The IP address of the node
 
*<tt>[node]</tt> &mdash; The IP address of the node
 
*<tt>[datacenter]</tt> &mdash; The name of the datacenter for this node.
 
*<tt>[datacenter]</tt> &mdash; The name of the datacenter for this node.
 
*<tt>[rack]</tt> &mdash; The name of the rack for this node.
 
*<tt>[rack]</tt> &mdash; The name of the rack for this node.
 
+
</source>
The following is a sample <tt>cassandra-topology.properties</tt> file for a Single Datacenter scenario:
+
The following is a sample '''cassandra-topology.properties''' file for a Single Datacenter scenario:
<nowiki>192.0.2.10=datacenter1:rack1
+
<source lang="text">
 +
192.0.2.10=datacenter1:rack1
 
192.0.2.11=datacenter1:rack1
 
192.0.2.11=datacenter1:rack1
 
192.0.2.12=datacenter1:rack1
 
192.0.2.12=datacenter1:rack1
</nowiki>
+
</source>
 +
</li>
 
<li>Save your changes and close the file.</li>
 
<li>Save your changes and close the file.</li>
 
</ol>
 
</ol>
Line 73: Line 67:
 
==Configuring Cassandra with One Node==
 
==Configuring Cassandra with One Node==
 
This procedure shows you how to configure a single Cassandra node. This could be valuable for a lab or a simple test installation.
 
This procedure shows you how to configure a single Cassandra node. This could be valuable for a lab or a simple test installation.
<!-- Available styles: (default)-Important, 2-Tip, 3-Warning -->
+
{{NoteFormat|The files modified in this procedure are typically found in the '''''Cassandra_install_dir''/conf''' directory.}}
<!-- Important: equal signs (=) will not work in a note. Use the equivalent HTML code (&#61;) instead.-->
 
{{NoteFormat|The files modified in this procedure are typically found in the <tt>[Cassandra install dir]/conf</tt> directory.}}
 
 
'''Prerequisites'''
 
'''Prerequisites'''
 
* [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
 
* [[InstallingAndDeployingCassandra#Installing_Cassandra|Installing Cassandra]]
 
'''Start'''
 
'''Start'''
 
<ol>
 
<ol>
<li>Modify the <tt>cassandra.yaml</tt> file:</li>
+
<li>Modify the '''cassandra.yaml''' file:</li>
 
<ol type="a">
 
<ol type="a">
<li>Set the <tt>cluster_name</tt>. It must be the same name on all nodes.</li>
+
<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>seeds</tt> to the list of host names of all nodes. 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>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 the [[Prerequisites#Installing_Cassandra|Installing Cassandra]] procedure.</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>Save your changes and close the file.</li>
 
 
</ol>
 
</ol>
<li>Open the <tt>log4j-server.properties</tt> file and set the <tt>log4j.appender.R.File</tt> property to the directory you created in Step 5 of the [[Prerequisites#Installing_Cassandra|Installing Cassandra]] procedure.</li>
 
 
<li>Save your changes and close the file.</li>
 
<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>Save your changes and close the file.</li>
 
</ol>
 
</ol>
Line 100: Line 89:
 
'''Start'''<br/>
 
'''Start'''<br/>
 
<ol>
 
<ol>
<li>Start all Cassandra nodes using the following command:</li>
+
<li>Start all Cassandra nodes using the following command:
<pre>[cassandra install dir]/bin/cassandra</pre>
+
<tt>''Cassandra_install_dir''/bin/cassandra</tt>
<li>Use the nodetool utility to verify that all nodes have connected by entering the following command:</li>
+
</li>
<pre>[cassandra install dir]/bin/nodetool -h [cassandra host] ring</pre>  
+
<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>
 
The following is sample output for a multiple Cassandra node scenario:
 
The following is sample output for a multiple Cassandra node scenario:
 
+
<source lang="text">
<pre>
 
 
/genesys/apache-cassandra-1.2/bin$ ./nodetool ring
 
/genesys/apache-cassandra-1.2/bin$ ./nodetool ring
 
Address    DC          Rack  Status  State  Load      Owns    Token
 
Address    DC          Rack  Status  State  Load      Owns    Token
Line 113: Line 101:
 
192.0.2.11  datacenter1  rack1  Up      Normal  14.97 MB  100.00%  -3074457345618258603
 
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
 
192.0.2.12  datacenter1  rack1  Up      Normal  14.97 MB  100.00%  3074457345618258602
</pre>
+
</source>
 
 
 
 
 
The following is sample output for a single Cassandra node scenario:
 
The following is sample output for a single Cassandra node scenario:
<pre>
+
<source lang="text">
 
/genesys/apache-cassandra-1.2/bin$ ./nodetool ring
 
/genesys/apache-cassandra-1.2/bin$ ./nodetool ring
 
Address        DC          Rack        Status State  Load            Effective-Ownership Token                                       
 
Address        DC          Rack        Status State  Load            Effective-Ownership Token                                       
 
127.0.0.1      datacenter1 rack1      Up    Normal  1.89 MB        100.00%            76880863635469966884037445232169973201
 
127.0.0.1      datacenter1 rack1      Up    Normal  1.89 MB        100.00%            76880863635469966884037445232169973201
 
+
</source>
 
 
</pre>
 
 
</li>
 
</li>
 
</ol>
 
</ol>

Revision as of 11:16, April 1, 2015

Installing and Configuring Cassandra

Before you start installing and configuring Workspace Web Edition & Web Services, 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 Cassandra 1.2 documentation.

Installing Cassandra

Complete this procedure for each Cassandra node.

Prerequisites

Start

  1. Download the latest 1.2.x version of Cassandra.
  2. Copy the Cassandra archive to the installation directory. For example, /usr/local
  3. Use a tar utility to extract the files. For example, tar -zxvf apache-cassandra-1.2.15-bin.tar.gz
  4. 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
  5. Add a directory for logging. You can create this directory anywhere, such as /var/log/cassandra/.

End

Configuring Cassandra with Multiple Nodes

This procedure shows you how to configure a three-node Cassandra cluster in a single datacenter. Complete the steps below for each node.

Important
The files modified in this procedure are typically found in the Cassandra_install_dir/conf directory.

Prerequisites

Start

  1. Modify the cassandra.yaml file:
    1. Set the cluster_name. It must be the same name on all nodes.
    2. Set the initial_token according to the node's place in ring. It must be one of the following:
      Node #1:  -9223372036854775808
      Node #2:  -3074457345618258603
      Node #3:   3074457345618258602
    3. Important
      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, consult the Cassandra documentation.
    4. Set seeds to the list of host names of all nodes. For example: -seeds: "node1, node2, node3"
    5. Set listen_address and rpc_address to the host name.
    6. Set data_file_directories, commitlog_directory, and saved_caches_directory to the directories you created in Step 4 of Installing Cassandra.
    7. Change endpoint_snitch to PropertyFileSnitch.
  2. Save your changes and close the file.
  3. Open the log4j-server.properties file and set the log4j.appender.R.File property to the directory you created in Step 5 of Installing Cassandra.
  4. Save your changes and close the file.
  5. Open the cassandra-topology.properties file and update for you cluster topology. For each node in your cluster, add the following line:
    [node]=[datacenter]:[rack]</nowiki>
    *<tt>[node]</tt> &mdash; The IP address of the node
    *<tt>[datacenter]</tt> &mdash; The name of the datacenter for this node.
    *<tt>[rack]</tt> &mdash; The name of the rack for this node.

    The following is a sample cassandra-topology.properties file for a Single Datacenter scenario:

    192.0.2.10=datacenter1:rack1
    192.0.2.11=datacenter1:rack1
    192.0.2.12=datacenter1:rack1
  6. Save your changes and close the file.

End

Configuring Cassandra with One Node

This procedure shows you how to configure a single Cassandra node. This could be valuable for a lab or a simple test installation.

Important
The files modified in this procedure are typically found in the Cassandra_install_dir/conf directory.

Prerequisites

Start

  1. Modify the cassandra.yaml file:
    1. Set seeds to the list of host name of the node. For example: -seeds: “127.0.0.1”
    2. Set listen_address and rpc_address to the host name.
    3. Set data_file_directories, commitlog_directory, and saved_caches_directory to the directories you created in Step 4 of Installing Cassandra.
  2. Save your changes and close the file.
  3. Open the log4j-server.properties file and set the log4j.appender.R.File property to the directory you created in Step 5 of Installing Cassandra.
  4. Save your changes and close the file.

End

Verifying the Cassandra Installation

Prerequisites

Start

  1. Start all Cassandra nodes using the following command: Cassandra_install_dir/bin/cassandra
  2. Use the nodetool utility to verify that all nodes are connected by entering the following command: Cassandra_install_dir/bin/nodetool -h Cassandra_host ring The following is sample output for a multiple Cassandra node scenario:
    /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

    The following is sample output for a single Cassandra node scenario:

    /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

End

Next Step

Comments or questions about this documentation? Contact us for support!