標籤:
下載安裝redis2.8.19的源碼
$ wget http://download.redis.io/releases/redis-2.8.19.tar.gz$ tar xzf redis-2.8.19.tar.gz$ cd redis-2.8.19$ make && make install
使用命令src/redis-server 如果顯示如下就說明初步安裝成功,接下來就自定一下配置
_._ _.-``__ ‘‘-._ _.-`` `. `_. ‘‘-._ Redis 2.8.19 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ‘‘-._ ( ‘ , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|‘` _.-‘| Port: 6379 | `-._ `._ / _.-‘ | PID: 15629 `-._ `-._ `-./ _.-‘ _.-‘ |`-._`-._ `-.__.-‘ _.-‘_.-‘| | `-._`-._ _.-‘_.-‘ | http://redis.io `-._ `-._`-.__.-‘_.-‘ _.-‘ |`-._`-._ `-.__.-‘ _.-‘_.-‘| | `-._`-._ _.-‘_.-‘ | `-._ `-._`-.__.-‘_.-‘ _.-‘ `-._ `-.__.-‘ _.-‘ `-._ _.-‘ `-.__.-‘
進入$ cd utils執行$ sudo ./install_server.sh
#以下配置是個人配置,不一定要一樣,個人喜歡,全用系統預設的配置也行Welcome to the redis service installerThis script will help you easily set up a running redis serverPlease select the redis port for this instance: [6379] #/redis使用的預設連接埠Selecting default: 6379Please select the redis config file name [/etc/redis/6379.conf] /etc/redis/redis.conf #設定檔Please select the redis log file name [/var/log/redis_6379.log] /var/log/redis/redis.log #記錄檔Please select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379Please select the redis executable path [/usr/local/bin/redis-server] #可執行檔Selected config:Port : 6379Config file : /etc/redis/redis.confLog file : /var/log/redis/redis.logData dir : /var/lib/redis/6379Executable : /usr/local/bin/redis-serverCli Executable : /usr/local/bin/redis-cliIs this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Adding system startup for /etc/init.d/redis_6379 ...
/etc/rc0.d/K20redis_6379 -> ../init.d/redis_6379
/etc/rc1.d/K20redis_6379 -> ../init.d/redis_6379
/etc/rc6.d/K20redis_6379 -> ../init.d/redis_6379
/etc/rc2.d/S20redis_6379 -> ../init.d/redis_6379
/etc/rc3.d/S20redis_6379 -> ../init.d/redis_6379
/etc/rc4.d/S20redis_6379 -> ../init.d/redis_6379
/etc/rc5.d/S20redis_6379 -> ../init.d/redis_6379
Success!
Starting Redis server...
Installation successful!
至此,安裝完後,redis就可以如同apt-get install那樣方便地使用
啟動$ service redis_6379 start停止$ service redis_6379 stop重啟$ service redis_6379 restart與redis互動$ redis-cli
ubuntu14.04源碼安裝redis-2.8.19