3. Create EC2 instances
We are going to launch two EC2 instances and install MiaRec software on them. These two instances will be created in different Availability Zones for redundancy.
To create EC instance:
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2
- Select Instances in the left pane and click Launch Instance
Step 1. Choose an Amazon Machine Image (AMI)
Select Ubuntu Server 14.04 LTS, EBS General Purpose (SSD) Volume Type.
MiaRec supports the following operating systems:
- Centos 6
- Centos 7
- Ubuntu Server 14.04 LTS
- Ubuntu Server 16.04 LTS
Step 2. Choose an Instance Type
Amazon EC2 provides a wide selection of instance types optimized to fit different use cases. Instances are virtual servers that can run applications. They have varying combinations of CPU, memory, storage, and networking capacity.
For MiaRec, we recommend Compute Optimized instances. Refer to the following table for instance type recommendations. These recommendations are based on average system usage (10 calls per day per user, 5 minutes average call duration). Actual hardware requirements may be differ in your case.
Max subscribers | Instance Type | vCPU | Memory (GiB) | Storage | On-demand, Monthly * | 1-Year Term, No Upfront, Monthly * |
---|---|---|---|---|---|---|
250 | c4.large | 2 | 3.75 GiB | EBS only | $72.00 | $45.99 |
500 | c4.xlarge | 4 | 8 GiB | EBS only | $143.28 | $91.98 |
1,000 | c4.2xlarge | 8 | 15 GiB | EBS only | $286.56 | $183.96 |
2,000 | c4.4xlarge | 16 | 31 GiB | EBS only | $573.12 | $367.92 |
(*) - The provided pricing as of data of article (Septempter, 2017) for US-East region, Linux host (Centos/Ubuntu/Amazon Linux).
More than 2,000 users? We recommend to use a decoupled architecture instead of all-in-one setup.
Step 3. Configure Instance Details
Choose separate subnets for each of two MiaRec instances. This will allow to deploy them in different Availability Zones for redundancy.
Shutdown behavior should be set to Stop.
We recommend to Enable termination protection as a protection from accidental deletion of server.
Step 4. Add Storage
Specify the desired disk storage size for EBS volume.
- As a Volume Type select General Purpose SSD as a minimum. For high load, it is possible to select Provisioned IOPS SSD (it is more expensive, but provides guaranteed I/O performance).
Imporant!. Uncheck Delete on Termination. This will allow you to detach this EBS volume from EC2 instance and attach to new one, for example, with better hardware specs.
Disk storage will be used for:
- OS and application files
- Database data files, approximately 3GB per 1 million records in database
- Application logs
- Temporary location for audio files (before the files are uploaded to S3 for long term storage). 0.24 MB/minute in MP3 stereo format. We recommend to keep available disk space for at least 3 days of data. In case of issues in upload process to S3, it gives enough time to administrator to troubleshoot and fix issue. This will make the system less dependent on S3 availability.
Number of users | Avg calls/day/user | Avg duration | Total minutes/day | Storage/day | Recommended EBS volume |
---|---|---|---|---|---|
50 | 10 | 5 min | 75,000 min | 18 GB | 100 GB |
100 | 10 | 5 min | 150,000 min | 36 GB | 150 GB |
250 | 10 | 5 min | 375,000 min | 90 GB | 320 GB |
500 | 10 | 5 min | 750,000 min | 180 GB | 600 GB |
1,000 | 10 | 5 min | 1,500,000 min | 360 GB | 1,200 GB |
2,000 | 10 | 5 min | 3,000,000 min | 720 GB | 2,400 GB |
Step 6. Configure Security Group
A security group is a set of firewall rules that control the traffic for your instance.
MiaRec application requires the following ports to be opened:
- TCP 22 for SSH inbound connection
- TCP 80 and 443 for web server
- TCP 6554 and UDP 7000-7999 for live monitoring (optional)
- TCP/UDP 5080 for SIPREC signaling and UDP 20000-23999 for RTP media (these port values can be changed in MiaRec web admin portal)
Important!. In the following example, SIPREC and RTP ports are opened to all sources (0.0.0.0/0). For security reasons, access to these ports should be limited to your phone only. Specify there the IP-addresses, from which your phone system sends SIPREC and RTP traffic.
Create SSH keys
When you launch an instance, you should specify the name of the key pair you plan to use to connect to the instance. You can use Amazon EC2 to create your key pair. Alternatively, you could use a third-party tool and then import the public key to Amazon EC2.
If you use Amazon to create your key pair, then you have to download the private key file (*.pem file) and store it in a secure and accessible location. You will use this key to access the instance via SSH.
Check status of running instances
Navigate to Instances section of EC2 Dashboard to see your new instance running.