ubuntu redis mongo



Install Redis 2.8.9

sudo apt-add-repository ppa:chris-lea/redis-server

sudo apt-get update

sudo apt-get install redis-server

Remove Redis 2.8.9

sudo apt-get purge--auto-remove redis-server



启动 redis 的服务

root@ubuntu:/usr/local/redis-2.4.14# ./src/redis-server

 

注意这种方式启动 redis 使用的是默认配置。也可以通过启动参数告诉 redis 使用指定配置文件使用下面命令启动 .

$ ./redis-server redis.conf

 

启动 redis 客户端和服务端进行交互

naxsu@ubuntu:/usr/local/redis-2.4.14$ ./src/redis-cli

redis 127.0.0.1:6379> set foo bar

OK

redis 127.0.0.1:6379> get foo

"bar"

redis 127.0.0.1:6379>

关闭 redis

redis 127.0.0.1:6379> shutdown

 

退出客户端

redis 127.0.0.1:6379> quit


========================================================================

MONGODB

1. Import the MongoDB public key

Ubuntu package manager use this key to check the consistency and authenticity of the packages

2. Generate a file with the MongoDB repository url

3. Refresh the local database with the packages

4. Install the last stable MongoDB version and all the necessary packages on our system

sudo apt-get install mongodb-org=3.0.0 mongodb-org-server=3.0.0 mongodb-org-shell=3.0.0 mongodb-org-mongos=3.0.0 mongodb-org-tools=3.0.0


(a) To restart the mongod service

sudo service <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; line-height: 24px;">mongod</span> restart

(b) To start mongod Service

sudo service <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; line-height: 24px;">mongod</span> start

(c) To stop mongod service

sudo service <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; line-height: 24px;">mongod</span> stop

(c) To get status of mongod service

sudo service <span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; line-height: 24px;">mongod</span> status



转自:http://www.sysads.co.uk/2014/05/install-redis-2-8-9-ubuntu-14-04-13-10/

http://itway.iteye.com/blog/1555063

http://www.cnblogs.com/SuperLiangG/p/4335657.html

你可能感兴趣的:(ubuntu redis mongo)