반응형
1. repo파일 추가
sudo vi /etc/yum.repos.d/mongodb-org-4.4.repo
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
2. 설치
sudo yum install -y mongodb-org
3. 초기설정
기본 디렉토리 생성
mkdir -p /var/lib/mongo
mkdir -p /var/log/mongodb
sudo chown -R mongod:mongod /var/lib/mongo
sudo chown -R mongod:mongod /var/log/mongodb
vi /etc/mongod.conf
bindIp 변경
THP 옵션 비활성화 (in RHEL7)
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
systemctl enable mongod
systemctl start mongod
방화벽
sudo firewall-cmd --zone=public --add-port=27017/tcp
ref: docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/
반응형
'dev > linux' 카테고리의 다른 글
centos7 install golang 1.16.3 (0) | 2021.04.14 |
---|---|
CentOS7 Minimal - setup 커맨드 활성화 (0) | 2021.02.03 |
CentOS7 Install postgreSQL 11 & pgadmin 4 (0) | 2020.11.03 |
linux ssh 비밀번호 대신 key file로 접속하기 (0) | 2020.05.31 |
[CentOS 7] Install PHP7 (설치하기) (0) | 2019.09.20 |