Gitlab CI의 Test 프로세스에서 Docker에 몽고디비 설치

2019. 4. 5. 22:28서버 프로그래밍

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

 

Install MongoDB Community Edition on Debian — MongoDB Manual

 

docs.mongodb.com

데비안 Docker 이미지에서 몽고디비를 설치한 다음 Cypress와 Python으로 통합 테스트를 하고자 몽고디비 오피셜 페이지의 Debian 항목을 참고하였다.

1번 문제 : apt-get update를 하면 항상 같은 부분에서 에러 발생

https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository/508857

 

Failed to fetch jessie backports repository

I'm using a docker image as a base for my own development that adds the jessie backports repository in its Dockerfile and uses that to install a dependency. This image uses the following command to...

unix.stackexchange.com

RUN echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list

RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list

RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list

RUN apt-get -o Acquire::Check-Valid-Until=false update

* 네임 서버 문제인줄 알고 네임서버도 변경했지만 소용없었음

https://kldp.org/node/99764

 

[완료] apt-get update 명령이 오류가 발생합니다. | KLDP

Ubuntu 8.04 버전 설치후 갑자기 언제부턴가 apt-get update 명령이 오류가 나기 시작했습니다. 오류 내용은 아래와 같습니다. root@donsvr1:/etc/apt# apt-get -f update Get:1 http://security.ubuntu.com hardy-security Release.gpg Get:2 http://security.ubuntu.com hardy-security Release Ign http://security

kldp.org

 

2번 문제 : 설치 완료후 MongoDB 실행이 안됨

일단 sudo service mongod start가 안먹는다.

systemctl을 사용하는 것도 안된다.

  • sudo systemctl enable mongod.service
  • sudo systemctl start mongod

 

그냥 mongod를 실행시키면 해결된다.

After researching, I solved this problem by doing:

Create folders:
~# mkdir /data/db 
~# mkdir /data/db/log

Run command
~# mongod --dbpath data/db --fork --logpath data/db/log

And then run the server
~# mongod

https://github.com/Microsoft/WSL/issues/1822

 

MongoDB service failed to start (unrecognized service ) · Issue #1822 · Microsoft/WSL

breif intro: MongoDB cannot be started as a service (with an error: mongod: unrecognized service ) but can be started manually with sudo mongod Expected results: Mongodb starts as a service. Actual...

github.com

* 도움안됨

https://tecadmin.net/install-mongodb-server-on-debian/

 

How to Install MongoDB Server 3.4 on Debian 9/8/7 - TecAdmin

MongoDB Installation Tutorial. How do I Install Latest MongoDB server on Debian 9/8/7 systems? Install MongoDB server on Debian systems.

tecadmin.net

https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-debian-8

 

How to Install MongoDB on Debian 8 | DigitalOcean

MongoDB is a free and open-source NoSQL document database used commonly in modern web applications. This tutorial will help you set up MongoDB on your server for use in a production application environment. You'll install MongoDB and configure firewal

www.digitalocean.com

<참고>

데비안 버전 확인

https://m.blog.naver.com/PostView.nhn?blogId=jodi999&logNo=220665683536&proxyReferer=https%3A%2F%2Fwww.google.com%2F

 

데비안 버전 확인하기

지금, 데비안 jessie를 사용하고 있습니다만, 데비안 8.3 업데이트 소식을 보고, 내 데비안 버전이 어떻게 ...

blog.naver.com

사용포트 확인

https://www.lesstif.com/pages/viewpage.action?pageId=43844201

 

사용중인 포트 확인

현재 시스템에서 사용하고 있는 network port 를 확인하는 것은 서비스 운영시 꼭 알아두어야 할 명령어입니다.

www.lesstif.com

MongoDB 데몬 실행

https://blog.outsider.ne.kr/582

 

mongoDB를 Demon으로 실행하고 정상적으로 종료하기 :: Outsider's Dev Story

개발용 장비에서 일시적으로 mongoDB를 사용할때는 터미널에서 실행시켰다가 Ctrl + C를 이용해서 종료하는 등으로 사용하지만 서비스에서는 mongoDB가 Demon으로 실행되어야 합니다. &를 이용해서 백그라운...

blog.outsider.ne.kr