일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- AD Migration
- ELK 설치
- 도커
- ADFS 구성 방법 및 이중화
- mongodb 설치
- vSphere
- Exchange Server
- Active Directory
- ADFS SSO
- awx
- Docker
- ADFS proxy
- AWS S3
- vCenter Syslog collector
- ADFS 이중화
- Azure
- AWS
- MSSQL 2012
- AWS EBS
- Active Directory Migration
- 하이퍼바이저
- vmware vsphere
- ADFS Traffic Manager
- Kubernetes
- Exchange 2003
- vCenter
- ansible
- ELK
- AWS EFS
- Application Gateway
- Today
- Total
practice makes perfect
MongoDB 설치 및 계정 생성 본문
MongoDB 설치 및 계정 생성
-
CentOS 7 기준으로 설치 진행
- 계정생성 및 모니터링 용 계정 권한 설정
[설치]
- Repository 등록
# /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-3.4] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ gpgcheck=1 enabled=1 |
- Repo 확인
# yum repolist
- Mongo 설치
# yum install mongodb-org
- Mongo 서비스 시작
# systemctl start mongod (시작)
※ [참고]
# systemctl stop mongod (중지)
# systemctl reload mongod (설정파일 다시 읽기 및 반영)
# tail /var/log/mongodb/mongod.log (로그확인)
- 설치 후 접속
# mongo localhost:27017
MongoDB shell version v3.4.24
connecting to: mongodb://localhost:27017/test
MongoDB server version: 3.4.24
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten]
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten]
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten]
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten]
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2020-02-18T00:34:40.300+0000 I CONTROL [initandlisten]
> db
test
> show dbs
admin 0.000GB
local 0.000GB
>
- 계정만들기 (admin)
> use admin
switched to db admin
> db.createUser(
... {
... user: "mhadmin",
... pwd: "abc123",
... roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
... }
... )
Successfully added user: {
"user" : "mhadmin",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}
- 새로만든계정으로 접속
# mongo --port 27017 -u "mhadmin" -p "abc123" --authenticationDatabase "admin"
- 모니터링 용 계정 생성 및 Role 추가
use admin
db.createUser(
{
user: "monitoruser",
pwd: "monitoruser",
roles: [ { role: "clusterMonitor", db: "admin" } ]
}
)
'Linux' 카테고리의 다른 글
Oracle Linux 호스트 네임 (0) | 2024.05.06 |
---|---|
ELK Configure (with Docker) (0) | 2020.12.13 |
Apache Method 예외처리 (0) | 2020.01.01 |
Centos Repository 변경 (0) | 2019.03.01 |
Linux cmdlet 정리 (0) | 2017.11.30 |