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:
Table of Contents | ||||
---|---|---|---|---|
|
...
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>
- Check to ensure that the apim-puppet-master instance is running. As you are now in the private network, you can use the puppet master instance's private IP.
From the bastion instance, connect to the puppet master instance using SSH.
Code Block ubuntu@bastion-public:~$ ssh ubuntu@<private IP>
- Install the puppet master in this instance. See https://docs.puppetlabs.com/guides/install_puppet/install_debian_ubuntu.html for instructions.
Download the APIM-1.9 puppet modules from here, extract and copy to the
/etc/puppet
directory. Overwrite any existing files.Change the parameter file
/etc/puppet/module/apimanager/manifest/param.pp
according to the requirements of your environment.Download the following files and place them in the given locations.
File Download from Copy to wso2am-1.9.0.zip http://wso2.com/api-management/try-it/ modules/apimanager/files/distribution
jdk-7u75-linux-x64.tar.gz http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html modules/apimanager/files
mysql-connector-java-5.1.23-bin.jar http://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.23 modules/apimanager/files/common/configs/repository/components/lib
svnkit-1.3.9.wso2v2.jar Click here modules/apimanager/files/gate-way-m/configs/repository/components/dropins/
modules/apimanager/files/gateway/configs/repository/components/dropins
trilead-ssh2-1.0.0-build215.jar Click here modules/apimanager/files/gate-way-m/configs/repository/components/lib
modules/apimanager/files/gateway/configs/repository/components/lib
...
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.
...