Configuring the Data Backend on Mlab

13 Sep

Revision for “Configuring the Data Backend on Mlab” created on February 18, 2017 @ 21:21:54

Title
Configuring the Data Backend on Mlab
Content
<h2><span style="color: #ff0000;"><strong>Before continuing, print out <a href="http://www.nightscout.info/wp-content/uploads/2015/04/Mongo-and-Azure-Account-Information-4-16-15.pdf">this</a> worksheet and fill it out as you move forward: </strong></span><span style="text-decoration: underline;"><a href="http://www.nightscout.info/wp-content/uploads/2015/04/Mongo-and-Azure-Account-Information-4-16-15.pdf">Mlab, Github &amp; Azure Account Info</a></span></em></h2> <h3>Heroku as an Alternative</h3> If you plan to use Heroku rather than Azure to host your Nightscout site, you do not need to set up Mlab separately. Heroku creates the Mlab portion automatically. <a href="http://www.nightscout.info/wiki/welcome/set-up-nightscout-using-heroku">Heroku site creation directions.</a> <blockquote class="yellowBox">Note: If you plan to use Heroku rather than Azure, you do not need to set up Mlab separately. Move on to <a href="http://www.nightscout.info/wiki/welcome/monitor-cgm-web#github">GitHub setup</a> (Step 1 only) and then <a href="http://www.nightscout.info/wiki/welcome/set-up-nightscout-using-heroku">Heroku deployment and configuration</a>.</blockquote> <p></p> <!-- Removed after discussion with JW on 4/20/16 <h3>Video</h3> <em>There is a video of this process available here: <a href="http://youtu.be/dPXURXyIzYM" target="_blank">http://youtu.be/dPXURXyIzYM</a></em> <blockquote>(<strong>WARNING: The video is outdated and may not show all steps required, including configuration of the REST API Upload method. MONGODB upload will not currently work with the Nightscout app, as of 9/30/15.)</strong></blockquote> --> <h3>Accounts and User Names</h3> For ease of use, consider using the same name for every username. Do NOT use your "regular" passwords that you use for banking, emails or other sensitive accounts.  At times, when you need assistance, you <span style="text-decoration: underline;">may</span> need to share the username &amp; password of your Nightscout setup accounts with the individuals providing help to you. <em><strong>Usernames and Passwords cannot contain ANY spaces, symbols or special characters.  Use Upper and lower case alpha-numeric characters only.  This includes letters and numbers. </strong></em> Please use the worksheet linked above to keep track of this <span style="text-decoration: underline;"><strong>vital</strong></span> information.  Without this information, you cannot install Nightscout. <h3><strong>Sign up for an Mlab Account</strong></h3> Sign up for a <span style="text-decoration: underline;"><strong>FREE</strong></span> Sandbox account at <a href="https://mlab.com/plans/">http://www.mlab.com/plans.</a> <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-createaccount.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-createaccount.png" alt="mlab-createaccount" width="419" height="509" class="wikiImage" /></a> <blockquote><strong>Note:</strong> Mongolab changed its name to <strong>Mlab</strong> in March of 2016. Any references to Mongolab in the documentation on the Nightscout site is <em>synonymous</em> with Mlab. This document has been updated, but you will see the term Mongolab used throughout the Nightscout site and directions. <em>You should assume it means Mlab unless instructed otherwise.</em></blockquote> After creating your account, open your e-mail to verify your e-mail address and sign back in to the Mlab web page. <h3>Create a New MongoDB Database</h3> <ol> <li class="listPadding">Click the "Create new" button on the right with the lightning bolt. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-lightningbolt.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-lightningbolt.png" alt="mlab-lightningbolt" width="127" height="47" class="wikiImage" /></a> </li> <li class="listPadding">On the "Create new subscription" page, you can choose from available cloud providers. Options <strong>may</strong> include: <strong>Amazon Web Services, Google Cloud Platform, or Microsoft Azure</strong>.  Select one. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-createnew.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-createnew.png" alt="mlab-createnew" width="500" class="wikiImage" /></a> </li> <li class="listPadding">Specify a region from the dropdown menu. The location represents where the sandbox is located, NOT where you are located.  <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-location.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-location.png" alt="mlab-location" width="545" height="383" class="wikiImage" /></a> (The image above shows a sample screenshot for location options when Amazon Web Services has been selected as the Cloud Provider. <strong>You can choose whichever Cloud Provider and whichever location you wish.</strong>)</li> <li class="listPadding">Click the button for Single-Node Development to use the free option. This will entitle you to half a gig of data, which should last over 5 years with the current Nightscout setup. Continue to step 4. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-sandbox1.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-sandbox1.png" alt="mlab-sandbox" width="500" class="wikiImage" /></a> </li> <li class="listPadding">Click to select the free "Sandbox" option.</li> <li class="listPadding">Enter a database in the box. <strong>Note:</strong> The database name must be lower case. A good practice is to simply put db on the end of your username, but it’s entirely up to you. <span style="color: #ff0000;"><strong>WRITE IT DOWN!</strong></span> <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-new-dbname.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-new-dbname.png" alt="mlab-new-dbname" width="500" class="wikiImage" /></a> </li> <li class="listPadding">Click the "Create New MongoDB Deployment" button. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-create.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-create.png" alt="mlab-create" width="500" class="wikiImage" /></a> </li> <strong>Note:</strong> If it doesn't say <strong>$0</strong>, you have done something incorrectly. Be sure you have selected a Sandbox. </ol> <h5><strong>Create a User inside your Mlab Database</strong></h5> <ol> <li class="listPadding">Click on the <strong>name</strong> of the newly created database to open it. Mlab will show you an alert that you do not have a user and will display a link so you can create one. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-user.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-user.png" alt="mlab-user" width="500" class="wikiImage" /></a> </a></li> <li class="listPadding">Click the link to open the "Add New Database User" dialog. <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-addnewuser.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-addnewuser.png" alt="mlab-addnewuser" width="337" height="322" class="wikiImage" /></a> </li> <li class="listPadding">Enter a database username and password and click the <strong>Create</strong> button. <span style="color: #ff0000;">You'll need these values later to complete the Mlab URI string. <em><strong>Write them down</strong></em>!</span> Do not use any special characters such as @ or ) or ^.  The Cloud system will not recognize these special characters.  Use Upper and Lowercase alpha ONLY. <strong> Do not select "Make read-only" or you will be unable to upload data to the database.</strong></li> </ol> <h3><strong>Record Your MongoDB Connection Strings</strong></h3> Once everything has been configured, on the <strong>Database Summary</strong> page, make note of the link at the top  just under "<strong>To connect using a driver via the standard URI"</strong>, as some of this information may be used to configure the uploader app and the Azure web server that will display your data. <span style="color: #ff0000;"><strong>IMPORTANT:</strong> If this information is not entered correctly in later steps, your system will not work!  At this time, you are only writing it down for later use. </span> <a href="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-uri.png"><img src="http://www.nightscout.info/wp-content/uploads/2014/09/mlab-uri.png" alt="mlab-uri" width="500" class="wikiImage" /></a> The above URI is a sample only. <strong>Yours will look different based on your own information.</strong> The URI will look something like these examples: Generic URI code: <!-- OLD format: mongodb://&lt;dbuser&gt;:&lt;password&gt;@aabbb.mongolab.com:11111/&lt;database&gt; --> <span class="redText">mongodb://&lt;dbuser&gt;:&lt;password&gt;@aabbb.mlab.com:11111/&lt;database&gt;</span> Sample URI with a sample person's information (note that the &lt; &gt; symbols have been removed): <!-- OLD format: mongodb://sallyuser:sallypassword@aabb22.mongolab.com:11111/nightscout --> <span class="redText">mongodb://sallyuser:sallypassword@aabb22.mlab.com:11111/nightscout</span> When recording the URI, replace &lt;user&gt; and &lt;password&gt; (delete the &lt; &gt; symbols also) with the Database Username &amp; Password created in Step 3 above. <span style="color: #ff0000;">THIS MUST BE EXACTLY THE SAME AS THE DATABASE USERNAME &amp; PASSWORD YOU CREATED ABOVE!  (This is <strong>not</strong> your Mongo login username &amp; password).</span> Replace &lt;database&gt; with the name of the database that you created in step 2 above.  Remove the &lt; &gt; symbols. <blockquote>Note: In March of 2016, Mongolab changed to Mlab. The syntax above is the new syntax using the mlab format.</blockquote> <strong><span style="color: #ff0000;">This is all illustrated for you on the worksheet you printed from above and shows you exactly what items go where.  </span></strong> <strong><span style="color: #ff0000;">You are only entering it into the worksheet right now, NOT into MongoDB. </span></strong> Make sure you carefully check it several times! <ul> <li>There will be a colon (:) between username and password.</li> <li>There is another colon (:) between .com and the numeric string at the end</li> <li>There is one "at" symbol (@) following the password</li> <li>There is one forward slash (/) before the database name.</li> <li>Remove any marks (like &gt;) in the string. </ul> <span style="color: #ff0000;"><strong>It is crucial that this string is absolutely correct or <span style="text-decoration: underline;">your Nightscout setup will not work. Absolutely will not work when you get to the completion steps</span>. </strong></span> Once you have verified that the string is correct, you can move on to the next steps. <em><strong>Even if you think they are 100% correct, check it again.</strong></em> Make sure you have easy access to your Mongo URI connection string for the following pages. <strong>You are now finished setting up your MLab account.  On to the next step!</strong> <h2>Setting Up a Second MongoDB</h2> If you need to set up a second database (e.g., for a second T1D), return to the <a href="https://mlab.com/home">Mlab home screen</a>, and repeat the steps above, beginning with step 1 of "Create a New MongoDB Database" to create a second database. <h2>Next: <a title="Setting Up Your Nightscout Website on Azure" href="http://www.nightscout.info/wiki/welcome/monitor-cgm-web">Setting up Your Nightscout Website on Azure</a></h2>
Excerpt


