Linode的VPS准备在月底就终止续费了,所以尽可能多花时间在上面折腾。准备试着部署一下Nodeclub,看说明写的是

线上跑的是 Node.js v4.4.0,MongoDB 是 v3.0.5,Redis 是 v3.0.3。

Node.js系统上已经有了,就先开始安装MongoDB吧。

[[email protected] ~]# wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.0.5.tgz
[[email protected] ~]# tar -zxvf mongodb-linux-x86_64-rhel62-3.0.5.tgz
[[email protected] ~]# mv mongodb-linux-x86_64-rhel62-3.0.5 mongodb
[[email protected] ~]# mv mongodb /usr/local/
[[email protected] ~]# cd /usr/local/mongodb
[[email protected] mongodb]# ls
bin  GNU-AGPL-3.0  README  THIRD-PARTY-NOTICES
[[email protected] mongodb]# mkdir db
[[email protected] mongodb]# mkdir logs
[[email protected] mongodb]# cd bin
[[email protected] bin]# ls
bsondump  mongod     mongoexport  mongoimport  mongoperf     mongos     mongotop
mongo     mongodump  mongofiles   mongooplog   mongorestore  mongostat
[[email protected] bin]# vim mongodb.conf
dbpath=/usr/local/mongodb/db
logpath=/usr/local/mongodb/logs/mongodb.log
port=27017
fork=true
nohttpinterface=true
[[email protected] bin]# /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf
about to fork child process, waiting until server is ready for connections.
forked process: 26170
child process started successfully, parent exiting

MongoDB已经启动起来了。下面加入开机自动启动mongodb

[[email protected] bin]# vim /etc/rc.d/rc.local
/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf
[[email protected] bin]# ps -ef|grep mongo
root     26170     1  0 15:30 ?        00:00:00 /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf
root     26794 21916  0 15:31 pts/3    00:00:00 grep mongo

重启系统后进入MongoDB

[[email protected] ~]# /usr/local/mongodb/bin/mongo
MongoDB shell version: 3.0.5
connecting to: test
Server has startup warnings:
2017-02-15T15:46:30.303+0800 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2017-02-15T15:46:30.303+0800 I CONTROL  [initandlisten]
> show dbs
local  0.078GB
> exit
bye
[[email protected] ~]#

测试可用,OVER!

Copyright © OneZos all right reserved,powered by Gitbook本书发布时间: 2021-06-09 09:54:10

results matching ""

    No results matching ""