查看“︁MongoDB”︁的源代码
来自康健生活
←
MongoDB
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 安装 == === Centos === 添加 yum 源 {{shc|<syntaxhighlight lang="bash"> vi /etc/yum.repos.d/mongodb-org-4.0.repo</syntaxhighlight>}} {{hc|mongodb-org-4.0.repo|<syntaxhighlight lang="bash"> [mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc</syntaxhighlight>}} {{shc|<syntaxhighlight lang="bash"> yum install -y mongodb-org && systemctl start mongod</syntaxhighlight>}} === 远程访问配置 === 修改mongodb的配置文件 让其监听所有外网 IP。 {{shc|<syntaxhighlight lang="bash"> vi /etc/mongodb.conf</syntaxhighlight>}} {{hcdiff|head=mongodb.conf|output=<syntaxhighlight lang="bash" highlight="5"> ... # network interfaces net: port: 27017 bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting. ... </syntaxhighlight>|output2=<syntaxhighlight lang="bash" highlight="5"> ... # network interfaces net: port: 27017 bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting. ... </syntaxhighlight>}} {{shc|<syntaxhighlight lang="bash"> systemctl restart mongod.service</syntaxhighlight>}}
返回
MongoDB
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。