OldNewDate CreatedAuthorActions
February 18, 2017 @ 21:21:54 Amy Cowen
February 18, 2017 @ 21:15:06 Amy Cowen
February 18, 2017 @ 21:14:54 [Autosave] Amy Cowen
January 7, 2017 @ 11:50:17 Amy Cowen
January 7, 2017 @ 11:49:39 Amy Cowen
January 7, 2017 @ 11:47:58 Amy Cowen
January 7, 2017 @ 11:46:35 Amy Cowen
January 7, 2017 @ 11:45:28 Amy Cowen
April 20, 2016 @ 21:11:20 Amy Cowen
February 29, 2016 @ 23:00:47 Amy Cowen
February 29, 2016 @ 22:56:36 Amy Cowen
February 29, 2016 @ 22:55:12 Amy Cowen
February 29, 2016 @ 22:48:22 Amy Cowen
February 29, 2016 @ 22:46:56 Amy Cowen
February 29, 2016 @ 22:46:06 Amy Cowen
February 29, 2016 @ 22:44:19 Amy Cowen
February 29, 2016 @ 22:40:37 Amy Cowen
February 29, 2016 @ 22:03:41 Amy Cowen
February 29, 2016 @ 21:53:29 Amy Cowen
February 6, 2016 @ 19:07:27 Amy Cowen
October 10, 2015 @ 12:19:31 Amy Cowen
October 10, 2015 @ 12:18:41 Amy Cowen
September 14, 2015 @ 21:52:15 Melanie Clegg
April 16, 2015 @ 11:49:31 Gail DeVore
April 16, 2015 @ 11:49:17 [Autosave] Gail DeVore
March 25, 2015 @ 16:01:48 Jim Sifferle
March 24, 2015 @ 15:57:51 Gail DeVore
March 3, 2015 @ 14:27:47 David Waghalter
March 3, 2015 @ 14:21:38 [Autosave] David Waghalter
March 3, 2015 @ 14:02:46 Gail DeVore
March 3, 2015 @ 13:46:47 Gail DeVore
March 3, 2015 @ 13:39:18 Gail DeVore
February 23, 2015 @ 17:00:29 Gail DeVore
January 14, 2015 @ 17:07:49 Gail DeVore
January 14, 2015 @ 17:03:55 Gail DeVore
January 13, 2015 @ 18:43:46 Gail DeVore
January 12, 2015 @ 21:23:51 Gail DeVore
December 26, 2014 @ 14:54:14 Gail DeVore
December 26, 2014 @ 10:52:27 Gail DeVore
December 13, 2014 @ 14:38:52 Gail DeVore
December 13, 2014 @ 14:38:22 Gail DeVore
December 13, 2014 @ 14:12:25 Gail DeVore
December 13, 2014 @ 13:41:04 Gail DeVore
December 7, 2014 @ 20:40:42 Gail DeVore
December 7, 2014 @ 19:44:21 Gail DeVore
December 7, 2014 @ 19:43:28 Gail DeVore
October 18, 2014 @ 10:24:15 Gail DeVore
October 7, 2014 @ 18:04:39 Gail DeVore
October 7, 2014 @ 17:57:03 Gail DeVore
October 7, 2014 @ 17:52:32 Gail DeVore
October 7, 2014 @ 17:51:31 Gail DeVore
September 13, 2014 @ 23:57:14 Gail DeVore
September 13, 2014 @ 01:05:24 Patrick Drews
August 22, 2014 @ 13:09:46 Gail DeVore
August 15, 2014 @ 15:43:57 James Wedding
August 8, 2014 @ 07:48:17 Patrick Drews
August 8, 2014 @ 07:47:59 [Autosave] Patrick Drews
August 4, 2014 @ 15:02:06 Gail DeVore
August 4, 2014 @ 14:54:00 Gail DeVore
August 3, 2014 @ 17:51:01 Gail DeVore
August 3, 2014 @ 16:45:34 Gail DeVore
August 3, 2014 @ 16:44:50 Gail DeVore
August 3, 2014 @ 16:21:50 Gail DeVore
August 3, 2014 @ 16:13:04 Gail DeVore
August 2, 2014 @ 13:26:32 James Wedding
August 2, 2014 @ 13:25:49 James Wedding
August 2, 2014 @ 13:22:25 James Wedding
August 2, 2014 @ 13:22:08 James Wedding
August 1, 2014 @ 11:00:14 Gail DeVore
July 31, 2014 @ 16:38:17 Gail DeVore
July 31, 2014 @ 16:37:31 Gail DeVore
July 31, 2014 @ 16:36:39 Gail DeVore
July 31, 2014 @ 16:32:40 Gail DeVore
July 19, 2014 @ 12:54:03 James Wedding
July 19, 2014 @ 12:51:25 James Wedding
July 19, 2014 @ 12:46:58 James Wedding
July 17, 2014 @ 13:25:53 James Wedding

2 thoughts on “Configuring the Data Backend on Mlab

  1. For the Mongo collection string, the directions say to highlight and copy the URI code. Am I copying the :…… Generic code or do I modify to personal DB user and password and highlight and copy? If I am personalizing before highlight and copy, how do I do it?
    Thanks,
    Greg
    greglynch@cox.net

Comments are closed.