Getting Started

Requirements

Morpheus is a software based appliance installation capable of orchestrating many clouds and hypervisors. Before an installation is started it is important to understand some of the base requirements.

In the simplest configuration Morpheus needs one Appliance Server. The Appliance Server, by default, contains all the components necessary to orchestrate both vm’s and containers. To get started some base requirements are recommended:

Base Requirements

  • Operating System: Ubuntu 14.04 / 16.04 or CentOS/RHEL greater than 7.0.
  • Memory: 8 GB minimum
  • Storage: 100 GB storage minimum
  • Network connectivity from your users to the appliance over TCP 443 (HTTPS)
  • Inbound connectivity access from provisioned vm’s and container hosts on ports 443 and 80 (needed for agent communication)
  • Internet Connectivity from Appliance (To download from Morpheus ‘ public docker repositories and virtual image catalog)
  • Superuser privileges via the sudo command for the user installing the Morpheus Appliance package.
  • An Appliance URL that is accessible to all managed hosts. It is necessary for all hosts that are managed by Morpheus to be able to communicate with the appliance server ip on port 443. This URL is configured under Admin->Settings. Morpheus also utilizes SSH (Port 22) and Windows Remote Management (Port 5985) to initialize a server.
  • An Appliance License is required for any operations involving provisioning.

Note

Ubuntu 16.10 and Amazon Linux are not supported.

Storage

Morpheus needs storage space for a few items. One is for the built-in Elasticsearch store (used for log aggregation and stats collection metrics). Morpheus also keeps a workspace and local virtual image cache for doing virtual image conversion and template upload. While the permanent store of these can be offloaded via a Storage Provider some space is still recommended for dealing with non streamable virtual image formats.

In many common scenarios it might be prudent to configure a shared datastore on a storage cluster and mounted to /var/opt/morpheus/morpheus-ui (this is where all user based data and database data is persisted). There are several folders located within here that can be independently located as desired.

Network Connectivity

Morpheus primarily operates via communication with its agent that is installed on all managed vm’s or docker hosts. This is a lightweight agent responsible for aggregating logs and stats and sending them back to the client with minimal network traffic overhead. It also is capable of processing instructions related to provisioning and deployments instigated by the appliance server.

The Morpheus Agent exists for both linux and windows based platforms and opens NO ports on the guest operating system. Instead it makes an outbound SSL (https / wss) connection to the appliance server. This is what is known as the appliance url during configuration (in Admin->Settings). When the agent is started it automatically makes this connection and securely authenticates. Therefore, it is necessary for all vm’s and docker based hosts that are managed by morpheus to be able to reach the appliance server ip on port 443.

Morpheus also utilizes SSH (Port 22) and Windows Remote Management (Port 5985) to initialize a server. This includes sending remote command instructions to install the agent. It is actually possible for Morpheus to operate without agent connectivity (though stats and logs will not function) and utilize SSH/WinRM to perform operations. Once the agent is installed and connections are established SSH/WinRM communication will stop. This is why an outbound requirement exists for the appliance server to be able to utilize port 22 and 5985.

Note

In newer versions of morpheus this outbound connectivity is not mandatory. The agent can be installed by hand or via Guest Process API’s on cloud integrations like VMware.

Components

The Appliance Server automatically installs several components for the operation of Morpheus . This includes:

  • RabbitMQ (Messaging)
  • MySQL (Logistical Data store)
  • Elasticsearch (Logs / Metrics store)
  • Redis (Cache store)
  • Tomcat (Morpheus Application)
  • Nginx (Web frontend)
  • Guacamole (Remote console service for clientless remote console)
  • Check Server (Monitoring Agent for custom checks added via UI)

All of these are installed in an isolated way using chef zero to /opt/morpheus. It is also important to note these services can be offloaded to separate servers or clusters as desired. For details check the installation section and high availability.

Installation

Morpheus comes packaged as a debian or yum based package. It can be installed on a single on/off premise linux based host or configured for high availability and horizontal scaling. Morpheus is currently only supported on Ubuntu 14.04, Ubuntu 16.04 , CentOS 7.0 or newer, and RHEL 7.0 or newer based hosts (Ubuntu is recommended).

Ubuntu

To get started installing Morpheus on Ubuntu (14.04 currently) a few prepratory items should be addressed first.

  1. First make sure the apt repository is up to date by running sudo apt-get update. It might also be advisable to verify that the assigned hostname of the machine is self resolvable.

    Important

    If the machine is unable to resolve its own hostname nslookup hostname some installation commands will be unable to verify service health during installation and fail.

  2. Next simply download the relevant .deb package for installation. This package can be acquired from your account rep or via a free trial request from https://www.morpheusdata.com[morheusdata.com].

    Tip

    Use the wget command to directly download the package to your appliance server. i.e. wget https://downloads.gomorpheus.com/path/to/package.deb

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

    sudo dpkg -i morpheus-appliance_x.x.x-1.amd64.deb
    sudo morpheus-ctl reconfigure
    
  4. Once the installation is complete the web interface will automatically start up. By default it will be resolvable at https://your_machine_name and in many cases this may not be resolvable from your browser. The url can be changed by editing /etc/morpheus/morpheus.rb and changing the value of appliance_url. After this has been changed simply run:

    sudo morpheus-ctl reconfigure
    sudo morpheus-ctl stop morpheus-ui
    sudo morpheus-ctl start morpheus-ui
    

    Note

    The morpheus-ui can take 2-3 minutes to startup before it becomes available.

There are additional post install settings that can be viewed in the Advanced section of the guide.

Once the browser is pointed to the appliance a first time setup wizard will be presented. Please follow the on screen instructions by creating the master account. From there you will be presented with the license settings page where a license can be applied for use (if a license is required you may request one or purchase one by contacting your sales representative).

More details on setting up infrastructure can be found throughout this guide.

Tip

If any issues occur it may be prudent to check the morpheus log for details at /var/log/morpheus/morpheus-ui/current.

CentOS

To get started installing Morpheus on CentOS/RHEL a few preparatory items should be addressed first.

  1. Configure firewalld to allow access from users on port 80 or 443 (Or remove firewall if not required).

  2. Make sure the machine is self resolvable to its own hostname.

  3. For RHEL: In order for the guacamole service (remote console) to properly install some additional optional repositories first need added.

    • RHEL 7.x Amazon: yum-config-manager --enable rhui-REGION-rhel-server-optional
    • RHEL 7.x: yum-config-manager --enable rhel-7-server-optional-rpms
    • For Amazon users a redhat subscription is not required if the appropriate yum REGION repository is added instead as demonstrated above.

    Important

    If the machine is unable to resolve its own hostname nslookup hostname some installation commands will be unable to verify service health during installation and fail.

  4. Next simply download the relevant .rpm package for installation. This package can be acquired from your account rep or via a free trial request from https://www.morpheushub.com.

    Tip

    Use the wget command to directly download the package to your appliance server. i.e. wget https://downloads.gomorpheus.com/path/to/package.rpm

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

    sudo sudo rpm -i morpheus-appliance-x.x.x-1.x86_64.rpm
    sudo morpheus-ctl reconfigure
    
  6. Once the installation is complete the web interface will automatically start up. By default it will be resolvable at https://your_machine_name and in many cases this may not be resolvable from your browser. The url can be changed by editing /etc/morpheus/morpheus.rb and changing the value of appliance_url. After this has been changed simply run :

    sudo morpheus-ctl reconfigure
    sudo morpheus-ctl stop morpheus-ui
    sudo morpheus-ctl start morpheus-ui
    

    Note

    The morpheus-ui can take 2-3 minutes to startup before it becomes available.

There are additional post install settings that can be viewed in the Advanced section of the guide.

