This article is a guide to help users set up, install and cluster Liferay DXP 7.0 or 7.1 on AWS Elastic Compute Cloud (EC2).
Resolution
EC2 Instance Set Up
There are 2 kinds of EC2 instances: (1) EC2-classic and (2) EC2-VPC. Please refer to Amazon's documentation for more detailed information: Differences Between EC2-Classic and EC2-VPC
Each EC2 instance needs to be accessible to the other. If a domain name is available for each node, it is better to assign elastic IP address. By default, the public address of the server is dynamic—meaning a new address is assigned when the server is restarted—whereas elastic IP addresses are not dynamic.
When launching a server, make sure the right protocol and ports are enabled as you define the Security Group. You can also edit existing security groups if you need to change or add rules.
Make EC2 Server Available to Internet
By default, EC2-VPC is not available to the internet. To make it available to the internet, you need to create an internet gateway for the VPC and associate the gateway to the route table. You can do this via the VPC Management Console under the Networking section.
Portal Installation
You can install the Liferay platform either by using our bundles or by manually installing it on an existing application server. Since this task is not much different from setting up the Liferay platform on a local server, you may simply follow our official documentation for getting your installation started.
Depending on your operating system’s security settings and firewall, you may need to allow the appropriate traffic as well.
Clustering Liferay DXP on EC2
EC2 only supports Unicast at this time. And while Amazon has a Multicast proof of concept via IP_GRE, it has not been tested with the Liferay platform and is not supported by Liferay Support. To configure the Liferay platform's Ehcache for Unicast, you will need to customize the tcp.xml that comes with our implementation of JGroups. Below are quick guides for doing this:
- Clustering With TCP Unicast
- For other Unicast transportation methods, such as JDBC and S3 Ping, please see: Managing Liferay Portal's Distributed Cache, specifically, the Default (MPING + UDP/IP Multicast) section.
You'll also need to make sure to configure the EC2 Security Group to allow JGroups traffic. If you find that you have correctly setup the Liferay platform and JGroups clustering, but Liferay platform's clustering still isn't working and there are no errors thrown, it is likely because the EC2 Security Groups are not allowing the appropriate traffic.
Please see the Additional Info below to read the Amazon EC2 Security Group documentation.