Revision as of 11:15, September 18, 2016 by Mlevy (talk | contribs) (Complete the following steps for each Interaction Recording Web Services node)
Jump to: navigation, search

Elasticsearch

Interaction Recording Web Services uses Elasticsearch — an open-source, full-text search engine with a RESTful web interface — to store historical statistics as time-based events.

For new deployments, Genesys recommends that you set up a cluster of Elasticsearch nodes that is separate from your Interaction Recording Web Services nodes. See Configuring Interaction Recording Web Services to Use a Standalone Elasticsearch Cluster for details. It's possible to set up an embedded Elasticsearch cluster, which means that Elasticsearch is included in your Interaction Recording Web Services nodes. See Configuring Interaction Recording Web Services to Use an Embedded Elasticsearch Cluster for details.

Configuring Interaction Recording Web Services to Use a Standalone Elasticsearch Cluster

You can configure Interaction Recording Web Services to work with a standalone Elasticsearch cluster by completing the steps below.

Important
Contact your Genesys representative for information about how to migrate from embedded to standalone. For additional information, refer to the latest stable 1.x version of Elasticsearch

Prerequisites

Verify that a cluster of Elasticsearch nodes have been deployed and configured. Refer to the Elasticsearch documentation for details.

Complete the following steps for each Interaction Recording Web Services node

  1. Copy the sample elasticsearch.yml file from the installation_CD/elasticsearch/templates/ folder, to the Elasticsearch configuration folder on a standalone machine. Perform this step for each node in your Elasticsearch cluster.
  2. Open the elasticsearch.yml configuration file in a text editor and verify that the following lines are included in the file:
    index.analysis.analyzer.whitespace_lowercase.tokenizer: whitespace
    index.analysis.analyzer.whitespace_lowercase.filter: lowercase
    threadpool.index.queue_size: -1
    threadpool.bulk.queue_size: -1
    path.conf: <Elasticsearch installation path>
    path.data: <Elasticsearch installation path>/esdata
    transport.tcp.port: 9200
    http.port: 9300
    discovery.zen.ping.multicast.enabled: false
    discovery.zen.ping.unicast.hosts: <comma separated list of ElasticSearch nodes>
    discovery.zen.minimum_master_nodes: 2
    gateway.recover_after_nodes: 2
    gateway.recover_after_time: 1m
    gateway.expected_nodes: 3
  3. Copy all the files from the installation_CD/elasticsearch/templates/ folder to the templates folder of each node in your Elasticsearch cluster.
  4. Set the crClusterName option to the name of the cluster. All Interaction Recording Web Services nodes with the same cluster name will form the cluster.
  5. Set the enableElasticSearchIndexing option to true. Note: In this case, Interaction Recording Web Services writes statistics values to both Elasticsearch and Cassandra, but only reads them from Elasticsearch.
  6. Set the elasticSearchSettings option to appropriate values for your environment.

Configuring Interaction Recording Web Services to Use an Embedded Elasticsearch Cluster

You can configure Interaction Recording Web Services to work with an embedded Elasticsearch cluster by completing the steps below.

Important
Contact your Genesys representative for information about how to migrate from embedded to standalone. For additional information, refer to the latest stable 1.x version of Elasticsearch

