Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
mongo_upgrade_logical [2019/10/25 14:19] – [Import the backup into the new release] andonovj | mongo_upgrade_logical [2019/10/25 23:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 80: | Line 80: | ||
</ | </ | ||
+ | =====Instance Modifcations===== | ||
+ | There are couple changes to be done in order to secure our databases: | ||
+ | |||
+ | ====Change the IP==== | ||
+ | In order to change the IP, modify the / | ||
+ | |||
+ | <sxh bash> | ||
+ | # network interfaces | ||
+ | net: | ||
+ | port: 27017 | ||
+ | bindIp: 172.27.1.245 | ||
+ | </ | ||
+ | |||
+ | Restart the instance with: | ||
+ | |||
+ | <sxh bash> | ||
+ | [root@hostname hunter_dev]# | ||
+ | Redirecting to / | ||
+ | </ | ||
+ | |||
+ | ====Add users==== | ||
+ | Users have to be added so we can enable security authentication: | ||
+ | |||
+ | <sxh bash> | ||
+ | [root@tbp-cx-mdb01 hunter_dev]# | ||
+ | MongoDB shell version v4.0.13 | ||
+ | connecting to: mongodb:// | ||
+ | Implicit session: session { " | ||
+ | MongoDB server version: 4.0.13 | ||
+ | Server has startup warnings: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | 2019-10-25T15: | ||
+ | --- | ||
+ | Enable MongoDB' | ||
+ | metrics about your deployment (disk utilization, | ||
+ | |||
+ | The monitoring data will be available on a MongoDB website with a unique URL accessible to you | ||
+ | and anyone you share the URL with. MongoDB may use this information to make product | ||
+ | improvements and to suggest MongoDB products and deployment options to you. | ||
+ | |||
+ | To enable free monitoring, run the following command: db.enableFreeMonitoring() | ||
+ | To permanently disable this reminder, run the following command: db.disableFreeMonitoring() | ||
+ | --- | ||
+ | |||
+ | > use admin | ||
+ | switched to db admin | ||
+ | > db.createUser( | ||
+ | ... { | ||
+ | ... " | ||
+ | ... pwd: " | ||
+ | ... " | ||
+ | ... { | ||
+ | ... " | ||
+ | ... " | ||
+ | ... }, | ||
+ | ... { | ||
+ | ... " | ||
+ | ... " | ||
+ | ... }, | ||
+ | ... { | ||
+ | ... " | ||
+ | ... " | ||
+ | ... }, | ||
+ | ... { | ||
+ | ... " | ||
+ | ... " | ||
+ | ... } | ||
+ | ... ] | ||
+ | ... } | ||
+ | ... ) | ||
+ | </ | ||
+ | |||
+ | ====Enable security==== | ||
+ | Secure authentication has to be enabled again in the / | ||
+ | |||
+ | <sxh bash> | ||
+ | security: | ||
+ | authorization: | ||
+ | </ | ||
+ | |||
+ | Again restart the service: | ||
+ | |||
+ | |||
+ | <sxh bash> | ||
+ | [root@hostname hunter_dev]# | ||
+ | Redirecting to / | ||
+ | [root@hostname hunter_dev]# | ||
+ | </ | ||
=====Import the backup into the new release===== | =====Import the backup into the new release===== | ||
After that, we can simply import the exported data into the new release as follows: | After that, we can simply import the exported data into the new release as follows: | ||
<sxh bash> | <sxh bash> | ||
- | [root@localhost]# mongorestore --host 172.27.1.245 -u adminDBA -p ' | + | [root@hostname hunter_dev]# mongorestore --host 172.27.1.245 -u adminDBA -p ' |
- | + | 2019-10-25T16: | |
- | connected | + | 2019-10-25T16:15:55.855+0200 |
- | 2018-03-20T17:43:50.660+0100 / | + | 2019-10-25T16:15:55.879+0200 reading metadata for monitor.config from / |
- | 2018-03-20T17:43:50.660+0100 going into namespace [admin.artists] | + | ------------------------------------------------------------------------------ |
- | 2018-03-20T17:43:50.682+0100 | + | 2019-10-25T16:15:58.564+0200 finished restoring hunter_dev.billFish (0 documents) |
- | Creating index: { key: { _id: 1 }, name: " | + | 2019-10-25T16:15:58.564+0200 restoring users from / |
- | [root@lpara sales] | + | 2019-10-25T16:15:58.638+0200 |
</ | </ |