-
Notifications
You must be signed in to change notification settings - Fork 4
Setting Up Standalone Amazon EC2 Instances
For BusinessEvents multihost clustering, you must create Amazon Elastic Cloud Compute (Amazon EC2) instances and configure Docker and Weave Net on each of them. This setup is common for shared all and shared-nothing persistence options.
-
Log in to Amazon EC2 console with your credentials.
Refer Amazon EC2 documentation for more details on setting Amazon EC2 account.
-
In the Amazon EC2 console, create a new security group with the following inbound rules.
Rule No. Type Protocol Port Source 1 SSH TCP 22 Anywhere 2 Custom TCP Rule TCP 6783 Anywhere 3 Custom UDP Rule UDP 6783 Anywhere 4 Custom TCP Rule TCP Anywhere Note: Port TCP/UDP 6783 is required for weave networking. You can configure source according to your requirement.
Refer Amazon EC2 security group for details on how to create security group.
-
On the Amazon EC2 console, create two or more Standalone Amazon EC2 instances of type Ubuntu or CentOS or as per your requirement. Specify the configuration parameters according to your requirement in the wizard.
- Select the default Virtual Private Cloud (VPC) for testing purpose or you can use an customized one.
- Select the security group created earlier in Step 2.
- Generate a new key pair (
.pem
) per instance and save it.
-
In the Amazon EC2 console, on Review Instance Launch page, check the details of your instance, and after the verification click Launch.
-
Ensure that all instances are in the "running" state and status checks are marked with no error.
-
Note down the public and private IP address/DNS of all instances, which can be later used for connection.
-
Change the permission of PEM key.
> chmod 400 mykey.pem
-
Securely log in to Amazon EC2 instances using an SSH client.
> ssh -i /pathto/mykey.pem ec2-user@<public IP address of EC2 instance or public DNS>
Note: User name could be
ec2-user
orubuntu
as per the Amazon EC2 instance type. -
Install Docker on all Amazon EC2 instances.
Refer to the installation instructions mentioned in the Docker Documentation.
-
Install Weave Net all EC2 instances.
> sudo curl -L git.io/weave -o /usr/local/bin/weave > sudo chmod a+x /usr/local/bin/weave
Refer to the installation instructions in the Weave Net documentation.
-
Start weave on each instance, and provide it other peers private IP addresses.
On Instance 1,
> weave launch
On Instance 2,
> weave launch <HostName/Private IP address of Instance 1>
-
Run the following command and check status of the peers connection.
> weave status
If the connection is successful, the status displays the number of established connections. For example,
Peers: 2 (with 2 established connections)
Parent topic: Setting Up BusinessEvents Multihost Clustering on Amazon EC2 Instances Using Docker
Next topic: Configuring Amazon RDS for Shared All Persistence