MongoDB:修订间差异
来自康健生活
无编辑摘要 |
|||
| 第1行: | 第1行: | ||
== 安装 == | == 安装 == | ||
=== Centos === | === Centos === | ||
添加 yum 源 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
vi /etc/yum.repos.d/mongodb-org-4.0.repo</syntaxhighlight>}} | |||
{{hc|mongodb-org-4.0.repo|<pre> | |||
[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</pre>}} | |||
{{shc|<syntaxhighlight lang="bash"> | |||
yum install -y mongodb-org && systemctl start mongod</syntaxhighlight>}} | |||
=== 远程访问配置 === | === 远程访问配置 === | ||
修改mongodb的配置文件 让其监听所有外网 IP。 | 修改mongodb的配置文件 让其监听所有外网 IP。 | ||