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 ,以守护进程方式启动进程。
daemaon no 为daemaon yes ,以守护进程方式启动进程。
$cd utils $sudo ./install_server.sh
安装默认属性设置
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [] /usr/local/bin/redis-server (这里输入刚才copy的路径)
Please 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: *** [test] 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
浙公网安备 33010602011771号