Once the browser is pointed to the appliance a first time setup wizard will be presented. Please follow the on screen instructions by creating the master account. From there you will be presented with the license settings page where a license can be applied for use (if a license is required you may request one or purchase one by contacting your sales representative).

More details on setting up infrastructure can be found throughout this guide.

Tip

If any issues occur it may be prudent to check the morpheus log for details at /var/log/morpheus/morpheus-ui/current.

RHEL

To get started installing Morpheus on RHEL 7 a few prerequisite items are required.

The RedHat Enterprise Linux 7 server needs to be registered and activated with Redhat subscription. The server optional rpms repo needs to be enabled as well.

To check if the server has been actived please run the subscription-manager version. Subscription manager will return the version plus the python depency version.

If the server has not been registered and activated then the subscription manager version will return the below message.

sudo subscription-manager version
server type: This system is currently not registered
subscription management server: 0.9.51.24.-1
subscription-manager: 1.10.14-7.el7 python-rhsm: 1.10.12-2.el7

When a server has been registered and activated with Redhat the subscription manager will return the below message.

sudo subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.24-1
subscription-manager: 1.10.14-7.el7 python-rhsm: 1.10.12-2.el7

If the subscription manager re-turns the message “This system is currently not registered” please follow the below steps to register the server.

Tip

To register the server you will need to have sudo permissions [Member of the Wheel group] or root access to the server. You will also need your Redhat registered email address and password.

subscription-manager register

sudo subscription-manager register
Username: redhat@example.com
Password: . subscription-manager auto --attach

Note

This can take a minute to complete

sudo subscription-manager attach --auto

Installed Product Current Status: Product Name: Red Hat Enterprise Linux
Server Status: Subscribed

To check to see if the RHEL server has the Red Hat Enterprise Linux 7 Server - Optional (RPMs) repo enabled please run the following command to return the repo status.

Tip

To check the server repos you will need to have sudo permissions [Member of the Wheel group] or root access to the server.

sudo yum repolist all | grep "rhel-7-server-optional-rpms" rhel-7-server-optional-rpms/7Server/x86_64 disabled

If the repo status was returned as disabled then you will need to enable the repo using the subscription manager like below.

sudo subscription-manager repos --enable rhel-7-server-optional-rpms
Repository 'rhel-7-server-optional-rpms' is enabled for this system.

The message “Repo ‘rhel-7-server-optional-rpms’ is enabled for this system.” will appear after enabling the repo. This will confirm that the repo has been enabled.

Next simply download the relevant .rpm package for installation. This package can be acquired from your account rep or via a free trial request from https://www.morpheusdata.com[morheusdata.com].

Tip

Use the wget command to directly download the package to your appliance server. i.e. wget https://downloads.gomorpheus.com/path/to/package.rpm

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

sudo rpm -i morpheus-appliance_x.x.x-1.amd64.rpm
sudo morpheus-ctl reconfigure

Once the installation is complete the web interface will automatically start up. By default it will be resolvable at https://your_machine_name and in many cases this may not be resolvable from your browser. The url can be changed by editing /etc/morpheus/morpheus.rb and changing the value of appliance_url. After this has been changed simply run:

sudo morpheus-ctl reconfigure
sudo morpheus-ctl stop morpheus-ui
sudo morpheus-ctl start morpheus-ui

Note

The morpheus-ui can take 2-3 minutes to startup before it becomes available.

There are additional post install settings that can be viewed in the Advanced section of the guide.

Once the browser is pointed to the appliance a first time setup wizard will be presented. Please follow the on screen instructions by creating the master account. From there you will be presented with the license settings page where a license can be applied for use (if a license is required you may request one or purchase one by contacting your sales representative).

More details on setting up infrastructure can be found throughout this guide.

Tip

If any issues occur it may be prudent to check the morpheus log for details at /var/log/morpheus/morpheus-ui/current.

Additional Options

There are several additional configuration options during installation that may be performed. For example, Morpheus provides convenient options for uploading your own SSL certificates as well as externalizing several dependent services.

System Defaults

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
    • MySQL: /var/log/morpheus/mysql
    • NginX: /var/log/morpheus/nginx
    • Check Server: /var/log/morpheus/check-server
    • Elastic Search: /var/log/morpheus/elsticsearch
    • RabbitMQ: /var/log/morpheus/rabbitmq
    • Redis: /var/log/morpheus/redis
  • User-defined install/config: /etc/morpheus/morpheus.rb

SSL Certificates

The default installation generates a self-signed SSL certificate. To implement a third-party certificate:

  1. Copy the private key and certificate to /etc/morpheus/ssl/your_fqdn_name.key and /etc/morpheus/ssl/your_fqdn_name.crt respectively.

  2. Edit the configuration file /etc/morpheus/morpheus.rb and add the following entries:

    nginx['ssl_certificate'] = 'path to the certificate file'
    nginx['ssl_server_key'] = 'path to the server key file'
    

    Note

    Both files should be owned by root and only readable by root, also if the server certificate is signed by an intermediate then you should include the signing chain inside the certificate file.

  3. Next simply reconfigure the appliance and restart nginx:

    sudo morpheus-ctl reconfigure
    sudo morpheus-ctl restart nginx
    

Additional Configuration Options

There are several other options available to the /etc/morpheus/morpheus.rb file that can be useful when setting up external service integrations or high availability:

mysql['enable'] = false
mysql['host'] = '52.53.240.28'
mysql['port'] = 10004
mysql['morpheus_db'] = 'morpheusdb01'
mysql['morpheus_db_user'] = 'merovingian'
mysql['morpheus_password'] = 'Wm5n5gXqXCe9v52'
rabbitmq['enable'] = false
rabbitmq['vhost'] = 'zion'
rabbitmq['queue_user'] = 'dujour'
rabbitmq['queue_user_password'] = '5tfg9n2iBifzW5c'
rabbitmq['host'] = '54.183.196.152'
rabbitmq['port'] = '10008'
rabbitmq['stomp_port'] = '10010'
redis['enable'] = false
redis['host'] = '52.53.240.28'
redis['port'] = 10009
elasticsearch['enable'] = false
elasticsearch['cluster'] = 'nebuchadnezzar'
elasticsearch['es_hosts'] = {'52.53.214.68' => 10003}

These settings allow one to externally configure and scale mysql, elasticsearch, redis, and rabbitmq which is critical for a high availability setup.

Upgrading

Important

For upgrades to 3.2.0 please follow the 3.2.0 upgrade instructions below!

Morpheus provides a very simple and convenient upgrade process. In most cases it is simply a matter of installing the new package on top of itself and reconfiguring the services.

Important

All services except the morpheus-ui must be running during a reconfigure. The morpheus-ui also must be restarted or stopped and started during an upgrade. Failure to do so will result in errors.

Debian / Ubuntu

Simply download the latest package or request the latest package from your account service representative.

Then run the install process as follows:

sudo dpkg -i morpheus-appliance_x.x.x-1.amd64.deb
sudo morpheus-ctl stop morpheus-ui
sudo morpheus-ctl reconfigure
sudo morpheus-ctl start morpheus-ui

This typically is enough to complete a full upgrade. Databases will automatically be migrated upon restart of the application and service version upgrades will automatically be applied.

CentOS / RHEL

Yum based package upgrades are a little different. In this case we want to run a rpm -U command as the package manager is slightly different.

sudo rpm -U morpheus-appliance-x.x.x-1.x86_64.rpm
sudo morpheus-ctl stop morpheus-ui
sudo morpheus-ctl reconfigure
sudo morpheus-ctl start morpheus-ui

Tip

Sometimes it may be necessary to restart all appliance services on the host. In order to do this simply type sudo morpheus-ctl restart. This will restart ALL services.

3.2.0+ Upgrades

Overview

