Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

8.- Después, modificamos el archivo /etc/mongod.conf comentando la línea dbPath: /var/lib/mongo y poniendo en su lugar la línea dbPath: /data/mongodb, esto es para que toda la información de la base de datos de mongo se vaya hacia la carpeta que creamos anteriormente:


Code Block
# Where and how to store data.

...



storage:

...



  #dbPath: /var/lib/mongo

...



  dbPath: /data/mongodb

...



  journal:

...



    enabled: true

...



 engine:

...



 mmapv1:

...



 wiredTiger:

...



9.- Si accedemos a la carpeta /data/mongodb, podemos observar que no tenemos información alguna, para que se comiencen a crear las colecciones, simplemente reiniciamos mongod y ejecutamos el pl. Después de esto, tendremos que ver archivos .wt ya creados de forma automática:


Code Block
[root@omk-vm9-cva data]# cd mongodb/

...



[root@omk-vm9-cva mongodb]# ll

...



total 0

...



[root@omk-vm9-cva mongodb]# service mongod restart

...



Redirecting to /bin/systemctl restart mongod.service

...



[root@omk-vm9-cva mongodb]# /usr/local/omk/bin/setup_mongodb.pl

...



setup_mongodb.pl version 4.150.0

...





Reading configuration file /usr/local/omk/bin/../conf//opCommon.json...

...



Checking authentication status for db_server localhost...

...



MongoDB on localhost:27017 is running in non-authenticated mode.

...



INFO: server version is 3.4.24, using new auth model.

...



INFO: adding user opUserRW to admin db

...



INFO: adding user opUserRW to database flows

...



INFO: adding user opUserRW to database opconfig

...



INFO: adding user opUserRW to database omk_shared

...



INFO: adding user opUserRW to database opcharts

...



INFO: adding user opUserRW to database opaddress

...



INFO: adding user opUserRW to database flowsp

...



INFO: adding user opUserRW to database opha

...



INFO: adding user opUserRW to database optrend

...



INFO: adding user opUserRW to database

...

 opevents





WARNING: Authentication should be enabled for production use!

...



Currently your MongoDB server at localhost:27017 operates without

...



authentication. This is MongoDB's default, but is not recommended for

...



production use. You should add the setting auth=true (for 2.4-style config)

...



or authorization: enabled (for YAML config format)

...



to your /etc/mongodb.conf or change your init script to include --auth.

...




Hit enter to continue:

...




[root@omk-vm9-cva mongodb]# ll

...



total 64

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 collection-0-4757025178356315371.wt

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 collection-2-4757025178356315371.wt

...



drwxr-xr-x 2 mongod mongod 4096 Dec  8 14:48 diagnostic.data

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 index-1-4757025178356315371.wt

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 index-3-4757025178356315371.wt

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 index-4-4757025178356315371.wt

...



drwxr-xr-x 2 mongod mongod 4096 Dec  8 14:48 journal

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 _mdb_catalog.wt

...



-rw-r--r-- 1 mongod mongod    5 Dec  8 14:48 mongod.lock

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 sizeStorer.wt

...



-rw-r--r-- 1 mongod mongod   95 Dec  8 14:48 storage.bson

...



-rw-r--r-- 1 mongod mongod   49 Dec  8 14:48 WiredTiger

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 WiredTigerLAS.wt

...



-rw-r--r-- 1 mongod mongod   21 Dec  8 14:48 WiredTiger.lock

...



-rw-r--r-- 1 mongod mongod  842 Dec  8 14:48 WiredTiger.turtle

...



-rw-r--r-- 1 mongod mongod 4096 Dec  8 14:48 WiredTiger.wt


10.- Por último, ejecutamos el mongorestore para restablecer toda nuestra base de datos de NMIS 8 en NMIS 9:


Code Block
[root@omk-vm9-cva mongodb]# mongorestore -u opUserRW -p op42flow42 /data/mongodump


11.- Cuando concluya el mongorestore, reiniciamos los servicios y verificamos que NMIS continúe funcionando de manera normal:


[root@omk-vm9-cva mongodb]# service omkd stop

...