Jump to: navigation, search
(Update with the copy of version: 8.5.2DRAFT)
(Update with the copy of version: 8.5.2DRAFT)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
= Initializing Cassandra=
 
= Initializing Cassandra=
__NOTOC__
+
__TOC__
==Creating the Cassandra Keyspace==
+
==Creating the Cassandra keyspace==
 
The procedures below describe how to create the Cassandra keyspace for the following scenarios:
 
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)
 
* Development — 1 Cassandra node (appropriate for a development or lab environment)
* Single Datacenter — 1 datacenter with a minimum of three Cassandra nodes
+
* Single Data Center — 1 data center with a minimum of three Cassandra nodes
* Two Datacenters — 2 datacenters with a minimum of three Cassandra nodes in each datacenter
+
* Two Data Centers — 2 data centers with a minimum of three Cassandra nodes in each data center
 +
 
 +
{{NoteFormat|For more complex Cassandra deployments, please consult with Genesys.}}
  
 
Select a tab below for the procedure that matches your deployment scenario.
 
Select a tab below for the procedure that matches your deployment scenario.
 
<!-- 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 complex Cassandra deployments, please consult with Genesys.}}
 
  
 
<tabber>
 
<tabber>
 
Development=
 
Development=
===Creating the Cassandra Keyspace (1 Cassandra node)===
+
===Creating the Cassandra keyspace (1 Cassandra node)===
'''Start of Procedure'''
+
'''Start'''
  
 
<ol>
 
