mongodb install in centos 729 Feb 2020 database mongodb database linux Show
mongodb 설치
추가가 잘되었는지 확인!
yum 설치
명령어 익히기몽고디비 시작하기
몽고디비 정지
몽고디비 리로드
몽고디비 상태체크
서버가 리부팅 되었어도 자동으로 mongodb를 자동 실행시킬 수 있게 하는 명령어
몽고디비 로그 확인
설정 변경
port 변경
외부접속 오픈
cli 로 몽고접속하기
관리자 계정생성
config 파일을 열자
사용자 계정 생성사용할 DB
유저 생성
쉘로 접속하고 싶을 경우또는
추가로 설치한 mongo DB 를 지우고 싶을 경우몽고디비 정비
Packages 제거.
Data 관련 내용 삭제
참고링크
Related Posts
IntroductionMongoDB is a document-oriented database that is free and open-source. It is classified as a NoSQL database because it does not rely on a traditional table-based relational database structure. Instead, it uses JSON-like documents with dynamic schemas. Unlike relational databases, MongoDB does not require a predefined schema before you add data to a database. You can alter the schema at any time and as often as is necessary without having to set up a new database with an updated schema. In this tutorial, you will install MongoDB Community Edition on a CentOS 7 server. PrerequisitesBefore following this tutorial, make sure you have
Step 1 – Adding the MongoDB RepositoryThe With the
Then, visit the Install on Red Hat section of MongoDB’s documentation and add the repository information for the latest stable release to the file: /etc/yum.repos.d/mongodb-org.repo
Save the changes to the file by pressing the Before continuing, you should verify that the MongoDB repository
exists within the
With the Step 2 – Installing MongoDBYou can install the
There are two Next, start the MongoDB service with the
Although we will not use them in this tutorial, you can also change the state of the MongoDB service with the The
The
The
An output of waiting for a connection confirms that MongoDB has started successfully and you can access the database server with the MongoDB Shell:
Note: When you launched the MongoDB Shell, you may have seen a warning like this:
MongoDB is a threaded application. It can launch additional processes to handle its workload. The warning states that for MongoDB to be most effective the number of processes that it is authorized to spin up should be half that of the number of files that it can have open at any given time. To resolve the
warning, alter the
Add the following line to the end of file: /etc/security/limits.d/20-nproc.conf
Make sure to save the changes pressing the For the new limit to be available to MongoDB, restart it using the
Afterward, when you connect to the MongoDB Shell, the warning should cease to exist. To
learn how to interact with MongoDB from the shell, you can review the output of the
Leave the
Step 3 – Verifying StartupBecause a database-driven application cannot function without a database, we’ll make sure that the MongoDB daemon, Use the
An output of zero confirms an enabled daemon, which we want. A one, however, confirms a disabled daemon that will not start.
In the event of a disabled daemon, use the
You now have a running instance of MongoDB that will automatically start following a system reboot. Step 4 – Importing an Example Dataset (Optional)Unlike other database servers, MongoDB does not come with data in its Start by moving into a writable directory:
Use the
The
The output confirms the importing of the data from the
With the sample dataset in place, you can perform a query against it. Relaunch the MongoDB Shell:
The shell selects the Query the restaurants collection with the
You can continue using the sample dataset to familiarize yourself with MongoDB or delete it with the
Lastly, quit the shell with the
ConclusionIn this tutorial, you added a third-party repository to |