日韩小视频-日韩久久一区二区三区-日韩久久一级毛片-日韩久久久精品中文字幕-国产精品亚洲精品影院-国产精品亚洲欧美云霸高清

下載吧 - 綠色安全的游戲和軟件下載中心

軟件下載吧

當(dāng)前位置:軟件下載吧 > 數(shù)據(jù)庫(kù) > DB2 > MongoDB入門(mén)到進(jìn)階筆記:01-Linux 單機(jī)版MongoDB安裝

MongoDB入門(mén)到進(jìn)階筆記:01-Linux 單機(jī)版MongoDB安裝

時(shí)間:2024-02-08 11:17作者:下載吧人氣:22

下載安裝包

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-5.0.13.tgz

[root@5e7b4039fa6f data]# pwd
/data
[root@5e7b4039fa6f data]# ll
total 84540
-rw-r--r--. 1 root root 86567530 Nov 2 07:41 mongodb-linux-x86_64-rhel70-5.0.13.tgz

解壓安裝包

[root@5e7b4039fa6f data]# tar -xzvf mongodb-linux-x86_64-rhel70-5.0.13.tgz
mongodb-linux-x86_64-rhel70-5.0.13/LICENSE-Community.txt
mongodb-linux-x86_64-rhel70-5.0.13/MPL-2
mongodb-linux-x86_64-rhel70-5.0.13/README
mongodb-linux-x86_64-rhel70-5.0.13/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel70-5.0.13/bin/install_compass
mongodb-linux-x86_64-rhel70-5.0.13/bin/mongo
mongodb-linux-x86_64-rhel70-5.0.13/bin/mongod
mongodb-linux-x86_64-rhel70-5.0.13/bin/mongos

改名稱為mongo

[root@5e7b4039fa6f data]# mv mongodb-linux-x86_64-rhel70-5.0.13/ mongodb
[root@5e7b4039fa6f data]#
[root@5e7b4039fa6f data]# ll
total 0
drwxr-xr-x. 3 root root 100 Nov 2 07:43 mongodb

配置環(huán)境變量


vi /etc/profile
export PATH=$PATH:/data/mongodb/bin

查看版本


[root@5e7b4039fa6f data]# mongod -version
db version v5.0.13
Build Info: {
"version": "5.0.13",
"gitVersion": "cfb7690563a3144d3d1175b3a20c2ec81b662a8f",
"openSSLVersion": "OpenSSL 1.0.1e-fips 11 Feb 2013",
"modules": [],
"allocator": "tcmalloc",
"environment": {
"distmod": "rhel70",
"distarch": "x86_64",
"target_arch": "x86_64"
}
}

創(chuàng)建目錄


[root@5e7b4039fa6f mongodb]# mkdir data logs
[root@5e7b4039fa6f mongodb]# ll
total 136
-rw-r--r--. 1 root root 30608 Sep 29 11:18 LICENSE-Community.txt
-rw-r--r--. 1 root root 16726 Sep 29 11:18 MPL-2
-rw-r--r--. 1 root root 1977 Sep 29 11:18 README
-rw-r--r--. 1 root root 77913 Sep 29 11:18 THIRD-PARTY-NOTICES
drwxr-xr-x. 2 root root 70 Nov 2 07:43 bin
drwxr-xr-x. 2 root root 6 Nov 2 07:54 data
drwxr-xr-x. 2 root root 6 Nov 2 07:54 logs

創(chuàng)建配置文件


[root@5e7b4039fa6f mongodb]# vi mongod.cnf
systemLog:
destination: file
logAppend: true
path: /data/mongodb/logs/mongodb.log
storage:
dbPath: /data/mongodb/data
journal:
enabled: true
processManagement:
fork: true
net:
port: 27017
bindIp: 0.0.0.0
# 如果是公網(wǎng)服務(wù)器,學(xué)習(xí)的時(shí)候,建議監(jiān)聽(tīng)在127.0.0.1:2017