<ol>
<li>Copy the <tt>ks-schema-local.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
+
<li>Copy the '''ks-schema-local.cql''' file from '''''/installation_path/gws/data''''' to the Cassandra node host.</li>
<li>By default, the replication factor is set to <tt>1</tt>. Since this is a single node deployment, you do not need to modify this value. Refer to the [http://www.datastax.com/documentation/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html Cassandra documentation] for more information about replication factors.</li>
+
<li>By default, the replication factor is set to <tt>1</tt>. Since this is a single node deployment, you don't need to modify this value. Refer to the {{#Widget:ExtLink|link=https://docs.datastax.com/en/archived/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html|displaytext=Cassandra documentation}} for more information about replication factors.</li>
<nowiki>and strategy_options = {replication_factor : 1}</nowiki>
+
<source lang="text">
<li>Run the following command to create the Cassandra schema:</li>
+
and strategy_options = {replication_factor : 1}
<nowiki>[cassandra install dir]/bin/cassandra-cli -h [cassandra host] --file ks-schema-local.txt</nowiki>
+
</source>
 
+
<li>Create the Cassandra schema. Choose one of the following options:
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
+
<ul>
 +
<li>If you are using Web Services and Applications v8.5.2.## or later, run the following command:
 +
<tt>cqlsh ''cassandra_host'' --file ks-schema-local.cql</tt></li>
 +
<li>If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command:
 +
<tt>''cassandra_install_dir''/bin/cassandra-cli -h ''cassandra_host'' --file ks-schema-local.txt</tt><br>
 +
...where <tt>''cassandra_host''</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node.</li>
 +
</ul></li>
 
</ol>
 
</ol>
'''End of Procedure'''<br/><br/>
 
'''Next Steps'''<br/>
 
*Creating the Column Families
 
  
==Creating the Column Families==
+
'''End'''
'''Start of Procedure'''
 
  
<ol>
 
<li>Copy the <tt>cf-schema.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
 
<li>Run the following command to create the Cassandra schema:</li>
 
<nowiki>[cassandra install dir]/bin/cassandra-cli  -h [cassandra host] --file cf-schema.txt</nowiki>
 
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
 
</ol>
 
 
'''End of Procedure'''<br/><br/>
 
'''Next Steps'''<br/>
 
*[[DeployWebApp|Deploy the Web Application]]
 
 
|-|
 
|-|
  
Single Datacenter=
+
Single Data Center=
===Creating the Cassandra Keyspace (1 datacenter)===
+
===Creating the Cassandra keyspace (1 data center)===
 
Complete the following procedure on one node in your Cassandra cluster.
 
Complete the following procedure on one node in your Cassandra cluster.
  
'''Start of Procedure'''
+
'''Start'''
  
 
<ol>
 
<ol>
<li>Copy the <tt>ks-schema-prod.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
+
<li>Copy the '''ks-schema-prod.cql''' file from '''''/installation_path/gws/data''''' to the Cassandra node host.</li>
<li>For fault tolerance, Genesys recommends that you use at least 3 Cassandra nodes and set the replication factor to 3. Please refer to the [http://www.datastax.com/documentation/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html Cassandra documentation] for more information about replication factors. To modify this value, change the following line:</li>
+
<li>For fault tolerance, Genesys recommends that you use at least 3 Cassandra nodes and set the replication factor to <tt>3</tt>. Refer to the {{#Widget:ExtLink|link=https://docs.datastax.com/en/archived/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html|displaytext=Cassandra documentation}} for more information about replication factors. To modify this value, change the following line:
<nowiki>and strategy_options = {replication_factor : <replication-factor-in-your-lab>}</nowiki>
+
<source lang="text">
<li>Run the following command to create the Cassandra schema:</li>
+
and strategy_options = {replication_factor : <replication-factor-in-your-lab>}
<nowiki>[cassandra install dir]/bin/cassandra-cli -h [cassandra host] --file ks-schema-prod.txt</nowiki>
+
</source></li>
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
+
<li>Create the Cassandra schema. Choose one of the following options:
 +
<ul>
 +
<li>If you are using Web Services and Applications v8.5.2.## or later, run the following command:
 +
<tt>cqlsh ''cassandra_host'' --file ks-schema-prod.cql</tt></li>
 +
<li>If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command:
 +
<tt>''cassandra_install_dir''/bin/cassandra-cli -h ''cassandra_host'' --file ks-schema-prod.txt</tt></li>
 +
</ul>
 +
<tt>''cassandra_host''</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node.</li>
 +
</li>
 
</ol>
 
</ol>
'''End of Procedure'''<br/><br/>
+
'''End'''
'''Next Steps'''<br/>
 
*Creating the Column Families
 
 
 
==Creating the Column Families==
 
Complete the following procedure on one node in your Cassandra cluster.
 
  
'''Start of Procedure'''
 
 
<ol>
 
<li>Copy the <tt>cf-schema.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
 
<li>Run the following command to create the Cassandra schema:</li>
 
<nowiki>[cassandra install dir]/bin/cassandra-cli  -h [cassandra host] --file cf-schema.txt</nowiki>
 
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
 
</ol>
 
 
'''End of Procedure'''<br/><br/>
 
'''Next Steps'''<br/>
 
*[[DeployWebApp|Deploy the Web Application]]
 
 
|-|
 
|-|
  
Two Datacenters=
+
Two Data Centers=
===Creating the Cassandra Keyspace (2 datacenters)===
+
===Creating the Cassandra keyspace (2 data centers)===
 
Complete the following procedure on one node in your Cassandra cluster.
 
Complete the following procedure on one node in your Cassandra cluster.
  
'''Start of Procedure'''
+
'''Start'''
  
 
<ol>
 
<ol>
<li>Copy the <tt>ks-schema-prod_HA.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
+
<li>Copy the '''ks-schema-prod_HA.cql''' file from '''''/installation_path/gws/data''''' to the Cassandra node host.</li>
 
<li>Modify the following line:
 
<li>Modify the following line:
<pre>with strategy_options ={ AZ1 : 3, AZ2 : 3 }</pre>
+
<source lang="text">
 +
with strategy_options ={ AZ1 : 3, AZ2 : 3 }
 +
</source></li>
 
<ol type="a">
 
<ol type="a">
<li>Add the datacenter name. You can use nodetool to find the name of the datacenter by examining the output of "nodetool ring" (the tool is located in the <tt>bin</tt> directory of Cassandra). The following is sample output from the nodetool:</li>
+
<li>Add the data center name. You can use nodetool to find the name of the data center by examining the output of "nodetool ring" (the tool is located in the '''bin''' directory of Cassandra). The following is sample output from the nodetool:
<nowiki>/genesys/apache-cassandra-1.1.6/bin$ ./nodetool ring
+
<source lang="text">
 +
nodetool ring
 
Address        DC          Rack  Status  State  Load      Owns    Token
 
Address        DC          Rack  Status  State  Load      Owns    Token
 
192.0.2.10    datacenter1  rack1  Up      Normal  14.97 MB  100.00%  0
 
192.0.2.10    datacenter1  rack1  Up      Normal  14.97 MB  100.00%  0
Line 101: Line 85:
 
198.51.100.11  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  56713727820156410577229101238628035242
 
198.51.100.11  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  56713727820156410577229101238628035242
 
192.0.2.12    datacenter1  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484
 
192.0.2.12    datacenter1  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484
198.51.100.12  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484</nowiki>
+
198.51.100.12  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484
<li>Add the replication factor. Refer to the [http://www.datastax.com/documentation/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html Cassandra documentation] for more information about replication factors.</li>
+
</source></li>
 +
<li>Add the replication factor. Refer to the {{#Widget:ExtLink|link=https://docs.datastax.com/en/archived/cassandra/1.2/cassandra/architecture/architectureDataDistributeReplication_c.html|displaytext=Cassandra documentation}} for more information about replication factors.</li>
 
</ol>
 
</ol>
Based on the nodetool output above, your line might be: <pre>with strategy_options ={ datacenter1 : 3, datacenter2 : 3 }</pre>
+
Based on the nodetool output above, your line might be:  
 +
<source lang="text">
 +
with strategy_options ={ datacenter1 : 3, datacenter2 : 3 }
 +
</source></li>
 +
<li>Create the Cassandra schema. Choose one of the following options:
 +
<ul><li>If you are using Web Services and Applications v8.5.2.## or later, run the following command:
 +
<tt>cqlsh ''cassandra_host'' --file ks-schema-prod_HA.cql</tt></li>
 +
<li>If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command:
 +
<tt>''cassandra_install_dir''/bin/cassandra-cli -h ''cassandra_host'' --file ks-schema-prod_HA.txt</tt><br></li>
 +
</ul>
 +
<tt>''cassandra_host''</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node.</li>
 
</li>
 
</li>
<li>Run the following command to create the Cassandra schema:</li>
 
<nowiki>[cassandra install dir]/bin/cassandra-cli  -h [cassandra host] --file ks-schema-prod_HA.txt</nowiki>
 
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
 
 
</ol>
 
</ol>
'''End of Procedure'''<br/><br/>
+
'''End'''
'''Next Steps'''<br/>
+
</tabber>
*Creating the Column Families
 
  
==Creating the Column Families==
+
==Creating the column families==
 
Complete the following procedure on one node in your Cassandra cluster.
 
Complete the following procedure on one node in your Cassandra cluster.
  
'''Start of Procedure'''
+
'''Start'''
  
 
<ol>
 
<ol>
<li>Copy the <tt>cf-schema.txt</tt> file from <tt>[installation_CD]/data</tt> to the Cassandra node host.</li>
+
<li>Copy the '''cf-schema.cql''' file from '''''/installation_path/gws/data''''' to the Cassandra node host.</li>
<li>Run the following command to create the Cassandra schema:</li>
+
<li>Run one of the following commands to create the Cassandra schema:
<nowiki>[cassandra install dir]/bin/cassandra-cli -h [cassandra host] --file cf-schema.txt</nowiki>
+
<ul>
* <tt>[cassandra host]</tt> is the host name (fully qualified domain name) or IP address of the Cassandra node
+
<li>If you are using Web Services and Applications v8.5.2.## or later, run the following command: </li>
 +
<tt>cqlsh ''cassandra_host'' --file cf-schema.cql</tt></li>
 +
<li>If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command: </li>
 +
<tt>''cassandra_install_dir''/bin/cassandra-cli -h ''cassandra_host'' --file cf-schema.txt</tt></li>
 +
</ul></li>
 
</ol>
 
</ol>
  
'''End of Procedure'''<br/><br/>
+
'''End'''
'''Next Steps'''<br/>
+
 
*[[DeployWebApp|Deploy the Web Application]]
+
==Next step==
</tabber>
+
*[[Documentation:HTCC:Dep:StartHTCC|Starting and Testing Web Services]]
  
 
[[Category:V:HTCC:8.5.2]]
 
[[Category:V:HTCC:8.5.2]]

Latest revision as of 16:08, August 2, 2018

Initializing Cassandra

Creating the Cassandra keyspace

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 Data Center — 1 data center with a minimum of three Cassandra nodes
  • Two Data Centers — 2 data centers with a minimum of three Cassandra nodes in each data center
Important
For more complex Cassandra deployments, please consult with Genesys.

Select a tab below for the procedure that matches your deployment scenario.

Creating the Cassandra keyspace (1 Cassandra node)

Start

  1. Copy the ks-schema-local.cql file from /installation_path/gws/data to the Cassandra node host.
  2. By default, the replication factor is set to 1. Since this is a single node deployment, you don't need to modify this value. Refer to the Cassandra documentation for more information about replication factors.
  3. and strategy_options = {replication_factor : 1}
  4. Create the Cassandra schema. Choose one of the following options:
    • If you are using Web Services and Applications v8.5.2.## or later, run the following command: cqlsh cassandra_host --file ks-schema-local.cql
    • If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command: cassandra_install_dir/bin/cassandra-cli -h cassandra_host --file ks-schema-local.txt
      ...where cassandra_host is the host name (fully qualified domain name) or IP address of the Cassandra node.

End

Creating the Cassandra keyspace (1 data center)

Complete the following procedure on one node in your Cassandra cluster.

Start

  1. Copy the ks-schema-prod.cql file from /installation_path/gws/data to the Cassandra node host.
  2. For fault tolerance, Genesys recommends that you use at least 3 Cassandra nodes and set the replication factor to 3. Refer to the Cassandra documentation for more information about replication factors. To modify this value, change the following line:
    and strategy_options = {replication_factor : <replication-factor-in-your-lab>}
  3. Create the Cassandra schema. Choose one of the following options:
    • If you are using Web Services and Applications v8.5.2.## or later, run the following command: cqlsh cassandra_host --file ks-schema-prod.cql
    • If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command: cassandra_install_dir/bin/cassandra-cli -h cassandra_host --file ks-schema-prod.txt
    cassandra_host is the host name (fully qualified domain name) or IP address of the Cassandra node.

End

Creating the Cassandra keyspace (2 data centers)

Complete the following procedure on one node in your Cassandra cluster.

Start

  1. Copy the ks-schema-prod_HA.cql file from /installation_path/gws/data to the Cassandra node host.
  2. Modify the following line:
    with strategy_options ={ AZ1 : 3, AZ2 : 3 }
    1. Add the data center name. You can use nodetool to find the name of the data center by examining the output of "nodetool ring" (the tool is located in the bin directory of Cassandra). The following is sample output from the nodetool:
      nodetool ring
      Address        DC           Rack   Status  State   Load      Owns     Token
      192.0.2.10     datacenter1  rack1  Up      Normal  14.97 MB  100.00%  0
      198.51.100.10  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  100
      192.0.2.11     datacenter1  rack1  Up      Normal  14.97 MB  100.00%  56713727820156410577229101238628035242
      198.51.100.11  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  56713727820156410577229101238628035242
      192.0.2.12     datacenter1  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484
      198.51.100.12  datacenter2  rack1  Up      Normal  14.97 MB  100.00%  113427455640312821154458202477256070484
    2. Add the replication factor. Refer to the Cassandra documentation for more information about replication factors.

    Based on the nodetool output above, your line might be:

    with strategy_options ={ datacenter1 : 3, datacenter2 : 3 }
  3. Create the Cassandra schema. Choose one of the following options:
    • If you are using Web Services and Applications v8.5.2.## or later, run the following command: cqlsh cassandra_host --file ks-schema-prod_HA.cql
    • If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command: cassandra_install_dir/bin/cassandra-cli -h cassandra_host --file ks-schema-prod_HA.txt
    cassandra_host is the host name (fully qualified domain name) or IP address of the Cassandra node.

End

Creating the column families

Complete the following procedure on one node in your Cassandra cluster.

Start

  1. Copy the cf-schema.cql file from /installation_path/gws/data to the Cassandra node host.
  2. Run one of the following commands to create the Cassandra schema:
    • If you are using Web Services and Applications v8.5.2.## or later, run the following command:
    • cqlsh cassandra_host --file cf-schema.cql
    • If you are using Web Services and Applications v8.5.2.41 or earlier, run the following command:
    • cassandra_install_dir/bin/cassandra-cli -h cassandra_host --file cf-schema.txt

End

Next step

This page was last edited on August 2, 2018, at 16:08.
Comments or questions about this documentation? Contact us for support!