mongodb下载:
https://www.mongodb.com/download-center?jmp=nav#community
windows下安装mongodb:
打开上面网址,点Community Server 然后点windows下,下载后点下一步安装即可;
centos7.14下安装mongodb:
采用的yum方式安装:
[root@localhost /]# cd etc/yum.repos.d/
建一个mongodb.repo文件,内容如下:
[mongodb-org]
name=MongoDB Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mongodb/yum/el$releasever/
gpgcheck=0
enabled=1
然后执行:
[root@localhost yum.repos.d]# yum install mongodb-org
启动:
[root@localhost yum.repos.d]# service mongod start
Starting mongod (via systemctl): [ 确定 ]
查看是否启动成功(默认27017端口):
[root@localhost yum.repos.d]# netstat -ntlp
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 1329/mongod
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1018/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1118/master
tcp6 0 0 :::22 :::* LISTEN 1018/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1118/master
[root@localhost yum.repos.d]#
如果需要外网访问,记得关防火墙:
service firewalld stop
配置文件地址:
[root@localhost yum.repos.d]# whereis mongod
mongod: /usr/bin/mongod /etc/mongod.conf /usr/share/man/man1/mongod.1
连接:
[root@localhost yum.repos.d]# mongo 127.0.0.1:27017
MongoDB shell version: 3.2.20
connecting to: 127.0.0.1:27017/test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten]
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten]
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten]
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2018-08-01T22:36:15.924+0800 I CONTROL [initandlisten]
> show dbs
local 0.000GB
>
如果连接时报上面的错误,解决办法:
https://blog.csdn.net/u013075468/article/details/51471033
[root@localhost soft]# echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
[root@localhost soft]# echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
[root@localhost soft]# vim /etc/security/limits.conf
添加:
mongod soft nofile 64000 mongod hard nofile 64000 mongod soft nproc 32000 mongod hard nproc 32000
重启:service mongod restart
- 相关文章
- windows下使用MongoDB Compass Com
- Oracle VM VirtualBox中设置共享文
- linux安装openvpn并保存密码
- deepin v20深度系统安装docker及do
- 域名在阿里云服务器换成腾讯云后备
- windows下安装VirtualBox增强工具
- 国内访问github慢或打不开的解决方
- linux下安装phpstorm2018及激活码
- vmware中虚拟机上不了网及共享文件
- linux版phpstorm2020.3.3及激活码
- 热门文章
- win7中将文件拷贝到虚拟机linux下
- phpexcel设置行高及列宽,背景颜色,
- rabbitmq无法启动
- intellij idea不显示git push按钮
- php7中使用mongodb的aggregate进行
- laravel页面静态化的方法
- centos7.4 64位下swoole安装及配置
- navicate连接mycat报1184错误
- curl设置超时不起作用(CURLOPT_TIM
- devops-jenkins容器为pending状态
- 好评文章
- phpexcel设置行高及列宽,背景颜色,
- php7中使用mongodb的aggregate进行
- intellij idea打开文件所在文件夹
- windows下使用MongoDB Compass Com
- win7中将文件拷贝到虚拟机linux下
- laravel 中悲观锁 & 乐观锁的使用
- 单点登录sso原理及php实现方式及de
- navicate连接mycat报1184错误
- rabbitmq无法启动
- laravel整合dingo/api方法步骤:jwt
- 我的项目
- 【github】www.github.com/hurong241
- 【码云】gitee.com/hu_rong/projects
- 【docker hub】hub.docker.com/repositories/hurong241
- 【packagist】packagist.org/users/hurong241/packages
- 站点信息
- 建站时间:2011年
- 文章数:623篇
- 浏览数:1303109