Upgrading from previous versions of Morpheus to 3.2.0 or later requires upgrading ElasticSerach to 5.4.1 or 5.x. We do not support ElasticSearch 6.x at this time. This upgrade requires an export and import of Morpheus ElasticSearch data if you want to retain logs, backup history, statistics, and check history of your instances. If you do not need to retain that data you can skip the ElasticSearch migration. Upgrading to 3.2.0 will create a blank ElasticSearch node with no data. Your Morpheus layout configuration will determine how to migrate your ElasticSearch data: all-in-one or distributed high availability.

Morpheus All-In-One

This deployment configuration is the default mode for Morpheus and contains a single ElasticSearch instance on the appliance. The migration steps are as follows:

  1. Login to your appliance as a user that has sudo privileges and can switch to the root user sudo su -. You can run the following commands under sudo, but you will need to pass the PATH to the Morpheus embedded directory. Export the Morpheus embedded path to your environment by executing: export PATH=/opt/morpheus/sbin:/opt/morpheus/sbin:/opt/morpheus/embedded/sbin:/opt/morpheus/embedded/bin:$PATH
  2. Verify that you are using the Morpheus embedded gem by executing the command: which gem. You should see the path /opt/morpheus/embedded/bin/gem
  3. Install the elastic-util gem by executing: gem install elastic-util if you don’t want the documentation then execute gem install elastic-util --no-ri --no-rdoc
  4. Stop the Morpheus application by executing morpheus-ctl stop morpheus-ui, this will stop creating new documents in ElasticSearch.
  5. Create a backup of the ElasticSearch indices by executing: elastic-util backup http://localhost:9200 /root/es_backup, you can change the location of the backup to any file location. You can also pass the --force argument to overwrite the existing location if you are repeating the backup.
  6. Upgrade Morpheus as usual by executing the package upgrade command dpkg -i morpheus-appliance_3.2.0-1_amd64.deb or rpm -U morpheus-appliance-3.2.0-1.el7.x86_64.rpm, and run morpheus-ctl reconfigure to complete the upgrade process.
  7. You can start Morpheus at this point to bring up the Morpheus application by executing: morpheus-ctl start morpheus-ui.

Note

Make sure that Morpheus is fully started before moving on to the next step.

Once the application has started, a new ElasticSearch node is created with default data, to import your data from the backup execute: morpheus-ctl elastic-util restore http://localhost:9200 /root/es_backup, substitute the path you used during the backup if different from above.

Note

The restore may take several hours depending on the amount of data to restore. You can run this while running Morpheus.

Morpheus Distributed High Availability

This deployment configuration assumes that you manage an ElasticSearch cluster externally from Morpheus. The steps for upgrading ElasticSearch from 1.x to 5.x are located on the ElasticSearch website. Run the following from a “master” appliance, it has the required Ruby installed in the Morpheus full stack directory. Ensure that the appliance can reach at least one ElasticSearch node over port 9200 (http). Also, make sure thre is enough disk space to hold the exported data on the appliance.

  1. Login to the master appliance as a user that has sudo privileges and can switch to the root user sudo su -. You can run the following commands under sudo, but you will need to pass the PATH to the Morpheus embedded directory.

  2. Export the Morpheus embedded path to your environment by executing: export PATH=/opt/morpheus/sbin:/opt/morpheus/sbin:/opt/morpheus/embedded/sbin:/opt/morpheus/embedded/bin:$PATH

  3. Verify that you are using the Morpheus embedded gem by executing the command: which gem. You should see the path /opt/morpheus/embedded/bin/gem

  4. Install the elastic-util gem by executing: gem install elastic-util if you don’t want the documentation then execute gem install elastic-util --no-ri --no-rdoc

  5. Stop all the Morpheus application instances by executing morpheus-ctl stop morpheus-ui on each appliance node, this will stop creating new documents in ElasticSearch.

  6. Create a backup of the ElasticSearch indices by executing: elastic-util backup http://xxx.xxx.xxx.xxx:9200 /root/es_backup, you can change the location of the backup to any file location. You can also pass the --force argument to overwrite the existing location if you are repeating the backup.

    Note

    The next steps are done on the ElasticSearch node(s).

  7. Stop ElasticSearch on each node.

  8. Backup the ElasticSearch config directory for each node, normally located at /etc/elasticsearch/.

  9. Since the index data between 1.x and 5.x is incompatible, delete the data from the data directory normally located at /var/lib/elasticsearch. To prepare for future upgrades make sure that you delete the cluster name directory as well, ie morpheus.

  10. Upgrade ElasticSearch, use the method that best fits your situation ie pkg, tar, or zip.

  11. Remove unsupported configuration from the existing ElasticSearch configuration

    • index.number_of_shards
    • index.number_of_replicas
    • discovery.zen.ping.multicast
  12. Replace or update the package installed configuration with your existing configuration if it was overwritten.

    • Set network.host or network.bind_ip and network.publish_ip accordingly to your network configuration.
  13. Start ElasticSearch on each node and form a new cluster.

  14. Verify you have a good cluster by executing: curl http://xxx.xxx.xxx.xxx:9200/_cluster/health?pretty, check for the number of nodes and that you have a green status.

    Note

    The next steps are done on the Morpheus “master” node.

  15. Upgrade Morpheus as usual by executing the package upgrade command dpkg -i morpheus-appliance_3.2.0-1_amd64.deb or rpm -U morpheus-appliance-3.2.0-1.el7.x86_64.rpm, and run morpheus-ctl reconfigure to complete the upgrade process.

  16. You can start Morpheus on the master node only at this point to bring up the Morpheus application by executing: morpheus-ctl start morpheus-ui.

    Note

    Make sure that Morpheus is fully started before moving on to the next step.

  17. Once the application has started, a new ElasticSearch node is created with default data, to import your data from the backup execute: morpheus-ctl elastic-util restore http://xxx.xxx.xxx.xxx:9200 /root/es_backup, substitute the path you used during the backup if different from above.

    Note

    The restore may take several hours depending on the amount of data to restore. You can run this while running Morpheus.

  18. Move to the next Morpheus appliance and upgrade it by executing the package upgrade command dpkg -i morpheus-appliance_3.2.0-1_amd64.deb or rpm -U morpheus-appliance-3.2.0-1.el7.x86_64.rpm, and run morpheus-ctl reconfigure to complete the upgrade process.

  19. Start Morpheus by executing: morpheus-ctl start morpheus-ui.

  20. Upgrade the rest of the Morpheus appliances in your environment.

Initial Appliance Setup

Appliance Setup

After installation, log into the appliance at the URL presented upon completion. An initial setup wizard walks through the first account and user creations.

  1. Enter Master Account name
    • Typically, the Master Account name is your Company name.
  2. Create Master User
    • First Name
    • Last Name
    • Username
    • Email Address
    • Password * Must be at least 8 characters longs and contain one each of the following: Uppercase letter, lowercase letter, Number, Special Character
  3. Enter Appliance Name & Appliance URL
    • The Appliance Name is used for white labeling and as a reference for multi-appliance installations.
    • The Appliance URL is the URL all provisioned instances will report back to. Example: https://example.morpheusdata.com.

The Appliance URL can be changed later, and also set to different url per cloud integration.

  1. Optionally Enable or Disable Backups, Monitoring, or Logs from this screen.

Note

You may adjust these settings from the Administration section.

Note

The Master Account name is the top-level admin account.

Note

The Master User is the system super user and will have full access privileges.

Upon completing of the initial appliance setup, you will be taken to the Admin -> Settings page, where you will add your License Key.

Add a License Key

In order to provision anything in Morpheus , a Morpheus License Key must be applied.

If you do not already have a license key, one may be requested from https://www.morpheushub.com or from your Morpheus representative.

In the Administration -> Settings section, select the LICENSE tab, paste your License Key and click “UPDATE”

