몽고디비실행하기 (1)

아래 링크로 들어가서 오른쪽 하단의 Download 버튼을 클릭하여 tgz 파일을 다운로드 받아 압축을 풀면 설치가 완료된다.

 

몽고DB 커뮤니티 서버 최신버전 다운로드

 

 

몽고디비 최신버전은 자바버전 8 이상이면 사용가능하다.

추가적인 호환성 여부는 몽고DB 공식사이트에서 확인가능하다.

현재 사용하고 있는 자바 버전이 8이 아니라면 업그레이드가 필요하다.

몽고DB 드라이버 호환성 여부
몽고DB 자바버전 호환성 여부


몽고DB서버 실행하기 공식문서를 보고 따라하면되는데 그대로 따라하면 중간에 오류가 발생한다.

아래 명령어를 보고 실행하되 경로는 본인의 입맛에 맞게 변경해주면 된다.

keichee:BlogApp KH$ sudo mkdir -p /usr/local/mongodb/data-v4.4
Password:
keichee:BlogApp KH$ sudo mkdir -p /usr/local/mongodb/log
keichee:BlogApp KH$ sudo chown KH /usr/local/mongodb/*
keichee:BlogApp KH$ touch /usr/local/mongodb/log/mongo.log

-- 몽고db bin 디렉토리로 이동 --
keichee:bin KH$ ./mongod --dbpath /usr/local/mongodb/data-v4.4 --logpath /usr/local/mongodb/log/mongo.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 38133
child process started successfully, parent exiting
keichee:bin KH$ 

 

이제 서버는 정상적으로 기동이 되었고, 실제로 접속해서 명령어를 입력하려면 mongo 명령어를 실행하면 됩니다.

keichee:bin KH$ ./mongo
MongoDB shell version v4.4.2
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("b8192555-a975-457e-ab16-2b2c7675c72a") }
MongoDB server version: 4.4.2
---
The server generated these startup warnings when booting: 
        2020-11-22T08:12:57.220+09:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2020-11-22T08:12:57.221+09:00: This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning
        2020-11-22T08:12:57.221+09:00: Soft rlimits too low
        2020-11-22T08:12:57.221+09:00:         currentValue: 10240
        2020-11-22T08:12:57.221+09:00:         recommendedMinimum: 64000
---
---
        Enable MongoDB's free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc).

        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()
---
>