Full HA Install

Full HA Install Overview

  • App Host(s) with Distributed Services (Full HA)

    Application tier is installed on one or more hosts. All UI hosts point to externalized Transactional Database, Non-Transactional Database, and Message Tiers. The reconfigure process installs only Application services.

../../../../_images/FullDistributedSingleSite.png

Minimum Nodes

For Full High-Availability configurations, RabbitMQ, Elasticsearch and mySQL(Galera/Percona) must be configured in minimum 3 Node Clusters, and 2 or more App Nodes are required.

Note

VM requirements assume local services. VM count requirements are not applicable when using hosted services such as AWS RDS mySQL.

Minimum 11 Nodes
  • 2+ Application Hosts

  • 3 Node RabbitMQ Cluster

  • 3 Node Elasticsearch Cluster

  • 3 Node Galera/Percona Cluster

Important

Asynchronous Active/Active and Active/Passive Database configurations are not supported for HA configurations. A minimum 3 node mySQL Cluster with synchronous multi-master replication is required for Database Clusters. Morpheus recommends Percona XtraDB Clusters with synchronous multi-master replication. Asynchronous Active/Passive can be used but is not considered an HA configuration.

Important

For Clusters with more than 3 Nodes, always use an odd number of nodes (3,5,7 etc) to ensure Quorum.

Shared Storage

