Install AEN connected to a remote Mongo DB instance

To install AEN with a remote database:

  1. Connect to the Mongodb instance and create the user for AEN:

    > user = { user: "<username>",
      pwd: "<super-secure-password>",
      roles: [
        { role: "dbOwner", db: "<db_name>" },
        { role: "dbOwner", db: "<db_name>_mq" }
      ]
    }
    > db.createUser(user)
    Successfully added user: { ... }
    
  2. Before installing AEN-server export the database URL and name:

    $ export MONGO_URL="mongodb://<username>:<password>@<host>:<port>/"
    $ export MONGO_DB="<database_name>"
    
  3. Continue the installation process: Install the AEN server.

Migrate from local to remote MongoDB

To configure your remote database to work with an already installed AEN server:

  1. Stop the server, gateway and compute nodes:

    sudo service wakari-server stop
    sudo service wakari-gateway stop
    sudo service wakari-compute stop
    
  2. Open the /opt/wakari/wakari-server/etc/wakari/config.json file and create the MONGO_URL key. For the value parameter, add the database information.

    The final file should read:

    {
      "MONGO_URL": "mongodb://MONGO-USER:MONGO-PASSWORD@MONGO-URL:MONGO-PORT",
      "MONGO_DB": "MONGO-DB-NAME",
      "WAKARI_SERVER": "http://YOUR-IP",
      "USE_SES": false,
      "CDN": "http://YOUR-IP/static/",
      "ANON_USER": "anonymous"
    }
    

    For more information about configuration keys, see Using configuration files.

  3. Migrate the data from the former database into the new one. For more information, see the MongoDB documentation website.

  4. After migration, restart the nodes:

    sudo service wakari-server start
    sudo service wakari-gateway start
    sudo service wakari-compute start