Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

connect alteryx server to mongodb replica set

harend
8 - Asteroid

Our local mongodb is running in a replica set with two slave nodes and a master node. This is to allow a master to fail and the slave to take over. Does anyone have any experience with connecting the server to a replica set and having the alteryx server recognize the new master? I'm currently working to migrate off of the embedded mongodb and into a hosted version running 3.2 so that we can monitor jobs with Tableau so I haven't had as much time as I would like to play around with the config.

3 REPLIES 3
SteveA
Alteryx
Alteryx

Hi @harend,

 

The Mongo connection string must be in the older Mongo connection format which is the replica set name preceding a comma-separated list of servers:

<replica_set_name>/<server_1>:<port_1>,<server_2>:<port_2>,<server_3>:<port_3>

 

So, for example, a valid connection string looks like this:

rs0/192.168.0.17:27017,192.168.0.18:27017,192.168.0.19:27017

 

You can specify a replica set connection in the System Settings dialog by navigating to the "Controller | Persistence" tab and choosing "User-managed MongoDB" as shown here:

sl.png

 

If your Gallery is using the same Mongo server for its DBs, then you can leave the settings on the "Gallery | Persistence" page as shown here:

gallery.png

 

But, if you need to set the Gallery connection strings explicitly, note that they must use the newer connection string format as specified by Mongo (see  https://docs.mongodb.com/manual/reference/connection-string/)

 

Let us know if you need a hand.


Best,

Steve A.

harend
8 - Asteroid

Hi Steve,

 

 I've updated the hostname setting and then was able to find the connection string in the AlteryxServiceLog file. At the very end I noticed that the database name was still set to AlteryxGallery even though in the server settings I had specified AlteryxDB. Is it required that the database names are AlteryxService, AlteryxGallery, and AlteryxGallery_Lucene? I wasn't able to find any sort of guide to setting up the Alteryx Server with a user-managed mongodb instance

 

Thanks!

SteveA
Alteryx
Alteryx

Hi @harend,

 

It's not "required" that you use the default database names, but I would certainly encourage you to do so as it keeps things simpler, especially when moving from the Embedded MongoDB to a User-Managed instance.  As you noticed, setting the main database name (AlteryxService) in the GUI does not change the two DBs used for the Gallery (AlteryxGallery and AlteryxGallery_Lucene), but the latter two can also be changed if you need them to be.

 

 

Thank you for the feedback on the documentation.

 

In a nutshell, migrating the Embedded MongoDB to a User-Managed instance requires just a few steps:

  1. Open a command shell as an Administrator
  2. In the shell, execute "sc stop AlteryxService" to stop the Server
  3. Navigate to the Alteryx installation directory (Program Files\Alteryx\bin by default)
  4. In the shell, execute "AlteryxService.exe getemongopassword" to retrieve the MongoDB credentials
  5. Copy off both passwords, note that the username for both the admin and non-admin user is "user"
  6. Copy the MongoDB folder (ProgramData\Alteryx\Service\Persistence by default) to the new MongoDB primary machine
  7. Convert the new instance to a Replica Set (https://docs.mongodb.com/manual/tutorial/convert-standalone-to-replica-set/)


Best,
Steve