For configurations with 2 or more Applications Nodes, Shared Storage is required between the app nodes for /var/opt/morpheus/morpheus-ui/*. Local Storage File Shares will need to be copied to a shared file system so all assets are available on all App nodes.

Shared Assets

  • Logos

  • Uploaded Virtual Images

  • Deployment Uploads

  • Ansible

  • Terraform

  • Morpheus Backups

Note

Backups, deployment and virtual image storage locations can be overridden within the Morpheus-ui.

Port Requirements

Service

Source

Destination

Port(s)

Morpheus

Application Node

mySQL

3306

Morpheus

Application Node

Elasticsearch

9200; 9300

Morpheus

Application Node

RabbitMQ

5672; 61613

Morpheus

Application Node

YUM or APT

443

Elasticsearch

Elasticsearch

Elasticsearch

9200; 9300

mySQL

mySQL

mySQL

3306;4444;4567;4560

RabbitMQ

RabbitMQ

RabbitMQ

5672 or 5671(SSL); 61613 or 61614(SSL)

Default Locations

Morpheus follows several install location conventions. Below is a list of system defaults for convenient management:

  • Installation Location: /opt/morpheus

  • Log Location: /var/log/morpheus

    • Morpheus-UI: /var/log/morpheus/morpheus-ui

    • NGINX: /var/log/morpheus/nginx

    • Check Server: /var/log/morpheus/check-server

  • User-defined install/config: /etc/morpheus/morpheus.rb

Percona XtraDB Cluster

Out of the box Morpheus uses MySQL but Morpheus supports any mySQL compliant database. There are many ways to set up a highly available, MySQL dialect based database. One which has found favor with many of our customers is Percona’s XtraDB Cluster. Percona’s product is based off of Galera’s WSREP Clustering, which is also supported.

Important

Currently, you must use a v5.7-compatible version of MySQL/Percona. Complete compatibility information is available in the Compatibility and Breaking Changes page. Additional configuration for Percona Clusters with TLS enabled is required. Refer to Percona XtraDB Cluster with TLS Configuration in our full HA docs for details.

Requirements

Note

Morpheus idiomatically connects to database nodes over 3306

Once you have your database installed and configured:

  1. The Morpheus appliance uses the utf8 character set and the UTC+0 timezone. Set the variables below on your external database clusters to prevent timestamp errors from being thrown later in Morpheus UI. For all distributions, the configuration is set in /etc/my.cnf for each database node.

    [mysql]
    default-character-set = utf8
    
    [mysqld]
    default_time_zone = "+00:00"
    
  2. Create the Database you will be using with morpheus.

    mysql> CREATE DATABASE morpheus CHARACTER SET utf8 COLLATE utf8_general_ci;
    
    mysql> show databases;
    
  3. Next create your morpheus database user. The user needs to be either at the IP address of the morpheus application server or use @'%' within the user name to allow the user to login from anywhere.

    mysql> CREATE USER '$morpheus_db_user_name'@'$source_ip' IDENTIFIED BY '$morpheus_db_user_pw';
    
  4. Next Grant your new morpheus user permissions to the database.

    mysql> GRANT ALL PRIVILEGES ON morpheus_db_name.* TO 'morpheus_db_user'@'$source_ip' IDENTIFIED BY 'morpheus_db_user_pw' with grant option;
    
    
    mysql>  GRANT SELECT, PROCESS, SHOW DATABASES, SUPER ON *.* TO 'morpheus_db_user'@'$source_ip' IDENTIFIED BY 'morpheus_db_user_pw';
    
    mysql> FLUSH PRIVILEGES;
    
  5. Checking Permissions for your user.

    SHOW GRANTS FOR '$morpheus_db_user_name'@'$source_ip';
    

RabbitMQ Cluster

An HA deployment will also include a Highly Available RabbitMQ. This can be achieved through RabbitMQ’s HA-Mirrored Queues on at least 3, independent nodes. To accomplish this we recommend following Pivotal’s documentation on RabbitMQ here: https://www.rabbitmq.com/ha.html and https://www.rabbitmq.com/clustering.html

Install RabbitMQ on the 3 nodes and create a cluster.

Note

For the most up to date RPM package we recommend using this link: :link: https://www.rabbitmq.com/install-rpm.html#downloads

Important

Morpheus connects to AMQP over 5672 or 5671(SSL) and 61613 or 61614(SSL)

RabbitMQ Installation and Configuration

Important

This is a sample configuration only. Customer configurations and requirements will vary.

RabbitMQ requires Erlang to be installed, the exact version will depend on which version of RabbitMQ you’re installing on your queue-tier nodes. Click the link below to expand a compatibility table for RabbitMQ and Erlang. Note that Morpheus is compatible with RabbitMQ 3.5.x and higher, however, versions 3.7.x and earlier have reached their end of life and RabbitMQ does not encourage their use. If needed, a compatibility table for these sunsetted versions is in RabbitMQ documentation.

RabbitMQ/Erlang Compatibility Table

RabbitMQ Version

Minimum Required Erlang/OTP

Maximum Supported Erlang/OTP

3.9.0

23.2

24.x

3.8.16 - 3.8.19

23.2

24.x

3.8.9 - 3.8.15

22.3

23.x

3.8.4 - 3.8.8

21.3

23.x

3.8.0 - 3.8.3

21.3

22.x


  1. Install epel-release and erlang

    yum install epel-release
    yum install erlang
    
  2. Install RabbitMQ on all 3 Nodes

    wget https://dl.bintray.com/rabbitmq/rabbitmq-server-rpm/rabbitmq-server-3.6.12-1.el7.noarch.rpm
    
    rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
    
    yum -y install rabbitmq-server-3.6.12-1.el7.noarch.rpm
    
    chkconfig rabbitmq-server on
    
    rabbitmq-server -detached
    
  3. Copy the erlang.cookie from Node 1

    cat /var/lib/rabbitmq/.erlang.cookie
    

    # Copy the .erlang.cookie value

  4. Overwrite /var/lib/rabbitmq/.erlang.cookie on Nodes 2 & 3 with value from Node 1 and change its permissions using the follow commands:

    chown rabbitmq:rabbitmq /var/lib/rabbitmq/*
    chmod 400 /var/lib/rabbitmq/.erlang.cookie
    
  5. Edit /etc/hosts file on all 3 nodes to refer to shortnames of the other nodes

    Example for node 1 (adjust for nodes 2 and 3):

    vi /etc/hosts
    
     10.30.20.101 rabbit-2
     10.30.20.102 rabbit-3
    
  6. Run the following commands on Node 2 and on Node 3 to join them to the Cluster:

    rabbitmqctl stop
    rabbitmq-server -detached
    rabbitmqctl stop_app
    rabbitmqctl join_cluster rabbit@<<node 1 shortname>>
    rabbitmqctl start_app
    
  7. On Node 1, create vhost and add Admin user for Morpheus

    rabbitmqctl add_vhost morpheus
    rabbitmqctl add_user <<admin username>> <<password>>
    rabbitmqctl set_permissions -p morpheus <<admin username>> ".*" ".*" ".*"
    rabbitmqctl set_user_tags <<admin username>> administrator
    
  8. On All Nodes, enable stomp and management plugins:

    rabbitmq-plugins enable rabbitmq_stomp
    rabbitmq-plugins enable rabbitmq_management
    
  9. On Node 1, add the required Rabbitmq Policies. The policies will propagate to all nodes.

    rabbitmqctl set_policy -p morpheus --apply-to queues --priority 2 statCommands "statCommands.*" '{"expires":1800000, "ha-mode":"all"}'
    rabbitmqctl set_policy -p morpheus --apply-to queues --priority 2 morpheusAgentActions "morpheusAgentActions.*" '{"expires":1800000, "ha-mode":"all"}'
    rabbitmqctl set_policy -p morpheus --apply-to queues --priority 2 monitorJobs "monitorJobs.*" '{"expires":1800000, "ha-mode":"all"}'
    rabbitmqctl set_policy -p morpheus --apply-to all --priority 1 ha ".*" '{"ha-mode":"all"}'
    

Elasticsearch

Sample Install of 3 node Elasticsearch Cluster on CentOS 7

Important

This is a sample configuration only. Customer configurations and requirements will vary.

Important

Morpheus v4.1.2+ requires Elasticsearch v7.x.

Requirements

  1. Three Existing CentOS 7+ nodes accessible to the Morpheus Appliance

  2. Install Java on each node

    You can install the latest OpenJDK with the command:

    sudo yum install java-1.8.0-openjdk.x86_64
    

    To verify your JRE is installed and can be used, run the command:

    java -version
    

    The result should look like this:

    Output of java -version
    openjdk version "1.8.0_65"
    OpenJDK Runtime Environment (build 1.8.0_65-b17)
    OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
    

Install Elasticsearch 7.x

Important

This is an example Elasticsearch Upgrade for reference only, and is not indicative of the upgrade procedure for every environment/user/customer/configuration.

  1. On each ES node run the following to install Elasticsearch.

    rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    
    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-x86_64.rpm
    
    sudo rpm -Uhv elasticsearch-7.6.2-x86_64.rpm
    
  2. If necessary, update permissions for the specified log and data paths

    sudo chown -R elasticsearch:elasticsearch /var/log/elasticsearch/
    sudo chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/
    
  3. Edit /etc/elasticsearch/elasticsearch.yml and update each nodes configurations accordingly. Please note several attributes differ in 7.x from 5.x.

    Node 1 Example (customer configurations will vary)

    sudo vi /etc/elasticsearch/elasticsearch.yml
    
          #Sample elasticsearch.yml config. Adjusting values in elasticsearch.yml for each node in the cluster.
          #Note: Sample only, user configurations and requirements will vary.
    
          node.name: "es-node-01" ##unique name of this node
          network.host: 10.30.22.152 ##ip of this node
          http.port: 9200
          discovery.seed_hosts: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          cluster.initial_master_nodes: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          path.logs: /var/log/elasticsearch ## Or your preferred location.
          path.data: /usr/share/elasticsearch/ ## Or your preferred location.
          discovery.zen.minimum_master_nodes: 2
    

    Node 2 Example (customer configurations will vary)

    sudo vi /etc/elasticsearch/elasticsearch.yml
    
          #Sample elasticsearch.yml config. Adjusting values in elasticsearch.yml for each node in the cluster.
          #Note: Sample only, user configurations and requirements will vary.
    
          node.name: "es-node-02" ##unique name of this node
          network.host: 10.30.22.153 ##ip of this node
          http.port: 9200
          discovery.seed_hosts: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          cluster.initial_master_nodes: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          path.logs: /var/log/elasticsearch ## Or your preferred location.
          path.data: /usr/share/elasticsearch/ ## Or your preferred location.
          discovery.zen.minimum_master_nodes: 2
    

    Node 3 Example (customer configurations will vary)

    sudo vi /etc/elasticsearch/elasticsearch.yml
    
          #Sample elasticsearch.yml config. Adjusting values in elasticsearch.yml for each node in the cluster.
          #Note: Sample only, user configurations and requirements will vary.
    
          node.name: "es-node-03" ##unique name of this node
          network.host: 10.30.22.154 ##ip of this node
          http.port: 9200
          discovery.seed_hosts: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          cluster.initial_master_nodes: ["10.30.22.152","10.30.22.153","10.30.22.154"] ## add all cluster node ip's
          path.logs: /var/log/elasticsearch ## Or your preferred location.
          path.data: /usr/share/elasticsearch/ ## Or your preferred location.
          discovery.zen.minimum_master_nodes: 2
    
  4. Save elasticsearch.yml

  5. Start Elasticsearch on each node.

    sudo service elasticsearch start
    
  6. Verify cluster health

    curl http://localhost:9200/_cluster/health
    
    or
    
    curl http://node_ip:9200/_cluster/health
    

Application Tier

Morpheus configuration is controlled by a configuration file located at /etc/morpheus/morpheus.rb. This file is read when you run morpheus-ctl reconfigure after installing the appliance package. Each section is tied to a deployment tier: database is mysql, message queue is rabbitmq, search index is elasticsearch. There are no entries for the web and application tiers since those are part of the core application server where the configuration file resides.

  1. Download and install the Morpheus Appliance Package

  2. Next we must install the package onto the machine and configure the morpheus services:

    sudo rpm -i morpheus-appliance-x.x.x-1.x86_64.rpm
    
  3. After installing and prior to reconfiguring, edit the morpheus.rb file

    sudo vi /etc/morpheus/morpheus.rb
    
  4. Change the values to match your configured services:

    Note

    The values below are examples. Update hosts, ports, usernames and password with your specifications. Only include entries for services you wish to externalize.

    mysql['enable'] = false
    mysql['host'] = {'10.30.20.139' => 3306, '10.30.20.153' => 3306, '10.30.20.196' => 3306}
    mysql['morpheus_db'] = 'morpheusdb'
    mysql['morpheus_db_user'] = 'dbuser'
    mysql['morpheus_password'] = 'dbuserpassword'
    rabbitmq['enable'] = false
    rabbitmq['vhost'] = 'morpheus'
    rabbitmq['queue_user'] = 'lbuser'
    rabbitmq['queue_user_password'] = 'lbuserpassword'
    rabbitmq['host'] = 'rabbitvip'
    rabbitmq['port'] = '5672'
    rabbitmq['heartbeat'] = 50
    elasticsearch['enable'] = false
    elasticsearch['cluster'] = 'esclustername'
    elasticsearch['es_hosts'] = {'10.30.20.91' => 9200, '10.30.20.149' => 9200, '10.30.20.165' => 9200}
    elasticsearch['use_tls'] = true
    elasticsearch['auth_user'] = 'morpheus-user'
    elasticsearch['auth_password'] = 'xxxxxxxxxxxxxxxx'
    
  5. Reconfigure Morpheus

    sudo morpheus-ctl reconfigure
    

Shared Storage

For configurations with 2 or more Applications Nodes, Shared Storage is required between the app nodes. Local Storage File Shares will need to be copied to a shared file system so all assets are available on all App nodes.

Assets

  • White label images

  • Uploaded virtual images

  • Deploy uploads

  • Ansible Plays

  • Terraform

  • Morpheus backups

Tip

Backups, deployments and virtual image storage locations can be overridden within the Morpheus-ui. You can find more information on storage here: Storage

To copy the morpheus-ui directory to the shared storage follow the below steps:

  1. SSH into the Appliance

  2. sudo su (or login as root)

  3. cd into /var/opt/morpheus/

  4. Backup morpheus-ui directory by running the command below. This will create a new directory in /var/opt/morpheus/ called morpheus-ui-bkp and copy the contents of morpheus-ui into the new directory

    cp -r morpheus-ui morpheus-ui-bkp
    
  5. Move morpheus-ui to your shared storage. Example below:

    mv morpheus-ui /nfs/appliance-files/
    
  6. Mount your shared storage volume to /var/opt/morpheus/morpheus-ui. How you mount it is dependent on what kind of storage it is. If you mount the volume after the package install, but before the reconfigure, then you don’t need to copy anything to a backup.

  7. SSH into the second Appliance and then Backup morpheus-ui directory by running

    cp -r morpheus-ui morpheus-ui-bkp
    

Tip

when adding additional nodes you will only need to run step 6 and 7

Important

NFS mounts require sync option when using Ansible integration with Morpheus Agent command bus execution enabled.