Arquisoft / Loader_i3a

Loader module
The Unlicense
5 stars 3 forks source link

Externalize the mongodb to mlab.com #1

Closed thewillyhuman closed 6 years ago

thewillyhuman commented 6 years ago

To change from a localhost database to a remote database edit the database.properties file as following.

Changes required

Host

In the following line change localhostto ds237445.mlab.com. https://github.com/Arquisoft/Loader_i3a/blob/7d0555cc349632d4c69f06c783b46826f08b2852/src/main/resources/database.properties#L1

Port

Change the port value to 37445. https://github.com/Arquisoft/Loader_i3a/blob/7d0555cc349632d4c69f06c783b46826f08b2852/src/main/resources/database.properties#L2

Database name

To work with out server you should change the Citizens to awsdb. https://github.com/Arquisoft/Loader_i3a/blob/7d0555cc349632d4c69f06c783b46826f08b2852/src/main/resources/database.properties#L3

Collection name

This parameter does not need to change. https://github.com/Arquisoft/Loader_i3a/blob/7d0555cc349632d4c69f06c783b46826f08b2852/src/main/resources/database.properties#L4

User & Password

As far as now we're using a remote test server you will need a user and a password to connect to the database. Those will be the next ones.

Other considerations

The database has a maximum capacity of 500Mb so please don't consume all when testing try to create/remove trash as much as possible.

If you are using a string for the connection this is the correct format to work with the mlab database.

mongodb://dbuser:dbpassword@ds237445.mlab.com:37445/aswdb

thewillyhuman commented 6 years ago

Another option is that you create your own dabase at mlab.com to make dummy tests.

thewillyhuman commented 6 years ago

I don't know which library are you using for mongoDB but maybe this works for you. The connection string is already set to our server.

MongoClient mongo = new MongoClient(
    new MongoClientURI( "mongodb://loader:1234@ds237445.mlab.com:37445/aswdb" )
);
ghost commented 6 years ago

Already changed the properties file