../_images/license_key.png

When the license is accepted, your license details will populate in the Current License section.

If you receive an error message and your license is not accepted, please check it was copied in full and then contact your Morpheus representative. You can also verify the License Key and expiration at https://www.morpheushub.com.

Advanced Configuration

Morpheus provides more advanced configuration capabilities, including High Availability configurations, and support for tougher network environments with offline installation and Proxy configurations.

Offline Installer

For customers that have an appliance behind a firewall/proxy that does not allow downloads from our Amazon download site, you can have the offline package to add the needed packages the standard Morpheus installer would have downloaded.

Offline Installer Requirements

  • NTP should be correctly configured an the server is able to connect to the NTP server in the ntp.conf file.
  • The OS package repositories should be configured to use local LAN repository servers or the server should be able to receive packages from the configured repositories.
  • The standard Morpheus and offline packages must be downloaded from another system and transferred to the Morpheus Appliance server.

Note

The offline package is linked 1-to-1 to the appliance release. For example the offline package for 2.12.2-1 should be used with the appliance package 2.12.2-1

Offline Install

Ubuntu

  1. Download both the regular Morpheus Appliance package and the Offline Installer packages on to the appliance server:

    wget http://example_url/morpheus-appliance_package_url.deb
    wget http://example_url/morpheus-appliance_package_offline_url.deb
    
  2. Install the appliance package. DO NOT run morpheus-ctl reconfigure yet.

    sudo dpkg -i morpheus-appliance_version_amd64.deb
    
  3. Install the offline package using dpkg -i morpheus-appliance-offline_2.12.2~rc1-1_all.deb.

    sudo dpkg -i morpheus-appliance-offline_version_all.deb
    
  4. Set the Morpheus UI applaicne url (if needed, hostname will be automatically set).

    sudo vi /etc/morpheus/morpheus.rb
    edit appliance_url to resolvable url (if not configured correctly by default)
    
  5. Reconfigure the appliance to install required packages

    sudo morpheus-ctl reconfigure
    

The Chef run should complete successfully. There is a small pause when Chef runs the resource remote_file[package_name] action create while Chef verifies the checksum. After the reconfigure is complete, the morpheus-ui will start and be up in a few minutes.

Note

Tail the morpheus-ui log file with morpheus-ctl tail morpheus-ui and look for the Morpheus ascii logo to know when the morpheus-ui is up.

CentOS

  1. Download both the regular Morpheus Appliance package and the Offline Installer packages on to the appliance server:

    wget http://example_url/morpheus-appliance_package_url.noarch.rpm
    wget http://example_url/morpheus-appliance_package_offline_url.noarch.rpm
    
  2. Install the appliance package. DO NOT run morpheus-ctl reconfigure yet.

    sudo rpm -i morpheus-appliance_version_amd64.rpm
    
  3. Install the offline package using rpm -i morpheus-appliance-offline_2.12.2~rc1-1_all.rpm

    sudo rpm -i morpheus-appliance-offline_version_all.rpm
    
  4. Set the Morpheus UI applaicne url (if needed, hostname will be automatically set). Edit appliance_url to resolvable url (if not configured correctly by default)

    sudo vi /etc/morpheus/morpheus.rb
    
  5. Reconfigure the appliance to install required packages

    sudo morpheus-ctl reconfigure
    

The Chef run should complete successfully. There is a small pause when Chef runs the resource remote_file[package_name] action create while Chef verifies the checksum. After the reconfigure is complete, the morpheus-ui will start and be up in a few minutes.

Note

Tail the morpheus-ui log file with morpheus-ctl tail morpheus-ui and look for the Morpheus ascii logo to know when the morpheus-ui is up.

Proxies

Overview

In many situations , companies deploy virtual machines in proxy restricted environments for things such as PCI Compliance, or just general security. As a result of this Morpheus provides out of the box support for proxy connectivity. Proxy authentication support is also provided with both Basic Authentication capabilities as well as NTLM for Windows Proxy environments. Morpheus is even able to configure virtual machines it provisions to utilize these proxies by setting up the operating systems proxy settings directly (restricted to cloud-init based Linux platforms for now, but can also be done on windows based platforms in a different manner).

To get started with Proxies, it may first be important to configure the Morpheus appliance itself to have access to proxy communication for downloading service catalog images. To configure this, visit the Admin -> Settings page where a section labeled “Proxy Settings” is located. Fill in the relevant connection info needed to utilize the proxy. It may also be advised to ensure that the Linux environment’s http_proxy, https_proxy, and no_proxy are set appropriately.

Defining Proxies

Proxies can be used in a few different contexts and optionally scoped to specific networks with which one may be provisioning into or on a cloud integration as a whole. To configure a Proxy for use by the provisioning engines within Morpheus we must go to Infrastructure -> Networks -> Proxies. Here we can create records representing connection information for various proxies. This includes the host ip address, proxy port, and any credentials (if necessary) needed to utilize the proxy. Now that these proxies are defined we can use them in various contexts.

Cloud Communication

When morpheus needs to connect to various cloud APIs to issue provisioning commands or to sync in existing environments, we need to ensure that those api endpoints are accessible by the appliance. In some cases the appliance may be behind a proxy when it comes to public cloud access like Azure and AWS. To configure the cloud integration to utilize aa proxy, when adding or editing a cloud there is a setting called “API Proxy” under “Advanced Options”. This is where the proxy of choice can be selected to instruct the Provisioning engine how to communicate with the public cloud. Simply adjust this setting and the cloud should start being able to receive/issue instructions.

Provisioning with Proxies

Proxy configurations can vary from operating system to operating system and in some cases it is necessary for these to be configured in the templates as a prerequisite. In other cases it can also be configured automatically. Mostly with the use of cloud-init (which all of our out of the box service catalog utilizes on all clouds). When editing/creating a cloud there is a setting for “Provisioning Proxy” in “Provisioning Options”. If this proxy is set, Morpheus will automatically apply these proxy settings to the guest operating system.

Overriding proxy settings can also be done on the Network record. Networks (or subnets) can be configured in Infrastructure -> Networks or on the Networks tab of the relevant Cloud detail page. Here, a proxy can also be assigned as well as additional options like the No Proxy rules for proxy exceptions.

Docker

When provisioning Docker based hosts within a Proxy environment it is up to the user to configure the docker hosts proxy configuration manually. There are workflows that can be configured via the Automation engine to make this automatic when creating docker based hosts. Please see documentation on Docker and proxies for specific information.

Proxy setups can vary widely from company to company, and it may be advised to contact support for help configuring morpheus to work in the proxy environment.

Morpheus DB Migration

If your new installation is part of a migration or you need to move the data from your original Morpheus database, this is easily accomplished by using a stateful dump.

To begin this, stop the Morpheus UI on your original Morpheus server:

[root@app-server-old ~] morpheus-ctl stop morpheus-ui

Once this is done you can safely export. To access the MySQL shell we will need the password for the Morpheus DB user. We can find this in the morpheus-secrets file:

[root@app-server-old ~] cat /etc/Morpheus/morpheus-secrets.json | grep morpheus_password
"morpheus_password": "372ec45ce5d196adb3de5d6a", <---------------this one
"morpheus_password": "8e8bcf9dc5fdf95d",

Take note of the first morpheus_password as it will be used to invoke a dump. Morpheus provides embedded binaries for this task. Invoke it via the embedded path and specify the host. In this example we are using the morpheus database on the MySQL listening on localhost. Enter the password copied from the previous step when prompted:

[root@app-server-old ~] /opt/morpheus/embedded/mysql/bin/mysqldump -u morpheus -h 127.0.0.1 morpheus -p > /tmp/morpheus_backup.sql
Enter password:

