몽고DB(MongoDB) 설치


    몽고DB(MongoDB)란 하둡(Hadoop)의 전성기를 열어주며 빅데이터 시대를 알려주기도 했으며, 현재는 Node.js 등과 함께 가볍게 사용하는 프로젝트에서 많이 사용하고 있는 대표적인 NoSQL DB이다. 설명에 대한 부분은 다른 포스팅에서 하기로 하고, 이번 포스팅은 설치에 관련된 것만 적어보기로 한다.


    https://www.mongodb.com/download-center


    몽고DB의 다운로드 페이지에 들어가면 위와 같은 화면으로 Cloud, Server, Tools라는 메뉴가 나오는데 Server를 선택한다.



    Server를 선택 한 후, MongoDB Community Server를 클릭 후, 원하는 Version과 본인에 맞는 OS그리고 Package를 선택한다. 필자는 이런류의 설치는 기본적으로 Windows Installer를 선호하기 때문에 Zip이 아닌 MSI를 선택하여 다운로드 하였다.


    다운로드한 msi 파일을 실행한 후, agree, next를 누르다 보면 아래와 같은 화면이 나올 것이다.



    여기서 Complete를 선택하면, Default 설정 위치및 설정으로 설치하게 되며, Custom을 선택하게 되면 원하는 위치부터 설정을 건드릴 수 있다. 필자는 Custom을 선택하였다.



    원하는 위치에 몽고DB를 설정 후 Next를 선택한다.



    윈도우 서비스를 등록하는 부분인데 원하지 않는 분들은 체크 해제를 하고 Next를 선택하여 넘어간다. (필자는 체크 해제)



    MongoDB Compass는 MongoDB를 관리하기 위한 GUI(Graphical User Interface) 프로그램이다. 다른 관리 툴을 사용할 예정이며 해당 부분을 체크하고 설치 시 상당 시간 소요가 되는 경우가 있어서 체크 해제 한 후 진행하였다.


    설치가 모두 완료된 후 설치폴더/bin 폴더로 이동하면



    이와 같은 설치된 파일들이 보이며, mongod라는 데몬(daemon) 프로그램을 실행한다.


    2019-09-18T09:17:35.637+0900 I  CONTROL  [main] Automatically disabling TLS 1.0,  to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'

    2019-09-18T09:17:36.208+0900 I  CONTROL  [initandlisten] MongoDB starting : pid=15212 port=27017 dbpath=C:\data\db\ 64-bit host=user-PC

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] db version v4.2.0 2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] git version: a4b751dcf5

    1dd249c5865812b390cfd1c0129c30

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] allocator: tcmalloc 2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] modules: none

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] build environment:

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten]     distmod: 2012plus

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten]     distarch: x86_64

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten]     target_arch: x86_64

    2019-09-18T09:17:36.209+0900 I  CONTROL  [initandlisten] options: {}

    2019-09-18T09:17:36.304+0900 I  STORAGE  [initandlisten] exception in initAndLis ten: NonExistentPath: Data directory E:\data\db\ not found., terminating

    2019-09-18T09:17:36.305+0900 I  NETWORK  [initandlisten] shutdown: going to clos e listening sockets...

    2019-09-18T09:17:36.305+0900 I  -        [initandlisten] Stopping further Flow C ontrol ticket acquisitions.

    2019-09-18T09:17:36.305+0900 I  CONTROL  [initandlisten] now exiting

    2019-09-18T09:17:36.305+0900 I  CONTROL  [initandlisten] shutting down with code :100


    그러면 위에 있는 붉은색 부분 때문에 프로세스가 실행이 안되고 종료가 되는데 "data/db"라는 폴더가 존재하지 않기 때문이다. 필자 기준으로 E:/ 드라이브에 data 폴더와 db 폴더를 생성 후 다시 mongodb를 실행시킨다.


    2019-09-18T09:25:03.775+0900 I  CONTROL  [initandlisten] ** WARNING: Access cont rol is not enabled for the database.

    2019-09-18T09:25:03.775+0900 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.

    2019-09-18T09:25:03.777+0900 I  CONTROL  [initandlisten]

    2019-09-18T09:25:03.779+0900 I  CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.

    2019-09-18T09:25:03.780+0900 I  CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server.

    2019-09-18T09:25:03.782+0900 I  CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP

    2019-09-18T09:25:03.783+0900 I  CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to

    2019-09-18T09:25:03.785+0900 I  CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the

    2019-09-18T09:25:03.786+0900 I  CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.

    2019-09-18T09:25:03.788+0900 I  CONTROL  [initandlisten]

    2019-09-18T09:25:03.801+0900 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>

    2019-09-18T09:25:03.802+0900 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.

    2019-09-18T09:25:03.803+0900 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>

    2019-09-18T09:25:03.804+0900 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>

    2019-09-18T09:25:03.808+0900 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>

    2019-09-18T09:25:05.474+0900 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'

    2019-09-18T09:25:05.476+0900 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>

    2019-09-18T09:25:05.477+0900 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>

    2019-09-18T09:25:05.477+0900 I  NETWORK  [initandlisten] Listening on 127.0.0.1

    2019-09-18T09:25:05.482+0900 I  NETWORK  [initandlisten] waiting for connections on port 27017


    폴더 실행 후 데몬을 다시 실행 시키면 위와 같이 IP는 localhost Port는 27017로 정상적으로 가동이 된 것을 확인 할 수 있다.



    댓글

    Designed by JB FACTORY