NDS Labs Project: QMCDB
Launching and Initializing the MongoDB Server
...
This process engages scripts and python code from our QMCDB software package. The latest development versions of the server setup can be found in the "setup" branch of Ray's development fork.
<<TableOfContents>>
Table of Contents |
---|
Prepping and Launching the VM
This section discusses how to take a generic CoreOS machine image in !OpenStack and ready it for use as a host for the MongoDB Docker container. Much of this is done through the !OpenStack portal on nebula, and the steps for doing it are described only at a high level here; consult RaysNotesUsingLabs for details about what buttons to push.
- Make sure you have created your SSH key pair.
- download it to your $HOME/.ssh directory on the machine that you will log in from
- Create necessary Security Groups that open the machine's firewall, where needed.
- Make sure there is a group that allows SSH logins
- Create a group that opens port 27017 (TCP, Ingress) for connecting to the MongoDB server
- Reserve a floating IP address.
- Create and launch a machine instance from the CoreOS image. We're currently using the "m1.small", but the "m1.tiny" might suffice in the future. Attach the above mentioned security groups to it.
- Create a storage volume. This provides persistent storage that won't disappear if the machine instance disappears.
- We're currently using a 4 GB volume--plenty for holding MongoDB data
- If we plan to also store simnulation datasets here as well, a larger or additional volume may be needed.
- Attach the volume to your machine instance.
- Note the device name that it gets assigned (e.g.
/dev/vdb
)
- Note the device name that it gets assigned (e.g.
Log into the machine as user, "core", via SSH using the IP address assign to it; use the SSH key created earlier.
Code Block ssh -i ~/.ssh/labs_key core@141.142.XXX.XXX
You can save yourself some typing by adding the following to your {{~/.ssh/config}} file.
Code Block title ~/.ssh/config Host 141.142.XXX.XXX IdentityFile ~/.ssh/labs-default User core
This allows you to log in with just the following:
Code Block ssh 141.142.XXX.XXX
Partition and format the volume.
To partition, type
sudo fdisk /dev/vdb
and use the interactive menu to create a partition table.- create one partition spanning the whole disk
- To format, type
sudo mkfs -t ext4
- CoreOS uses systemd (instead of fstab) to mount files. See these details on how to configure automounting. Mount the new drive (
/dev/vdb1
) as/data
Create MongoDB's the data directory
Code Block sudo chown core:core /data mkdir qmcdb
...