This guide explains how to set up an API Manager cluster in an Amazon Web Services (AWS) instance.
...
To create a VPC Internet gateway, go to your AWS instance and click Services -> VPC -> Internet Gateways. Then, click Create Internet Gateway and give a name for your new gateway. Here's an example:
Creating subnets
A subnet is a range of IP addresses in your VPC. You can launch AWS resources into a subnet that you select. Use a public subnet for resources that must be connected to the Internet, and a private subnet for the ones that don't.
According to the deployment pattern shared earlier, you need the following seven subnets across the three availability zones. You can use a subnet naming convention of your choice.
...
To create a new key pair, go to your AWS instance and click Services -> EC2 -> Key pair -> Create Key Pair. Then, download the created key pair to your host machine.
Creating instances
Let's see how to create six instances as follows:
...
Creating a bastion instance
A bastion is a special-purpose server instance that is designed to be the primary access point from the Internet. It acts as a proxy to your other EC2 instances. In this guide, we use it as a base instance in our VPC and configure it to connect to other instances in our VPC via SSH.
Follow the steps below to create a bastion instance:
...
Creating a puppet master instance
A puppet is a configuration management system that allows you to define the state of your IT infrastructure, then automatically enforces the correct state.
Follow the steps below to create a puppet master instance.
...
In your AWS instance, click S ervices -> RDS -> Subnet Groups -> Create DB Subnet Group.
In the Create DB Subnet Group page that opens, fill in the details according to your environment and click Create .
In this guide, we select the VPC that is created here and add the two subnets that are hosted in two availability zones separately.
Next, let's create the RDS instance.In your AWS instance, click Services -> RDS -> Instance -> Launch DB Instance .
Select MySQL as the database engine.
In the second step, choose the options to use Multi-AZ deployment.
In step 3, the Specify DB Details page, enter the database settings.
In this guide, the DB instance identifier is apim-db and master username is wso2.
In the Configure Advanced Settings page, set the network, database options, and backup plans.
Go to your AWS instance and click Services -> RDS -> Instances. Then, select the database that you created earlier (in this example, it is
apim-db
) and note the details of the RDS instance that you just created. The Endpoint specifies the server URL for connecting to the database.
...
Connect to the bastion instance using SSH.
Code Block root# ssh -i <security certificate file path> ubuntu@<give the public IP>
- Connect to the MySQL server using the MySQL client.
- Create the databases described in https://docs.wso2.com/display/AM190/Setting+up+MySQL using the MySQL server. Note that you can change the names of these databases as you like.
...
- In your AWS instance, click Services -> EC2 -> Load Balancers -> Create Load Balancer.
- In the Define Load Balancer page that opens, give a name for the ELB (e.g.,
apim-elb-pubstore
), specify the VPC, and map the incoming port to another port in the backend by configuring the Basic Configuration tab as shown below: - On the Select Subnets tab, add the DMZ subnets as selected subnets and go to the next page.
- In the Assign Security Groups page that opens, select
apim-dmz-sg
as the security group and go to the next page. - In the Configure Security Settings page that opens, configure the SSL details and proceed to the next page.
- In the Configure Health Check page that opens, set the following options and proceed to the next page.
Ping port: 9443
Ping path /services/echo?wsdl
- Leave the default settings in the Add EC2 Instances page that opens and proceed to the next page. You can edit the ELB later to add the instances that are fronted by this ELB.
- In the Add Tags page that opens, tag the ELB and click Create.
- Click the load balancer's name in the status message that appears confirming that the load balancer is created.
- Find the DNS name in the ELB’s description tab and make a note of it. You need this later for configuring the Puppet Master parameter file.
- Repeat the steps you used to create the
apim-elb-pubstore
ELB to createapim-elb-keymanager
,apim-elb-gateway-mgt
, andapim-elb-gateway-wkr
ELBs as well.
...
According to our sample deployment architecture, you need only one Gateway Manager instance in a us-east-1b
availability. The instance must be in the apim-subnet-b subnet.
...
- Clustering API Manager in Amazon Web Services (AWS)
- Clustering API Manager in Amazon Web Services (AWS)
Creating launch configurations
A A launch configuration is a template that an Auto Scaling auto scaling group uses to launch EC2 instances.
Follow the steps below to create launch configurations.
In your AWS instance, click Services -> EC2 -> > Launch Configurations -> Create Launch Configuration.
In the the Choose AMI page page that opens, select the AMI you created earlier .
In the Choose AMI window, select the AMI you created earlier.
...
and proceed to the next tab.
Proceed through the rest of the configurations by giving the values according to your requirements. Select
apim-puppetmaster-sg
andapim-natsg
as the security groups in the Configure Security Groups tab.In the Review page, review the configuration summary and click Launch.
Select the previously created key pair.
Now that you have created the launch configurations for your auto scaling groups, let's proceed to create the auto scaling groups.
Creating auto scaling groups
You create an auto scaling group by specifying the minimum, maximum and the desired number of EC2 instances for the group. When you create an auto scaling group using an EC2 instance, a launch configuration for the group is automatically created for you. This launch configuration has the same name as the auto scaling group, and it derives its attributes, such as AMI ID, instance type, and Availability Zone, from the EC2 instance.
Follow the steps below to create an auto scaling group.
In your AWS instance, click Services -> EC2 -> Auto Scaling Groups -> Create Auto Scaling Group.
Select the launch configuration that you created in the previous section and proceed to the next page.
- In the Configure Auto Scaling Group Details page that opens, configure the details as follows and proceed to the next page.