Revision as of 11:53, November 8, 2016 by Mlevy (talk | contribs) (Migrating an Existing Elasticsearch Deployment to Schema V2)
Jump to: navigation, search

Elasticsearch

Interaction Recording Web Services (RWS) 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.

Migrating an Existing Elasticsearch Deployment to Schema V2

Important
The following procedure should only be performed once per contact center (that is, for each contact center tenant in a multi-tenant deployment). This procedure should not be performed for a new GIR installation.

Perform the following steps while your system is running, without service interruption.

  1. Copy the call_recordingv2_template.json and screen_recordingv2_template.json files from the installation_CD/elasticsearch/templates/ folder to the templates folder in each node in your Elasticsearch cluster.
  2. Perform a rolling restart of each node in your Elasticsearch cluster. Stop and restart each node and wait until it is restarted and is operational before stopping and restarting the next node.
  3. Select one Interaction Recording Web Services node, and do one of the following:
  4. Important
    The application.yaml file on the RWS node must be set with the correct region information in the crRegion parameter within the serverSettings Call Recording section. This configuration is used as part of the new index name.
  • Prepare a new dedicated Interaction Recording Web Services node as follows:
    1. Install Interaction Recording Web Services in the same way a regular Interaction Recording Web Services node is installed. Do not add this node to the Interaction Recording Web Services Load Balancer.
    2. Edit the Interaction Recording Web Services application.yaml file, by adding the following configuration. Verify that you add lines under nodes for all the existing Interaction Recording Web Services nodes in your deployment:
          
      <pre>elasticSearchSettings:
        useTransportClient: true
        transportClient:
            nodes:
                - {host: <web-services-node1>, port: 9300}
                - {host: <web-services-node2>, port: 9300}
                - {host: <web-services-node3>, port: 9300}
            useSniff: true
            ignoreClusterName: true
            pingTimeout: 10000
            nodesSamplerInterval: 10000
        enableIndexVerificationAtStartUp: false
        indexPerContactCenter: true</pre>
  • Increase the Hyxtrix timeout for RecordingOperationApiTaskV by adding the following line to the Hyxtrix configuration:
    hystrix.command.RecordingOperationApiTaskV2.execution.isolation.thread.timeout.timeoutInMilliseconds=<max time acceptable in milliseconds>
  • Important
    <max time acceptable in milliseconds> should be 3 times the the period being indexed or more.
  • Restart Interaction Recording Web Services, navigate to the following URL and wait until it returns the Interaction Recording Web Services version:
    http://<selected-web-services-node>:<web-services-listening-port>/api/v2/diagnostics/version
  • Determine the Contact Center ID using the following command:
    curl -u <ops-user>:<ops-pass> http://<selected-RWS-node>:<RWS-listening-port>/api/v2/ops/contact-centers; echo


    The following output is returned:

    {"statusCode":0,"uris":["http://< selected-RWS-services-node>:<RWS-listening-port>/api/v2/ops/contact-centers/<contact-center-id>"]}








  • 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. In the installation_CD/elasticsearch/ directory there is a templates folder. Copy the templates folder and its .json file contents to the config folder of Elasticsearch in each node in your Elasticsearch cluster. If you use the .rpm for Elasticsearch, this would be /etc/elasticsearch/ as the config folder. If you use the gzipped tarball, this would be under the $installDir/config.
    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.
    7. Important
      The Elasticsearch engine requires a large Metaspace space. To increase the Metaspace space, add the following to your JAVA_OPTIONS:
      JAVA_OPTIONS="-XX:MaxMetaspaceSize=512m -Djsse.enableSNIExtension=false"

    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: <Elasticsearch installation 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
      Do not forget to update <Elasticsearch installation path> to the appropriate value.
    4. In your new elasticsearch folder, add a new subfolder called templates. For example: ir-web-services/elasticsearch/templates
    5. Copy the templates folder and its .json file contents to the config folder of Elasticsearch in each node in your Elasticsearch cluster. If you use the .rpm for Elasticsearch, this would be /etc/elasticsearch/ as the config folder. If you use the gzipped tarball, this would be under the $installDir/config.
    6. 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.
    7. 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.
    8. Set the elasticSearchSettings option to appropriate values for your environment.
    9. Important
      The Elasticsearch engine requires a large Metaspace space. To increase the Metaspace space, add the following to your JAVA_OPTIONS:
      JAVA_OPTIONS="-XX:MaxMetaspaceSize=512m -Djsse.enableSNIExtension=false"

    Next Step

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