啟動(dòng) mongodb


[root@5e7b4039fa6f mongodb]# mongod -f mongod.cnf
about to fork child process, waiting until server is ready for connections.
forked process: 604
child process started successfully, parent exiting

啟動(dòng)驗(yàn)證


[root@5e7b4039fa6f mongodb]# ps -ef|grep mongod
root 604 1 1 07:58 ? 00:00:02 mongod -f mongod.cnf
root 864 357 0 08:02 pts/0 00:00:00 grep --color=auto mongod
[root@5e7b4039fa6f mongodb]#
[root@5e7b4039fa6f mongodb]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 604/mongod
tcp 0 0 127.0.0.11:40460 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 159/sshd
tcp6 0 0 :::22 :::* LISTEN 159/sshd

登錄驗(yàn)證


[root@5e7b4039fa6f mongodb]# mongo
MongoDB shell version v5.0.13
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“08b61839-9951-4d81-975b-f48adc444eb1”) }

MongoDB server version: 5.0.13

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.
For installation instructions, see

https://docs.mongodb.com/mongodb-shell/install/

The server generated these startup warnings when booting:
2022-11-02T07:58:55.843+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
2022-11-02T07:58:55.843+00:00: You are running this process as the root user, which is not recommended
2022-11-02T07:58:55.843+00:00: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’. We suggest setting it to ‘never’

2022-11-02T07:58:55.843+00:00: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’. We suggest setting it to ‘never’

    Enable MongoDB's free cloud-based monitoring service, which will then receive and display
    metrics about your deployment (disk utilization, CPU, operation statistics, etc).

    The monitoring data will be available on a MongoDB website with a unique URL accessible to you
    and anyone you share the URL with. MongoDB may use this information to make product
    improvements and to suggest MongoDB products and deployment options to you.

    To enable free monitoring, run the following command: db.enableFreeMonitoring()

To permanently disable this reminder, run the following command: db.disableFreeMonitoring()

show databases;
admin 0.000GB
config 0.000GB
local 0.000GB

關(guān)閉數(shù)據(jù)庫(kù)

標(biāo)簽MongoDB,學(xué)習(xí)筆記,技術(shù)文檔,數(shù)據(jù)庫(kù),MongoDB

相關(guān)下載

查看所有評(píng)論+

網(wǎng)友評(píng)論

網(wǎng)友
您的評(píng)論需要經(jīng)過(guò)審核才能顯示

熱門(mén)閱覽

最新排行

公眾號(hào)

主站蜘蛛池模板: 黄色影视频| 国产成人香蕉在线视频网站 | 日韩国产欧美一区二区三区 | 亚洲网站视频在线观看 | 亚洲一区二区三区四区 | 欧美一级专区免费大片俄罗斯 | 一区二区中文字幕亚洲精品 | 国产精品欧美亚洲 | 亚洲精品人成网在线播放影院 | 日本黄网站高清色大全 | 精品综合久久久久久88小说 | 亚洲一级免费毛片 | 国产第四页 | 美女在线网站免费的 | 久久国产美女免费观看精品 | 日本一在线中文字幕天堂 | 亚洲欧美日本韩国综合在线观看 | 国产99视频在线观看 | 在线日韩国产 | 国产男女 爽爽爽爽视频 | 成年女人看片免费视频频 | 国产专区在线 | 毛片欧美 | 久久亚洲成人 | 美国三级大片 | 免费一级毛片免费播放 | 成人毛片18女人毛片免费 | 国产精品成人在线 | 99久久国产综合精品网成人影院 | 自拍偷拍视频在线观看 | 性猛交毛片 | 97在线观看完整免费 | 一区精品麻豆经典 | 在线国产网站 | 亚洲精品亚洲人成在线 | 91精品国产免费久久 | 欧美精品人爱a欧美精品 | 久久久久国产一级毛片高清板 | 色怡红院 | 91久久亚洲国产成人精品性色 | 在线免费成人网 |