This file needs to be pushed to the new Morpheus Installation’s backend. Depending on the GRANTS in the new MySQL backend, this will likely require moving this file to one of the new Morpheus frontend servers.

Once the file is in place it can be imported into the backend. Begin by ensuring the Morpheus UI service is stopped on all of the application servers:

[root@app-server-new ~] morpheus-ctl stop morpheus-ui

Then you can import the MySQL dump into the target database using the embedded MySQL binaries, specifying the database host, and entering the password for the morpheus user when prompted:

[root@app-server-new ~] /opt/morpheus/embedded/mysql/bin/mysql -u morpheus -h 10.1.2.2 morpheus -p < /tmp/morpheus_backup.sql
Enter password:

The data form the old appliance is now replicated on the new appliance. Simply start the UI to complete the process:

[root@app-server-new ~] morpheus-ctl start morpheus-ui

High Availability Configuration

Overview

Morpheus provides a wide array of options when it comes to deployment architectures. It can start as a simple one machine instance where all services run on the same machine, or it can be split off into individual services per machine and configured in a high availability configuration, either in the same region or cross-region. Naturally, high availability can grow more complicated, depending on the configuration you want to do and this article will cover the basic concepts of the Morpheus HA architecture that can be used in a wide array of configurations.

There are four primary tiers of services represented within the Morpheus appliance. They are the App Tier, Transactional Database Tier, Non-Transactional Database Tier, and Message Tier. Each of these tiers have their own recommendations for High availability deployments that we need to cover.

../_images/morpheusHA.png

Important

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

Transactional Database Tier

The Transactional database tier usually consists of a MySQL compatible database. It is recommended that a lockable clustered configuration be used (Currently Percona XtraDB Cluster is the most recommended in Permissive Mode). There are several documents online related to configuring and setting up an XtraDB Cluster but it most simply can be laid out in a many master configuration. There can be some nodes setup with replication delay as well as some with no replication delay. It is common practice to have no replication delay within the same region and allow some replication delay cross region. This does increase the risk of job run overlap between the 2 regions however, the concurrent operations typically self-correct and this is a non-issue.

Non-Transactional Database Tier

The Non-Transactional tier consists of an ElasticSearch (version 1.6) cluster. Elastic Search is used for log aggregation data and temporal aggregation data (essentially stats, metrics, and logs). This enables for a high write throughput at scale. ElasticSearch is a Clustered database meaning all nodes no matter the region need to be connected to each other over what they call a “Transport” protocol. It is fairly simple to get setup as all nodes are identical. It is also a java based system and does require a sizable chunk of memory for larger data sets. (8gb) is recommended and more nodes can be added to scale either horizontally or vertically.

Messaging Tier

The Messaging tier is an AMQP based tier along with STOMP Protocol (used for agent communication). The primary model recommended is to use RabbitMQ for queue services. RabbitMQ is also a clustered based queuing system and needs at least 3 instances for HA configurations. This is due to elections in the failover scenarios rabbitmq can manage. If doing a cross-region HA rabbitmq cluster it is recommended to have at least 3 rabbit queue clusters per region. Typically to handle HA a RabbitMQ cluster should be placed between a load balancer and the front-end application server to handle cross host connections. The ports necessary to forward in a Rabbit MQ cluster are (5672, and 61613). A rabbitmq cluster can run on smaller memory machines depending on how frequent large requests bursts occur. 4–8gb of Memory is recommended to start.

Application Tier

The application tier is easily installed with the same debian or yum repository package that Morpheus is normally distributed with. Advanced configuration allows for the additional tiers to be skipped and leave only the “stateless” services that need run. These stateless services include Nginx, Tomcat, and Redis (to be phased out at a later date). These machines should also have at least 8gb of Memory. They can be configured across all regions and placed behind a central load-balancer or Geo based load-balancer. They typically connect to all other tiers as none of the other tiers talk to each other besides through the central application tier. One final piece when it comes to setting up the Application tier is a shared storage means is necessary when it comes to maintaining things like deployment archives, virtual image catalogs, backups, etc. These can be externalized to an object storage service such as amazon S3 or Openstack Swiftstack as well. If not using those options a simple NFS cluster can also be used to handle the shared storage structure.

Ports

Morpheus Appliance -> Percona 3306 Morpheus Appliance -> Rabbit

../_images/morpheus-ha-multi-configuration.png

Database Tier

Installation and configuration of Percona XtraDB Cluster on CentOS/RHEL 7

Important

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

Requirements

Percona requires the following ports for the cluster nodes. Please create the appropriate firewall rules on your Percona nodes.

  • 3306
  • 4444
  • 4567
  • 4568

Percona also recommends setting the selinux policy to permissive. You can temporarily set the permission to permissive by running

sudo setenforce 0

You will need to edit the selinux configuration file if you want the permission to take affect permanently which can be found in /etc/selinux/config

Add Percona Repo

  1. Add the percona repo to your Linux Distro.

    sudo yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
    
  2. Check the repo by running the below command.

    sudo yum list | grep percona
    
  3. The below commands will clean the repos and update the server.

    sudo yum clean all
    sudo yum update -y
    

Installing Percona XtraDB Cluster

  1. The below command will install the Percona XtraDB Cluster software and it’s dependences.

    sudo yum install Percona-XtraDB-Cluster-57
    
    NOTE:: During the installation you will receive the below message. Accept the Percona PGP key to install the software.
    
    retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona
    Importing GPG key 0xCD2EFD2A:
    Userid     : "Percona MySQL Development Team <mysql-dev@percona.com>"
    Fingerprint: 430b df5c 56e7 c94e 848e e60c 1c4c bdcd cd2e fd2a
    Package    : percona-release-0.1-4.noarch (installed)
    From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona
    Is this ok [y/N]: y
    
  2. Next we need enable the mysql service so that the service started at boot.

    sudo systemctl enable mysql
    
  3. Next we need to start mysql

    sudo systemctl start mysql
    
  4. Next we will log into the mysql server and set a new password. To get the temporary root mysql password you will need to run the below command.The command will print the password to the screen. Copy the password.

    sudo grep 'temporary password' /var/log/mysqld.log
    
  5. Login to mysql

    mysql -u root -p
    password: `enter password copied above`
    
  6. Change the root user password to the mysql db

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySuperSecurePasswordhere';
    
  7. Create the sstuser user and grant the permissions.

    mysql> CREATE USER 'sstuser'@'localhost' IDENTIFIED BY 'M0rpheus17';
    

    Note

    The sstuser and password will be used in the /etc/my.cnf configuration.

    mysql> GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'sstuser'@'localhost';
    
    mysql> FLUSH PRIVILEGES;
    
  8. Exit mysql then stop the mysql services:

    mysql> exit
    Bye
    $ sudo systemctl stop mysql.service
    
  9. Now install the Percona software on to the other nodes using the same steps.

Once the service is stopped on all nodes move onto the next step.

Add [mysqld] to my.cnf in /etc/

  1. Copy the below contents to /etc/my.cnf. The node_name and node_address needs to be unique on each of the nodes. The first node does not require the gcomm value to be set.

    $ sudo vi /etc/my.cnf
    
    [mysqld]
    wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
    
    wsrep_cluster_name=popeye
    wsrep_cluster_address=gcomm://  #Leave blank for Master Node. The other nodes require this field. Enter the IP address of the primary node first then remaining nodes. Separating the ip addresses with commas like this 10.30.20.196,10.30.20.197,10.30.20.198##
    
    wsrep_node_name=morpheus-node01
    wsrep_node_address=10.30.20.57
    
    wsrep_sst_method=xtrabackup-v2
    wsrep_sst_auth=sstuser:M0rpheus17
    pxc_strict_mode=PERMISSIVE
    
    binlog_format=ROW
    default_storage_engine=InnoDB
    innodb_autoinc_lock_mode=2
    
  2. Save /etc/my.cnf