Complete the following steps for each Interaction Recording Web Services node that you want to host Elasticsearch

  1. Install Elasticsearch on each Interaction Recording Web Services node.
  2. Copy the sample elasticsearch.yml file from the installation_CD/elasticsearch/templates/ folder, to the Elasticsearch configuration folder on the Interaction Recording Web Services node. Perform this step for each node in your Elasticsearch cluster.
  3. Open the elasticsearch.yml configuration file in a text editor and verify that the following lines are included in the file: Note: <absolute_path> refers to the location on which Elasticsearch has been installed.
    index.analysis.analyzer.whitespace_lowercase.tokenizer: whitespace
    index.analysis.analyzer.whitespace_lowercase.filter: lowercase
    threadpool.index.queue_size: -1
    threadpool.bulk.queue_size: -1
    path.conf: <Elasticsearch installation path>
    path.data: <Elasticsearch installation path>/esdata
    transport.tcp.port: 9200
    http.port: 9300
    discovery.zen.ping.multicast.enabled: false
    discovery.zen.ping.unicast.hosts: <comma separated list of ElasticSearch nodes>
    discovery.zen.minimum_master_nodes: 2
    gateway.recover_after_nodes: 2
    gateway.recover_after_time: 1m
    gateway.expected_nodes: 3
    Don't forget to update <absolute_path_to_web_services_home/elasticsearch> and <absolute_path> to the appropriate values.
  4. In your new elasticsearch folder, add a new subfolder called templates. For example: ir-web-services/elasticsearch/templates
  5. Copy all the files from the installation_CD/elasticsearch/templates/ to your new /elasticsearch/templates folder.
  6. Set the crClusterName option to the name of the cluster. All Interaction Recording Web Services Web Services nodes with the same cluster name will form the cluster.
  7. Set the enableElasticSearchIndexing option to true. Note: In this case, Interaction Recording Web Services Web Services writes statistics values to both Elasticsearch and Cassandra, but only reads them from Elasticsearch.
  8. Set the elasticSearchSettings option to appropriate values for your environment.

Migrating an Existing ElasticSearch Deployment to Schema V2

  1. Perform a re-index.
    The steps are outlined in the Troubleshooting page under the How do I restore the Find Recordings capability? question.
    Note: Perform only steps 1 to 3.
  2. Perform the following steps for each contact center and recording type (for example, call recording or screen recording) being upgraded:
    1. Turn on the appropriate schema migration feature flag for the index being migrated:
      • Call Recording: schema-elasticsearch-migration-to-v2-call-recording
      • Screen Recording: schema-elasticsearch-migration-to-v2-screen-recording.
    2. Without pause from the previous step, perform step 4 (Perform Re-indexing) under the How do I restore the Find Recordings capability? question in the Troubleshooting page. and verify that the purgeOld flag is set to true for the initial invocation.
      Once you complete this step the new migration schema index building phase has already started.
    3. Perform re-indexing repeatedly with different to and from entries until you cover the complete time period of all recordings made to the call center up to and including the time noted in the previous step.
    4. Set the purgeOld flag to false for subsequent invocations.
    5. Turn on the appropriate schema feature flag for the index being migrated:
      • Call Recording: schema-elasticsearch-v2-call-recording
      • Screen Recording: schema-elasticsearch-v2-screen-recording.
      Once you complete this step new migration schema index building phase is complete and the old migration schema phase has started.
      Note: All new recordings that are posted during this phase will also be found in the old schema index. That is, re-indexing will not be required during rollback.
    6. Perform a search to verify that the search works correctly for full period of time in which recordings were made.
    7. Turn off the schema migration feature flag for the index being migrated (Optional):
      • Call Recording: schema-elasticsearch-migration-to-v2-call-recording
      • Screen Recording: schema-elasticsearch-migration-to-v2-screen-recording.
      Once you complete this step, the old schema index file is no longer maintained.
    8. Run the following code to delete the old index: curl -XDELETE http://<es-node>:9200/<index-name>
      • <es-node>: The node on which Elasticsearch is hosted.
      • <index-name>: The index name for the original schema.
      • {ccid}: for call recording on embedded Elasticsearch deployments and/or call-recording for nonembedded Elasticsearch deployments.
      • screen-recording-{ccid}: for screen recording.
      Note: Once you complete this step you cannot rollback.


Rollback and Elasticsearch Deployment

  1. Turn off the feature flags for the new schema:
    • schema-elasticsearch-migrating-to-v2-call-recording
    • schema-elasticsearch-v2-call-recording
    • schema-elasticsearch-migrating-to-v2-screen-recording
    • schema-elasticsearch-v2-screen-recording
  2. Delete the new index.
    Note: Since the original schema index file was not deleted, searches are immediately supported without re-indexing.
    If the schema migration feature flag for the index being migrated was turned off (step 2f in previous section) during the upgrade, you must re-index without purging the index to index any recordings that were posted after the schema migration feature flag for the index being migrated was turned off.

Next Step

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