Step 3. Connect to MongoDB Nodes Once the AWS CloudFormation template has successfully created the stack, all the MongoDB nodes will be running with the software installed in your AWS account. To connect to any of the MongoDB nodes, use SSH to connect to the NAT instance. In the Amazon EC2 console, choose the instance, and then choose Connect . Figure 8: Connecting to a MongoDB Node
Amazon Web Services – MongoDB on the AWS Cloud August 2016 Page 20 of 26 Once you connect to the NAT instance by using SSH, you can connect to any of the MongoDB nodes in a similar fashion (choose the node, and then choose Connect to find the SSH command). Important You need the private key (.pem) file to connect to MongoDB nodes. Copy the private key (.pem) file into the NAT instance; for example: scp – i mykey.pem mykey.pem [email protected]:/home/ec2-user/mykey.pem Note that all the MongoDB nodes are launched with an IAM role that grants them privileges to create and delete Amazon DynamoDB tables, to access Amazon Simple Storage Service (Amazon S3), to create and delete Amazon EC2 instances, and so on. You can modify the policy by using the IAM console. For details about the benefits of IAM roles, see Using IAM Roles to Delegate Permissions to Applications that Run on Amazon EC2 in the AWS documentation. Testing MongoDB After the AWS CloudFormation template has completed successfully, the system will have a mongos instance running on each of the primary replica set nodes. To validate the system and verify the configuration, follow these steps: 1. Use SSH to log in to one of the primary instances created by the Quick Start template. 2. Execute the following commands from the terminal: mongo sh.printShardingStatus() 3. Verify that the mongo shell connects to the local host on the default TCP port (27017), and that the output reflects the configuration that you specified for the Quick Start template. For additional information on testing the MongoDB server, see the MongoDB documentation.
Amazon Web Services – MongoDB on the AWS Cloud August 2016 Page 21 of 26 Backing Up Your Data For backup, we recommend using Amazon S3 to keep a copy of your MongoDB data. Amazon S3 stores data objects redundantly on multiple devices across multiple facilities and allows concurrent read or write access to these data objects by many separate clients or application threads. You can use the redundant data stored in Amazon S3 to recover quickly and reliably from instance or application failures. For other backup strategies, see the MongoDB documentation . Security The AWS cloud provides a scalable, highly reliable platform that helps customers deploy applications and data quickly and securely. When you build systems on the AWS infrastructure, security responsibilities are shared between you and AWS . This shared model can reduce your operational burden as AWS operates, manages, and controls the components from the host operating system and virtualization layer down to the physical security of the facilities in which the services operate. In turn, you assume responsibility and management of the guest operating system
You've reached the end of your free preview.
Want to read all 26 pages?
- Spring '17
- Amazon Web Services, AWS, Amazon Elastic Compute Cloud, aws cloud