Bootstrapping the first Node in the cluster

Important

Ensure mysql.service is stopped prior to bootstrap.

  1. To bootstrap the first node in the cluster run the below command.

    systemctl start mysql@bootstrap.service
    

    Note

    The mysql service will start during the boot strap.

  2. To verify the bootstrap, on the master node login to mysql and run show status like 'wsrep%';

    # mysql -u root -p
    
       mysql>  show status like 'wsrep%';
       +----------------------------------+--------------------------------------+
       | Variable_name                    | Value                                |
       +----------------------------------+--------------------------------------+
       | wsrep_local_state_uuid           | 591179cb-a98e-11e7-b9aa-07df8a228fe9 |
       | wsrep_protocol_version           | 7                                    |
       | wsrep_last_committed             | 1                                    |
       | wsrep_replicated                 | 0                                    |
       | wsrep_replicated_bytes           | 0                                    |
       | wsrep_repl_keys                  | 0                                    |
       | wsrep_repl_keys_bytes            | 0                                    |
       | wsrep_repl_data_bytes            | 0                                    |
       | wsrep_repl_other_bytes           | 0                                    |
       | wsrep_received                   | 2                                    |
       | wsrep_received_bytes             | 141                                  |
       | wsrep_local_commits              | 0                                    |
       | wsrep_local_cert_failures        | 0                                    |
       | wsrep_local_replays              | 0                                    |
       | wsrep_local_send_queue           | 0                                    |
       | wsrep_local_send_queue_max       | 1                                    |
       | wsrep_local_send_queue_min       | 0                                    |
       | wsrep_local_send_queue_avg       | 0.000000                             |
       | wsrep_local_recv_queue           | 0                                    |
       | wsrep_local_recv_queue_max       | 2                                    |
       | wsrep_local_recv_queue_min       | 0                                    |
       | wsrep_local_recv_queue_avg       | 0.500000                             |
       | wsrep_local_cached_downto        | 0                                    |
       | wsrep_flow_control_paused_ns     | 0                                    |
       | wsrep_flow_control_paused        | 0.000000                             |
       | wsrep_flow_control_sent          | 0                                    |
       | wsrep_flow_control_recv          | 0                                    |
       | wsrep_flow_control_interval      | [ 100, 100 ]                         |
       | wsrep_flow_control_interval_low  | 100                                  |
       | wsrep_flow_control_interval_high | 100                                  |
       | wsrep_flow_control_status        | OFF                                  |
       | wsrep_cert_deps_distance         | 0.000000                             |
       | wsrep_apply_oooe                 | 0.000000                             |
       | wsrep_apply_oool                 | 0.000000                             |
       | wsrep_apply_window               | 0.000000                             |
       | wsrep_commit_oooe                | 0.000000                             |
       | wsrep_commit_oool                | 0.000000                             |
       | wsrep_commit_window              | 0.000000                             |
       | wsrep_local_state                | 4                                    |
       | wsrep_local_state_comment        | Synced                               |
       | wsrep_cert_index_size            | 0                                    |
       | wsrep_cert_bucket_count          | 22                                   |
       | wsrep_gcache_pool_size           | 1320                                 |
       | wsrep_causal_reads               | 0                                    |
       | wsrep_cert_interval              | 0.000000                             |
       | wsrep_ist_receive_status         |                                      |
       | wsrep_ist_receive_seqno_start    | 0                                    |
       | wsrep_ist_receive_seqno_current  | 0                                    |
       | wsrep_ist_receive_seqno_end      | 0                                    |
       | wsrep_incoming_addresses         | 10.30.20.196:3306                    |
       | wsrep_desync_count               | 0                                    |
       | wsrep_evs_delayed                |                                      |
       | wsrep_evs_evict_list             |                                      |
       | wsrep_evs_repl_latency           | 0/0/0/0/0                            |
       | wsrep_evs_state                  | OPERATIONAL                          |
       | wsrep_gcomm_uuid                 | 07c8c8fe-a998-11e7-883e-06949cfe5af3 |
       | wsrep_cluster_conf_id            | 1                                    |
       | wsrep_cluster_size               | 1                                    |
       | wsrep_cluster_state_uuid         | 591179cb-a98e-11e7-b9aa-07df8a228fe9 |
       | wsrep_cluster_status             | Primary                              |
       | wsrep_connected                  | ON                                   |
       | wsrep_local_bf_aborts            | 0                                    |
       | wsrep_local_index                | 0                                    |
       | wsrep_provider_name              | Galera                               |
       | wsrep_provider_vendor            | Codership Oy <info@codership.com>    |
       | wsrep_provider_version           | 3.22(r8678538)                       |
       | wsrep_ready                      | ON                                   |
       +----------------------------------+--------------------------------------+
        67 rows in set (0.01 sec)
    

    A table will appear with the status and rows.

  3. Next Create the Database you will be using with morpheus.

    mysql> CREATE DATABASE morpheusdb;
    
    mysql> show databases;
    
  4. 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 'morpheusadmin'@'%' IDENTIFIED BY 'Cloudy2017';
    
  5. Next Grant your new morpheus user permissions to the database.

    mysql> GRANT ALL PRIVILEGES ON * . * TO 'morpheusadmin'@'%' IDENTIFIED BY 'Cloudy2017' with grant option;
    
    
    mysql> FLUSH PRIVILEGES;
    
  6. Checking Permissions for your user.

    SHOW GRANTS FOR 'morpheusadmin'@'%';
    

Bootstrap the Remaining Nodes

  1. To bootstrap the remaining nodes into the cluster run the following command on each node:

    sudo systemctl start mysql.service
    

    The services will automatically connect to the cluster using the sstuser we created earlier.

    Note

    Bootstrap failures are commonly caused by misconfigured /etc/my.cnf files.

