第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

mongo-01-linux安裝MongoServer

標(biāo)簽:
MongoDB

MongoDB Community Server 下载
MongoDB官网地址: https://www.mongodb.com/try/download/community
我下载的是:
mongodb-linux-x86_64-rhel70-4.4.3.tgz

机器准备:Centos7

图片描述

1. 安装 mongodb

1.1 解压

解压 mongodb-linux-x86_64-rhel70-4.4.3.tgz/usr/local,然后将解压目录重命名为 mongodb-4.4.3

[root@docker01 local]# pwd
/usr/local
[root@docker01 local]# ll mongodb-linux-x86_64-rhel70-4.4.3.tgz 
-rw-r--r--. 1 root root 71417896 1月  14 2021 mongodb-linux-x86_64-rhel70-4.4.3.tgz
# 解压 `mongodb-linux-x86_64-rhel70-4.4.3.tgz`
[root@docker01 local]# tar -zxvf mongodb-linux-x86_64-rhel70-4.4.3.tgz
mongodb-linux-x86_64-rhel70-4.4.3/LICENSE-Community.txt
mongodb-linux-x86_64-rhel70-4.4.3/MPL-2
mongodb-linux-x86_64-rhel70-4.4.3/README
mongodb-linux-x86_64-rhel70-4.4.3/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel70-4.4.3/bin/install_compass
mongodb-linux-x86_64-rhel70-4.4.3/bin/mongo
mongodb-linux-x86_64-rhel70-4.4.3/bin/mongod
mongodb-linux-x86_64-rhel70-4.4.3/bin/mongos
# 将解压目录重命名为 `mongodb-4.4.3`
[root@docker01 local]# mv mongodb-linux-x86_64-rhel70-4.4.3 mongodb-4.4.3
[root@docker01 local]# ll mongodb-4.4.3/
总用量 132
drwxr-xr-x. 2 root root    70 1月  13 22:53 bin
-rw-r--r--. 1 root root 30608 12月 22 07:19 LICENSE-Community.txt
-rw-r--r--. 1 root root 16726 12月 22 07:19 MPL-2
-rw-r--r--. 1 root root  1977 12月 22 07:19 README
-rw-r--r--. 1 root root 75685 12月 22 07:19 THIRD-PARTY-NOTICES
[root@docker01 local]# 

1.2 新建数据目录和日志目录

# 新建数据目录
[root@docker01 local]# mkdir -p /var/lib/mongodb
# 新建日志目录
[root@docker01 local]# mkdir -p /var/log/mongodb

1.3 新建配置文件 mongo.conf

/usr/local/mongodb-4.4.3/ 新建 mongo.conf 文件

# mongod.conf

#以守护程序的方式启用
fork=true

# 端口
port=27017

#这里默认是127.0.0.1, 设置成0.0.0.0是表示所有IP地址都可以访问
bindIp=0.0.0.0

# 数据存储目录
dbPath=/var/lib/mongodb

# 日志存储路径
logAppend=true
logPath=/var/log/mongodb/mongod.log

2. 启动mongo服务

通过 mongod -f mongo.conf 启动mongo服务,并检查 27017 端口已经启动

[root@docker01 local]# /usr/local/mongodb-4.4.3/bin/mongod -f /usr/local/mongodb-4.4.3/mongodb.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 21674
child process started successfully, parent exiting
[root@docker01 local]# ss -nultp | grep 27017
tcp    LISTEN     0      128       *:27017                 *:*                   users:(("mongod",pid=21674,fd=11))

3. mongo客户端连接

通过安装包自带的客户端 mongo 来连接刚刚启动的 mongod 服务。

--host 指定主机名
--port 指定端口名

连接服务器成功后,show databases 显示已有的数据库,admin、local、config这3个是默认的数据库。

[root@docker01 local]# /usr/local/mongodb-4.4.3/bin/mongo --host localhost --port 27017
MongoDB shell version v4.4.3
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("c8fd1b77-523b-43ec-8fd2-b4f54a6f517d") }
MongoDB server version: 4.4.3
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
	https://community.mongodb.com
---
The server generated these startup warnings when booting: 
        2021-01-13T23:08:55.449+08:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2021-01-13T23:08:55.449+08:00: You are running this process as the root user, which is not recommended
        2021-01-13T23:08:55.449+08:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
        2021-01-13T23:08:55.449+08:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never'
        2021-01-13T23:08:55.449+08:00: Soft rlimits too low
        2021-01-13T23:08:55.449+08:00:         currentValue: 1024
        2021-01-13T23:08:55.449+08:00:         recommendedMinimum: 64000
---
---
        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
> 

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消