ITPub博客

首页 > 数据库 > NoSQL > CentOS 6.5 MongoDB 3.2.6安装流程

CentOS 6.5 MongoDB 3.2.6安装流程

原创 NoSQL 作者:feelpurple 时间:2016-05-24 22:13:02 0 删除 编辑
创建用户
[root@localhost ~]# useradd mongo

创建软件安装目录
[root@localhost install]# mkdir /mongo
[root@localhost install]# chown -R mongo:mongo /mongo/

创建数据目录
[root@localhost mongo]# mkdir -p /data/db
[root@localhost mongo]# chown -R mongo:mongo /data/

去官网下载安装包
https://www.mongodb.com/download-center?jmp=nav&_ga=1.74077840.329135560.1464005265#community
[root@localhost mongo]# cp /home/fire/Desktop/mongodb-linux-x86_64-rhel62-3.2.11.gz /install/
[root@localhost mongo]# chown -R mongo:mongo /install/

解压安装包到软件安装目录
[mongo@localhost install]$ tar -zxvf mongodb-linux-x86_64-rhel62-3.2.11.gz -C /mongo/
mongodb-linux-x86_64-rhel62-3.2.11/README
mongodb-linux-x86_64-rhel62-3.2.11/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel62-3.2.11/MPL-2
mongodb-linux-x86_64-rhel62-3.2.11/GNU-AGPL-3.0
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongodump
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongorestore
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongoexport
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongoimport
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongostat
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongotop
mongodb-linux-x86_64-rhel62-3.2.11/bin/bsondump
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongofiles
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongooplog
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongoperf
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongosniff
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongod
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongos
mongodb-linux-x86_64-rhel62-3.2.11/bin/mongo

配置环境变量
[root@localhost ~]# su - mongo
[mongo@localhost ~]$ vi .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/mongo/mongodb-linux-x86_64-rhel62-3.2.11/bin

export PATH
启动MongoDB
[mongo@localhost mongodb-linux-x86_64-rhel62-3.2.11]$ mongod &
[1] 2821
[mongo@localhost mongodb-linux-x86_64-rhel62-3.2.11]$ 2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] MongoDB starting : pid=2821 port=27017 dbpath=/data/db 64-bit host=localhost.localdomain
2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] db version v3.2.11
2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] allocator: tcmalloc
2016-12-10T03:06:09.622-0800 I CONTROL  [initandlisten] modules: none
2016-12-10T03:06:09.623-0800 I CONTROL  [initandlisten] build environment:
2016-12-10T03:06:09.623-0800 I CONTROL  [initandlisten]     distmod: rhel62
2016-12-10T03:06:09.623-0800 I CONTROL  [initandlisten]     distarch: x86_64
2016-12-10T03:06:09.623-0800 I CONTROL  [initandlisten]     target_arch: x86_64
2016-12-10T03:06:09.623-0800 I CONTROL  [initandlisten] options: {}
2016-12-10T03:06:09.665-0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
2016-12-10T03:06:09.837-0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-12-10T03:06:09.838-0800 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-12-10T03:06:09.878-0800 I NETWORK  [initandlisten] waiting for connections on port 27017

[mongo@localhost mongodb-linux-x86_64-rhel62-3.2.11]$ mongo
MongoDB shell version: 3.2.11
connecting to: test
2016-12-10T03:06:33.292-0800 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:38549 #1 (1 connection now open)
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: 
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-12-10T03:06:09.836-0800 I CONTROL  [initandlisten] 
>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26506993/viewspace-2106303/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-08-01

  • 博文量
    404
  • 访问量
    1673974