Verification

  1. To verify the cluster, on the master login to mysql and run show status like 'wsrep%';

    $ mysql -u root -p
    
     mysql>  show status like 'wsrep%';
    
    +----------------------------------+-------------------------------------------------------+
     | Variable_name                    | Value                                                 |
     +----------------------------------+-------------------------------------------------------+
     | wsrep_local_state_uuid           | 591179cb-a98e-11e7-b9aa-07df8a228fe9                  |
     | wsrep_protocol_version           | 7                                                     |
     | wsrep_last_committed             | 4                                                     |
     | wsrep_replicated                 | 3                                                     |
     | wsrep_replicated_bytes           | 711                                                   |
     | wsrep_repl_keys                  | 3                                                     |
     | wsrep_repl_keys_bytes            | 93                                                    |
     | wsrep_repl_data_bytes            | 426                                                   |
     | wsrep_repl_other_bytes           | 0                                                     |
     | wsrep_received                   | 10                                                    |
     | wsrep_received_bytes             | 774                                                   |
     | wsrep_local_commits              | 0                                                     |
     | wsrep_local_cert_failures        | 0                                                     |
     | wsrep_local_replays              | 0                                                     |
     | wsrep_local_send_queue           | 0                                                     |
     | wsrep_local_send_queue_max       | 1                                                     |
     | wsrep_local_send_queue_min       | 0                                                     |
     | wsrep_local_send_queue_avg       | 0.000000                                              |
     | wsrep_local_recv_queue           | 0                                                     |
     | wsrep_local_recv_queue_max       | 2                                                     |
     | wsrep_local_recv_queue_min       | 0                                                     |
     | wsrep_local_recv_queue_avg       | 0.100000                                              |
     | wsrep_local_cached_downto        | 2                                                     |
     | wsrep_flow_control_paused_ns     | 0                                                     |
     | wsrep_flow_control_paused        | 0.000000                                              |
     | wsrep_flow_control_sent          | 0                                                     |
     | wsrep_flow_control_recv          | 0                                                     |
     | wsrep_flow_control_interval      | [ 173, 173 ]                                          |
     | wsrep_flow_control_interval_low  | 173                                                   |
     | wsrep_flow_control_interval_high | 173                                                   |
     | wsrep_flow_control_status        | OFF                                                   |
     | wsrep_cert_deps_distance         | 1.000000                                              |
     | wsrep_apply_oooe                 | 0.000000                                              |
     | wsrep_apply_oool                 | 0.000000                                              |
     | wsrep_apply_window               | 1.000000                                              |
     | wsrep_commit_oooe                | 0.000000                                              |
     | wsrep_commit_oool                | 0.000000                                              |
     | wsrep_commit_window              | 1.000000                                              |
     | wsrep_local_state                | 4                                                     |
     | wsrep_local_state_comment        | Synced                                                |
     | wsrep_cert_index_size            | 1                                                     |
     | wsrep_cert_bucket_count          | 22                                                    |
     | wsrep_gcache_pool_size           | 2413                                                  |
     | wsrep_causal_reads               | 0                                                     |
     | wsrep_cert_interval              | 0.000000                                              |
     | wsrep_ist_receive_status         |                                                       |
     | wsrep_ist_receive_seqno_start    | 0                                                     |
     | wsrep_ist_receive_seqno_current  | 0                                                     |
     | wsrep_ist_receive_seqno_end      | 0                                                     |
     | wsrep_incoming_addresses         | 10.30.20.196:3306,10.30.20.197:3306,10.30.20.198:3306 |
     | wsrep_desync_count               | 0                                                     |
     | wsrep_evs_delayed                |                                                       |
     | wsrep_evs_evict_list             |                                                       |
     | wsrep_evs_repl_latency           | 0/0/0/0/0                                             |
     | wsrep_evs_state                  | OPERATIONAL                                           |
     | wsrep_gcomm_uuid                 | 07c8c8fe-a998-11e7-883e-06949cfe5af3                  |
     | wsrep_cluster_conf_id            | 3                                                     |
     | wsrep_cluster_size               | 3                                                     |
     | wsrep_cluster_state_uuid         | 591179cb-a98e-11e7-b9aa-07df8a228fe9                  |
     | wsrep_cluster_status             | Primary                                               |
     | wsrep_connected                  | ON                                                    |
     | wsrep_local_bf_aborts            | 0                                                     |
     | wsrep_local_index                | 1                                                     |
     | wsrep_provider_name              | Galera                                                |
     | wsrep_provider_vendor            | Codership Oy <info@codership.com>                     |
     | wsrep_provider_version           | 3.22(r8678538)                                        |
     | wsrep_ready                      | ON                                                    |
     +----------------------------------+-------------------------------------------------------+
    
  2. Verify that you can login to the MSQL server by running the below command on the Morpheus Application server(s).

    mysql -u morpheusadmin -p  -h 192.168.10.100
    

    Note

    This command requires mysql client installed. If you are on a windows machine you can connect to the server using mysql work bench which can be found here https://www.mysql.com/products/workbench/

RabbitMQ Cluster

RabbitMQ Installation and Configuration

Important

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

Prerequisites
yum install epel-release
yum install erlang
Install RabbitMQ on the 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
On Node 1:
cat /var/lib/rabbitmq/.erlang.cookie

