[NoSQL] MongoDB CentOS 설치, 실행, Studio 3T, MongoDB Compass Community
MongoDB CentOS 설치, 실행, Studio 3T 원격 접속
# 아래와 같이 키 관련 오류가 발생 되면 잠시 /etc/yum.repos.d/mongodb-org-3.6.repo에서 'gpgcheck=1 '→'gpgcheck=0 '
# sudo yum install -y mongodb-org // yum을 통한 mongoDB 설치
// 확인 명령어들
# service mongod status // 서비스 상태 확인
- 참고 링크
- GUI Tool
- MongoDB Compass Commuity(자체 무료 툴)
- Studio 3T 다운, Win64, OSX(외부 유료 툴)
- MongoDB 주요 Document 링크
MongoDB install
$ vi /etc/yum.repos.d/mongodb-org-3.6.repo // yum 저장소 신규 설정
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
# 아래와 같이 키 관련 오류가 발생 되면 잠시 /etc/yum.repos.d/mongodb-org-3.6.repo에서 'gpgcheck=1 '→'gpgcheck=0 '
GPG key retrieval failed: [Errno 14] curl#35 - "Cannot communicate securely with peer: no commogorithm(s)."
# sudo yum install -y mongodb-org // yum을 통한 mongoDB 설치
# vi /etc/yum.conf // yum 자동 업데이트시 mongoDB 제외
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools
// 확인 명령어들
# service mongod start // 서비스 시작, … stop 서비스 종료
# mongo --version // 버전 확인
// 실행시 아래와 같은 보안 경고가 생길 경우
# vi /etc/mongod.conf // 설정 파일 수정(보안을 위해 포트도 변경)
// 백업, 복원(ver 3.2 이상)
Server has startup warnings: 2018-08-28T18:23:50.985+0900 I STORAGE [initandlisten] 2018-08-28T18:23:50.985+0900 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2018-08-28T18:23:50.985+0900 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2018-08-28T18:23:51.590+0900 I CONTROL [initandlisten]
#network interfaces net: port: 2701 bindIp: 0.0.0.0 #bindIp: 127.0.0.1,117.52.89.108,10.11.168.19 security: authorization: enabled
// 백업, 복원(ver 3.2 이상)
# mongodump --archive --db test --port 2701
# mongorestore --archive --port 2702
// 관리자 계정을 먼저 생성하고 사용자계정 생성 데이터베이스 생성 순으로 진행
MongoDB Compass Community
# mongorestore --archive --port 2702
// 관리자 계정을 먼저 생성하고 사용자계정 생성 데이터베이스 생성 순으로 진행
# mongod --port 2701 --dbpath /data/db1 // 포트, 데이터 저장 경로 설정
# mongo --port 2701 // 접속
> use admin
> db.createUser( {user: "Admin", pwd: "abc123", roles: [ { role: "Admindb", db: "admin" } ] }). // 어드민 생성
> exit
# sudo service mongod restart
# mongod --auth --port 2701 --dbpath /data/mongodata // 디렉토리 생성 후 포트, 저장 경로 지정
# mongo --port 2701 -u "Admin" -p "abc123" --authenticationDatabase "admin”. // 관리자 접속
# mongo --port 2701
> use test
> db.createUser( {user: "jaurim", pwd: "xyz123", roles: [ { role: "readWrite", db: "jaurimdb" }, { role: "read", db: "reporting" } ] }). // 사용자 계정 생성
> exit
# mongo --port 2701 -u "jaurim" -p "xyz123" --authenticationDatabase "jaurimdb”. // 사용자로 접속
> jaurimdb.foo.insert( { x: 1, y: 1 } ) // 데이터 삽입
MongoDB Compass Community
- 다운
- Version에서 'Community Edtion Stable'을 선택하여 다운
- Cloud, Servers, Tools에서 'Tools'-> 'Compass' 선택
- AWS, GCP, Azure는 'Cloud'
- MongoDB Enterprise comes는 'Servers' 선택
Studio 3T. (30일 사용 후 유료 전환)
- Authentication 탭에서 Authentication Mode에서 Basic ... 리스트 클릭
- User Name, Password, Authentication DB(= RDBMS Database Name) 입력
Thanks for Sharing!
답글삭제Really a nice post.
Now You Can Easily Download Every Crack Software From Here*
Please Visit!
GridinSoft Anti-Malware crack
Studio 3T 2021 crack
Driver Talent Pro crack
Corel PaintShop Pro crack
VideoPad Video Editor crack
After looking through a few blog articles on your website,we sincerely appreciate the way you blogged.We’ve added it to our list of bookmarked web pages and will be checking back in the nearfuture. Please also visit my website and tell us what you think.Great work with hard work you have done I appreciate your work thanks for sharing it.
답글삭제Studio 3T Crack