Installing a Cluster

Installing a cluster involves setting up one Spectrum Technology Platform server at a time.

It is recommend to have at least 3 nodes in a cluster. The smallest fault tolerant cluster is a cluster that can tolerate one lost server. This requires a minimum of three Core instances. Both a three-server cluster and a four-server cluster can tolerate a maximum of one lost server. It is recommended in order to tolerate two failed Core instances, you need to deploy a cluster of five Core instances.

Before you begin, install an appropriate load balancer. Follow the procedures described in the load balancer documentation when installing.

Note: The load balancer must be configured to allow encoded forward slashes. If the load balancer does not allow encoded forward slashes you may get HTTP 404 errors while using the cluster. For example, if you are using an Apache load balancer, you can configure it to allow encoded forward slashes by opening the httpd.conf file and specifying this property: AllowEncodedSlashes On. For other types of load balancers, refer to the load balancer documentation.

Once you have your load balancer installed, follow these steps to install nodes in the cluster.

  1. Install Spectrum Technology Platform on each node in the cluster.
    For instructions, see Installing a New Server.For instructions, see Installing a New Server.
    Important: The installer will provide the option to auto start Spectrum Technology Platform server. By default this option is not selected. Do not enable this option if installing a clustered environment.
    Important: Do not start the server when the installation completes. You must complete the following steps before starting the server.
  2. On each node, configure settings in the spectrum-container.properties file.
    1. Edit the properties in file SpectrumDirectory/server/conf/spectrum-container.propertiesSpectrumDirectory\server\conf\spectrum-container.properties, as described in Cluster Properties.
    2. Save and close the spectrum-container.properties file.
    3. Some modules have module-specific settings that you must configure to enable the module to work in a cluster.
      Module Cluster Configuration Settings
      Advanced Matching These settings configure clustering for full-text search indexes. If you do not use full-text search indexes you do not need to configure these settings.

      Open this file in a text editor:

      SpectrumDirectory/server/modules/searchindex/es-container.propertiesSpectrumDirectory\server\modules\searchindex\es-container.properties

      Configure these properties:

      es.index.default_number_of_replicas
      Enter the number of additional copies you want created for each search index. This number should be the number of nodes in your cluster minus 1. For example, if your cluster has five nodes, you would enter "4" in this property.
      es.index.default_number_of_shards
      Enter the number of shards you want your index to have in the distributed environment. The more nodes that are in your cluster, the higher this number should be.
      Save and close es-container.properties when you are done editing these properties.
      Context Graph

      Context Graph models are stored on an external Neo4j Graph Database Server. For instructions about how to configure and connect to Neo4j Graph Database Server in a clustered configuration, see Installing a Cluster for Context Graph.

  3. On each node, configure settings for Elasticsearch.
    1. Open the file SpectrumDirectory/index/elasticsearch.templateSpectrumDirectory\index\elasticsearch.template and scroll down to the Node Address section.
    2. Insert the hash character # to comment out the following line:
      # cluster.initial_master_nodes: ${initial_master_node}
    3. Remove the hash character # and the space after it to uncomment the following line:
      cluster.initial_master_nodes: ${seeds}
      Important: Make sure that there is no space at the beginning of the line so that the code starts in column 1.

      Then edit it to specify the node names in the cluster:

      cluster.initial_master_nodes: node-1,node-2,node-3,...
      Important: This setting must be uncommented when you start the cluster for the first time.
  4. Confirm the following settings on each node in the cluster.
    • SpectrumDirectory/repository/neo4j.templateSpectrumDirectory\repository\neo4j.template
      dbms.active_database=graphdb
      dbms.default_database=graphdb
      dbms.default_listen_address=0.0.0.0
      causal_clustering.discovery_advertised_address=${spectrum.agent.address}
      causal_clustering.enable_pre_voting=false
      dbms.routing.enabled=true
      dbms.routing.listen_address=0.0.0.0
      dbms.routing.advertised_address=${spectrum.agent.address}
    • SpectrumDirectory/server/conf/spectrum-container.propertiesSpectrumDirectory\server\conf\spectrum-container.properties
      spectrum.repository.cluster.mode=CAUSAL
      Note: The spectrum.repository.cluster.mode setting shown here is for the Spectrum Technology Platform server running in a cluster.
  5. Start each server in the cluster.
    To start a server, right-click the Spectrum Technology Platform icon on the Windows task bar, and click Start Spectrum. Do not wait for one node to start before starting another node. All nodes must be started at the same time.
    For more information, see Starting a Cluster.
  6. On each node, open the SpectrumDirectory/index/elasticsearch.templateSpectrumDirectory\index\elasticsearch.template file, insert the hash character # to comment out the following line:
    # cluster.initial_master_nodes: node-1,node-2,node-3,...
    Important: This setting must be commented out after you start the cluster for the first time. It should remain commented out for all subsequent restarts of the cluster, as Elasticsearch handles adding and removing nodes after the cluster is started initially.