Copy this value

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

    chown rabbitmq:rabbitmq /var/lib/rabbitmq/*
    chmod 400 /var/lib/rabbitmq/.erlang.cookie
    
  2. edit /etc/hosts file to refer to shortname of node 1

    example:

    10.30.20.100 rabbit-1
    
  3. Run the commands to join each node to the cluster

    rabbitmqctl stop
    rabbitmq-server -detached
    rabbitmqctl stop_app
    rabbitmqctl join_cluster rabbit@<<node 1 shortname>>
    rabbitmqctl start_app
    
On Node 1:
rabbitmqctl add_user <<admin username>> <<password>>
rabbitmqctl set_permissions -p / <<admin username>> ".*" ".*" ".*"
rabbitmqctl set_user_tags <<admin username>> administrator
On All Nodes:
rabbitmq-plugins enable rabbitmq_stomp

Elasticsearch

Install 3 node Elasticsearch Cluster on Centos 7

Important

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

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)
    

Installation

  1. Download and Install Elasticsearch

    Elasticsearch can be downloaded directly from elastic.co in zip, tar.gz, deb, or rpm packages. For CentOS, it’s best to use the native rpm package which will install everything you need to run Elasticsearch. Download it in a directory of your choosing with the command:

    wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.3.noarch.rpm
    

    Then install it in the usual CentOS way with the rpm command like this:

    sudo rpm -ivh elasticsearch-1.7.3.noarch.rpm
    

    This results in Elasticsearch being installed in /usr/share/elasticsearch/ with its configuration files placed in /etc/elasticsearch and its init script added in /etc/init.d/elasticsearch.

    To make sure Elasticsearch starts and stops automatically, add its init script to the default runlevels with the command:

    sudo systemctl enable elasticsearch.service
    
  2. Configuring Elastic

    Now that Elasticsearch and its Java dependencies have been installed, it is time to configure Elasticsearch.

    The Elasticsearch configuration files are in the /etc/elasticsearch directory. There are two files:

    sudo vi /etc/elasticsearch/elasticsearch.yml
    
    elasticsearch.yml

    Configures the Elasticsearch server settings. This is where all options, except those for logging, are stored, which is why we are mostly interested in this file.

    logging.yml

    Provides configuration for logging. In the beginning, you don’t have to edit this file. You can leave all default logging options. You can find the resulting logs in /var/log/elasticsearch by default.

    The first variables to customize on any Elasticsearch server are node.name and cluster.name in elasticsearch.yml. As their names suggest, node.name specifies the name of the server (node) and the cluster to which the latter is associated.

    Node 1

    cluster.name: morpheusha1
    node.name: "morpheuses1"
    discovery.zen.ping.unicast.hosts: ["10.30.20.91","10.30.20.149","10.30.20.165"]
    

    Node 2

    cluster.name: morpheusha1
    node.name: "morpheuses2"
    discovery.zen.ping.unicast.hosts: ["10.30.20.91","10.30.20.149","10.30.20.165"]
    

    Node 3

    cluster.name: morpheusha1
    node.name: "morpheuses3"
    discovery.zen.ping.unicast.hosts: ["10.30.20.91","10.30.20.149","10.30.20.165"]
    

    For the above changes to take effect, you will have to restart Elasticsearch with the command:

    sudo service elasticsearch restart
    
  3. Testing

    By now, Elasticsearch should be running on port 9200. You can test it with curl, the command line client-side URL transfers tool and a simple GET request like this:

    [~]$ sudo curl -X GET 'http://10.30.20.149:9200'
          {
            "status" : 200,
            "name" : "morpheuses1",
            "cluster_name" : "morpheusha1",
            "version" : {
              "number" : "1.7.3",
              "build_hash" : "05d4530971ef0ea46d0f4fa6ee64dbc8df659682",
              "build_timestamp" : "2015-10-15T09:14:17Z",
              "build_snapshot" : false,
              "lucene_version" : "4.10.4"
            },
    

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 sudo rpm -i morpheus-appliance-x.x.x-1.x86_64.rpm
  1. After installing and prior to reconfiguring, edit the morpheus.rb file

    sudo vi /etc/morpheus/morpheus.rb
    

    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'] = 'morpheusadmin'
    mysql['morpheus_password'] = 'morpheus4admin!'
    rabbitmq['enable'] = false
    rabbitmq['vhost'] = 'morph'
    rabbitmq['queue_user'] = 'lbuser'
    rabbitmq['queue_user_password'] = 'morpheus4admin'
    rabbitmq['host'] = 'morpheus-ha-mq-lb-1.den.morpheusdata.com'
    rabbitmq['port'] = '5672'
    rabbitmq['stomp_port'] = '61613'
    rabbitmq['heartbeat'] = 50
    elasticsearch['enable'] = false
    elasticsearch['cluster'] = 'morpheusha1'
    elasticsearch['es_hosts'] = {'10.30.20.91' => 9300, '10.30.20.149' => 9300, '10.30.20.165' => 9300}
    
  2. Reconfigure Morpheus

    sudo morpheus-ctl reconfigure
    

3 Node with Externalized DB Configuration

Requirements

This guide assumes the following:

  • There is an externalized database running for Morpheus to access.
  • The database service is a MySQL dialect (MySQL, MariaDB, Galera, etc…)
  • A database has been created for Morpheus as well as a user and proper grants have been run for the user. Morpheus will create the schema.
  • The baremetal nodes cannot access the public internet
  • The base OS is RHEL 7.x
  • Shortname versions of hostnames will be resolvable
  • All nodes have access to a shared volume for /var/opt/morpheus/morpheus-ui. This can be done as a post startup step.

Steps

  1. First begin by downloading the requisite Morpheus packages either to the nodes or to your workstation for transfer. These packages need to be made available on the nodes you wish to install Morpheus on.

    [root@app-server-1 ~] wget https://example/morpheus-appliance-package.rpm
    [root@app-server-1 ~] wget https://example/morpheus-appliance-offline-package.rpm
    
  2. Once the packages are available on the nodes they can be installed. Make sure that no steps beyond the rpm install are run.

    [root@app-server-1 ~] rpm -i morpheus-appliance-package.rpm
    [root@app-server-1 ~] rpm -i morpheus-appliance-offline-package.rpm
    
  3. Next you will need to edit the Morpheus configuration file on each node.

    Node 1

    appliance_url 'https://appnode1.example.com'
    elasticsearch['es_hosts'] = {'10.0.2.1' => 9300, '10.0.2.2' => 9300, '10.0.2.3' => 9300}
    elasticsearch['node_name'] = 'morpheus1'
    elasticsearch['host'] = '0.0.0.0'
    rabbitmq['host'] = '0.0.0.0'
    rabbitmq['nodename'] = 'rabbit@appnode1'
    mysql['enable'] = false
    mysql['host'] = '10.0.3.1'
    mysql['morpheus_db'] = 'morpheusdb'
    mysql['morpheus_db_user'] = 'morpheus'
    mysql['morpheus_password'] = 'password'
    

    Node 2

    appliance_url 'https://appnode2.example.com'
    elasticsearch['es_hosts'] = {'10.0.2.2' => 9300, '10.0.2.1' => 9300, '10.0.2.3' => 9300}
    elasticsearch['node_name'] = 'morpheus2'
    elasticsearch['host'] = '0.0.0.0'
    rabbitmq['host'] = '0.0.0.0'
    rabbitmq['nodename'] = 'rabbit@appnode2'
    mysql['enable'] = false
    mysql['host'] = '10.0.3.1'
    mysql['morpheus_db'] = 'morpheusdb'
    mysql['morpheus_db_user'] = 'morpheus'
    mysql['morpheus_password'] = 'password'
    

    Node 3

    appliance_url 'https://appnode3.example.com'
    elasticsearch['es_hosts'] = {'10.0.2.3' => 9300, '10.0.2.1' => 9300, '10.0.2.2' => 9300}
    elasticsearch['node_name'] = 'morpheus3'
    elasticsearch['host'] = '0.0.0.0'
    rabbitmq['host'] = '0.0.0.0'
    rabbitmq['nodename'] = 'rabbit@appnode3'
    mysql['enable'] = false
    mysql['host'] = '10.0.3.1'
    mysql['morpheus_db'] = 'morpheusdb'
    mysql['morpheus_db_user'] = 'morpheus'
    mysql['morpheus_password'] = 'password'
    
  4. Run the reconfigure on all nodes

    [root@app-server-1 ~] morpheus-ctl reconfigure
    

    Morpheus will come up on all nodes and Elasticsearch will auto-cluster.

  5. The only item left is the manual clustering of RabbitMQ. Select one of the nodes to be your Source Of Truth (SOT) for RabbitMQ clustering. We need to share secrets for RabbitMQ, the erlang cookie and join the other nodes to the SOT node.

    Begin by copying secrets from the SOT node to the other nodes.

    [root@app-server-1 ~] cat /etc/morpheus/morpheus-secrets.json
    {
      "mysql": {
        "root_password": "wam457682b67858ae2cf4bc",
        "morpheus_password": "password",
        "ops_password": "98d9677686698d319r6356ae3a77"
      },
      "rabbitmq": {
        "morpheus_password": "adff00cf8714b25mc",
        "queue_user_password": "r075f26158c1fes2",
        "cookie": "6458933CD86782AD39E25"
      },
      "vm-images": {
        "s3": {
          "aws_access_id": "AKIAI6OFPBN4NWSFBXRQ",
          "aws_secret_key": "a9vxxjH5xkgh6dHgRjLl37i33rs8pwRe3"
       }
      }
     }
    
  6. Then copy the erlang.cookie from the SOT node to the other nodes

    [root@app-server-1 ~] cat /opt/morpheus/embedded/rabbitmq/.erlang.cookie
    # 754363AD864649RD63D28
    
  7. Once this is done run a reconfigure on the two nodes that are NOT the SOT nodes.

    [root@app-server-2 ~] morpheus-ctl reconfigure
    

    Note

    This step will fail. This is ok, and expected. If the reconfigure hangs then use Ctrl+C to quit the reconfigure run and force a failure.

  8. Subsequently we need to stop and start Rabbit on the NOT SOT nodes.

    [root@app-server-2 ~] morpheus-ctl stop rabbitmq
    [root@app-server-2 ~] morpheus-ctl start rabbitmq
    
  9. After this has been completed we can ensure our scripts and binaries are in our path for manual joining. This is done on both of the NOT SOT nodes.

    [root@app-server-2 ~] PATH=/opt/morpheus/sbin:/opt/morpheus/sbin:/opt/morpheus/embedded/sbin:/opt/morpheus/embedded/bin:$PATH
    
  10. Then we will stop the Rabbit service within the Erlang VM and cluster the Rabbit nodes on the two nodes that are NOT the SOT node.

    [root@app-server-2 ~] rabbitmqctl stop_app
    # Stopping node 'rabbit@app-server-2' ...
    [root@app-server-2 ~] rabbitmqctl join_cluster rabbit@app-server-1
    # Clustering node 'rabbit@app-server-2' with 'rabbit@app-server-1' ...
    [root@app-server-2 ~] rabbitmqctl start_app
    # Starting node 'rabbit@app-server-2' ...
    
  11. The last thing to do is restart the Morpheus UI on the two nodes that are NOT the SOT node.

    [root@app-server-2 ~] morpheus-ctl restart morpheus-ui
    
  12. If this command times out then run:

    [root@app-server-2 ~] morpheus-ctl kill morpheus-ui
    [root@app-server-2 ~] morpheus-ctl start morpheus-ui
    
  13. You will be able to verify that the UI services have restarted properly by inspecting the logfiles. A standard practice after running a restart is to tail the UI log file.

    [root@app-server-2 ~] morpheus-ctl tail morpheus-ui
    
  14. For moving /var/opt/morpheus/morpheus-ui files into a shared volume make sure ALL Morpheus services on ALL three nodes are down before you begin.

    [root@app-server-1 ~] morpheus-ctl stop
    

Important

Permissions are as important as is content, so make sure to preserve directory contents to the shared volume. Subsequently you can start all Morpheus services on all three nodes and tail the Morpheus UI log file to inspect errors.