Gateway High Availability Use Cases

This section discusses gateway high availability use cases.

Gateway High Availability Use Cases

If you have deployed the cloud agent with a single gateway, and the gateway goes down, no data will be transmitted to Oracle Management Cloud. To avoid this, you can implement gateway high availability: you can deploy a second gateway and ensure that the cloud agent uses the second gateway to communicate with Oracle Management Cloud if the first gateway is down.

High availability of gateways is supported by configuring cloud agents with two or more gateway URLs. Cloud agents will load-balance between the two gateways. Since there are multiple paths for the data to flow to Oracle Management Cloud, loss of a single gateway will not affect the communication to Oracle Management Cloud.

The following use cases are supported:

  • Adding Additional Gateways while Deploying the Cloud Agent

    You can deploy two gateways (gateway_1 and gateway_2) before you deploy the cloud agent. When you install the cloud agent, you must first specify the gateway_1 host and port number and then specify gateway_2 by passing the ADDITIONAL_GATEWAYS parameter. Run the following command on the host on which cloud agent is being deployed:

    ./AgentInstall.sh GATEWAY_HOST=<gateway_host_1> GATEWAY_PORT<gateway_port_1> ADDITIONAL_GATEWAYS=<https://<gateway_host_2>:<gateway_port_2>

    where:
    • gateway_host_1 is the host on which the first gateway is deployed.

    • gateway_port_1 is the port number of the host on which the first gateway is deployed.

    • gateway_host_2 is the host on which the second gateway is deployed.

    • gateway_port_2 is the port number of the host on which the second gateway is deployed.

    Note:

    You can get the gateway information by running the following command on the hosts on which the gateways are deployed: <AGENT_BASE_DIRECTORY>/agent_inst/bin/omcli status agent
  • Adding Additional Gateways to an Existing Deployed Cloud Agent

    To add additional gateways to a cloud agent that has already been deployed with a gateway, follow these steps:

    1. Run the following command on the host on which you want to deploy the cloud agent with the first gateway:

      ./AgentInstall.sh AGENT_TYPE=cloud_agent AGENT_BASE_DIRECTORY=<the absolute path to the agent base directory> AGENT_REGISTRATION_KEY=<registration key value> GATEWAY_HOST=<gateway_host_1> GATEWAY_PORT=<gateway_port_1>

    2. Run the following command on the host on which you want to deploy the second gateway:

      ./AgentInstall.sh AGENT_TYPE=gateway AGENT_BASE_DIRECTORY=<the absolute path to the agent base directory> AGENT_REGISTRATION_KEY=<registration key value>

    3. Run the following command on the host on which the second gateway was deployed to get the gateway URL.

      ./<AGENT_BASE_DIRECTORY>/agent_inst/bin/omcli status agent

      Example result of the preceding command:: https://my.example.com:1838/test/main/

    4. Create a plain text file, gateway.txt, as follows:

      vi gateway.txt

      Insert the URL for the second gateway in the following format and save the file.

      gatewayUrls=https://<gateway_host_2>:<gateway_port_2>

    5. Navigate to the /bin directory of the cloud agent and run the following command to add the gateway:

      ./<AGENT_BASE_DIRECTORY>/agent_inst/bin/omcli add_gateway agent <full path to the gateway.txt file>

    6. Stop the cloud agent.

      ./omcli stop agent

    7. Navigate to the  <AGENT_BASE_DIRECTORY>/core/1.<n>.0/stage/sysman/config/server/ directory on the gateway host that was added above and copy the importCert file to the cloud agent host as follows:

      <AGENT_BASE_DIRECTORY>/core/1.<n>.0/stage/sysman/config/server/trustedcerts/trustCertGateway_<gateway-host-added> 

      Example:  <AGENT_BASE_DIRECTORY>/core/1.<n>.0/stage/sysman/config/server/trustedcerts/trustCertGateway_my_example_com_3476

    8. Back up the existing certificates directory.

      mv <AGENT_BASE_DIRECTORY>/agent_inst/sysman/config/server  <AGENT_BASE_DIRECTORY>/agent_inst/config/server_bak

      mkdir  <AGENT_BASE_DIRECTORY>/agent_inst/sysman/config/server

    9. Secure the cloud agent.
      ./omcli secure agent
      
    10. Start the cloud agent.

      ./omcli start agent

    11. Update the associations between Cloud Agent and the new Gateway.

      1. Click on the hamburger menu at the top left corner of the Console UI.
      2. Navigate to Administration>Discovery>Entity Associations.
      3. Select the Cloud Agent from the drop down list which you have added the new Gateway.
      4. Click + Add Associations.
      5. In the Popup, select Association Type: "Uses", click on + Add Destination Entities and select the Gateways.
      6. Once you are done, click the Save.