Search This Blog


How to use MongoDB on QNAP NAS ?

How to use MongoDB on QNAP NAS ?

MongoDB is a cross-platform document-oriented database program.  Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemata. MongoDB is developed by MongoDB Inc..

in QTS, already have the MongoDB qpkg in the app center,

in this article will introduce how to setup MongoDB by using Container Station

Step_1: Open Container Station and Set Up MongoDB

  • Click "Container Station".
  • Click "Create Container".
  • Go to MongoDB and click "Install" (Click "MongoDB" for more information).
  • Click "Create"
  • This will install an empty container. You will need to install, remove, and then install a new MongoDB.
  • Choose the container and remove it.

  • Choose "Create Container", and click "Install" to rebuild the MongoDB.
  • In Command, enter "mongod --auth".
  • Click "Advanced Settings".
  • Go to "Network", enter a value for the MongoDB "port" number (for example: 37011).
  • Go to "Shared Folder", and click "Add".
  • In "Volume from host" choose the folder you established earlier (for example: Container > Mongo DB > db).
  • In "Mount Point" enter "/data/db".
  • In "Volume from host" choose the folder you established earlier (for example: Container > Mongo DB > configdb).
  • In "Mount Point" enter "/data/configdb".
    The purpose of adding these commands are for easy backup and modification
  • Click "Create"

Step_2: Set up MongoDB account and permissions

  • You may refer MongoDB DockerHub instructions for more information on setting access controls.
  • Establish an account: In your MongoDB container, click "Terminal", enter "mongo admin", and click "OK".
  • Enter the command " db.createUser({ user: 'input account', pwd: 'input password', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] }); ".
  • Return to the MongoDB container, click "Terminal" and enter the command "mongo -u input account -p input password --authenticationDatabase admin".
  • Click "OK".
  • Enter the command "use database name" (for example: "use qiotdatabase"). 
  • Enter the command "db.createUser({ user: "input account of DB ", pwd: "input password of DB", roles: [ { role: "dbOwner", db: "input the DB name you established previously"}]});"

    (When you "establish another new account and password", it cannot be the same as the previously created user account (for example: "qiotduser")).
other reference link:
QNAP Systems, Inc., headquartered in Taipei, Taiwan, provides a comprehensive range of cutting-edge Network-attached Storage (NAS) and video surveillance solutions based on the principles of usability, high security, and flexible scalability. QNAP offers quality NAS products for home and business users, providing solutions for storage, backup/snapshot, virtualization, teamwork, multimedia, and more. QNAP envisions NAS as being more than "simple storage", and has created many NAS-based innovations to encourage users to host and develop Internet of Things, artificial intelligence, and machine learning solutions on their QNAP NAS.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...