centos8安装mongodb5
生活随笔
收集整理的這篇文章主要介紹了
centos8安装mongodb5
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1:下載
服務端:https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/RPMS/mongodb-org-server-5.0.2-1.el8.x86_64.rpm
Shell工具:https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/RPMS/mongodb-org-shell-5.0.2-1.el8.x86_64.rpm
數據導入導出工具:https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/RPMS/mongodb-org-tools-5.0.2-1.el8.x86_64.rpm
集群包:https://repo.mongodb.org/yum/redhat/8/mongodb-org/5.0/x86_64/RPMS/mongodb-org-mongos-5.0.2-1.el8.x86_64.rpm
2:安裝
[root@iZwz94zhiwnwqzf7b66yxqZ middle]# rpm -ivh mongodb-org-server-5.0.2-1.el8.x86_64.rpm warning: mongodb-org-server-5.0.2-1.el8.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID e2c63c11: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing...1:mongodb-org-server-5.0.2-1.el8 ################################# [100%] Created symlink /etc/systemd/system/multi-user.target.wants/mongod.service → /usr/lib/systemd/system/mongod.service. [root@iZwz94zhiwnwqzf7b66yxqZ middle]#3:啟動
[root@iZwz94zhiwnwqzf7b66yxqZ ~]# systemctl start mongod [root@iZwz94zhiwnwqzf7b66yxqZ ~]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 59105/mongod4:安裝運行shell
[root@iZwz94zhiwnwqzf7b66yxqZ middle]# rpm -ivh mongodb-org-shell-5.0.2-1.el8.x86_64.rpm warning: mongodb-org-shell-5.0.2-1.el8.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID e2c63c11: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing...1:mongodb-org-shell-5.0.2-1.el8 ################################# [100%] [root@iZwz94zhiwnwqzf7b66yxqZ middle]# mongo MongoDB shell version v5.0.2 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("d6820ffd-0e64-4325-b08e-444cb108e251") } MongoDB server version: 5.0.2 ================ Warning: the "mongo" shell has been superseded by "mongosh", which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in an upcoming release. We recommend you begin using "mongosh". For installation instructions, see https://docs.mongodb.com/mongodb-shell/install/ ================ Welcome to the MongoDB shell.> show dbs; admin 0.000GB config 0.000GB local 0.000GB5:配置文件
默認安裝的mongodb綁定的ip是127.0.0.1,需要修改
[root@1z94zhiwnwqzf7b66yxqZ etc]# vi /etc/mongod.conf# mongod.conf# for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/# where to write logging data. systemLog:destination: filelogAppend: truepath: /var/log/mongodb/mongod.log# Where and how to store data. storage:dbPath: /var/lib/mongojournal:enabled: true # engine: # wiredTiger:# how the process runs processManagement:fork: true # fork and run in backgroundpidFilePath: /var/run/mongodb/mongod.pid # location of pidfiletimeZoneInfo: /usr/share/zoneinfo# network interfaces net:port: 27017bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.#security:#operationProfiling:#replication:#sharding:## Enterprise-Only Options#auditLog:#snmp:修改
net:
? port: 27017
? bindIp: 0.0.0.0?
?
總結
以上是生活随笔為你收集整理的centos8安装mongodb5的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mongodb创建用户
- 下一篇: elasticsearch-7.3安装