Linux redis安装
$ wget http://download.redis.io/redis-stable.tar.gz$ tar xvzf redis-stable.tar.gz //这里假设解压缩到/usr/local/redis
$ cd redis-stable
$ make
$ make test
$ sudo make install
$ sudo cp ./src/redis-server /usr/local/bin/
$ sudo cp ./src/redis-cli /usr/local/bin/
$ sudo cp redis.conf /etc/redis.conf
$ sudo vi /etc/redis.conf
编辑/etc/redis.conf ,修改daemaon no 为daemaon yes ,以守护进程方式启动进程。
$cd utils$sudo ./install_server.sh
安装默认属性设置Please select the redis port for this instance: Selecting default: 6379Please select the redis config file name Selected default - /etc/redis/6379.confPlease select the redis log file name Selected default - /var/log/redis_6379.logPlease select the data directory for this instance
Selected default - /var/lib/redis/6379Please select the redis executable path [] /usr/local/bin/redis-server(这里输入刚才copy的路径) $ redis-server /etc/redis.conf & //启动redis
FAQ: make test报错:
You need tcl 8.5 or newer in order to run the Redis testmake: *** Error 1解决办法:安装tcl
$ wget http://downloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz $ cd tcl8.6.0/ $ cd unix &&./configure --prefix=/usr \ --mandir=/usr/share/man \ --without-tzdata \ $([ $(uname -m) = x86_64 ] && echo --enable-64bit) && make && sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \ -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \ -i tclConfig.sh $ make install &&make install-private-headers &&ln -v -sf tclsh8.6 /usr/bin/tclsh &&chmod -v 755 /usr/lib/libtcl8.6.so
页:
[1]