`
sillycat
  • 浏览: 2489349 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Redis(1)Install redis on my system

 
阅读更多
Redis(1)Install redis on my system

1. windows7
find the installation file from this URL
https://github.com/dmajkic/redis/downloads
Download the latest file with this URL https://github.com/downloads/dmajkic/redis/redis-2.4.5-win32-win64.zip

Unzip and copy the directory to working directory:
The exe command file is under this directory D:\tool\redis-2.4.5-win32-win64\64bit, add this directory to my system path:
path=D:\tool\redis-2.4.5-win32-win64\64bit

run the command to start the server
>redis-server.exe

run the command to start the client side
>redis-cli.exe
redis 127.0.0.1:6379>
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> exit
exit command can exit the client

2. Ubuntu 12.04 Installation
add the URL to my repository
>cd /etc/apt/sources.list.d/
>sudo vi dotdeb.org.list
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

import the public key
>sudo wget -q -o - http://www.dotdeb.org/dotdeb.gpg
>sudo apt-key add dotdeb.gpg

update the resource and install
>sudo apt-get update
>sudo apt-get install redis-server
>sudo /etc/init.d/redis-server status
redis-server is running

>redis-cli -h

I want to use windows to connect to my ubuntu server. But I got these error message:
C:\Users\Digby>redis-cli.exe -h 192.168.56.101
Could not connect to Redis at 192.168.56.101:6379: Unknown error

I open the configuration file under ubuntu
>cd /etc/redis
>sudo vi redis.conf
change the line to
from

bind 127.0.0.1

to

bind 0.0.0.0

>sudo /etc/init.d/redis-server restart

It is ok now.

3. Install Redis on Redhat
>wget http://redis.googlecode.com/files/redis-2.4.14.tar.gz
>tar zxvf redis-2.4.14.tar.gz
>cd redis-2.4.14
>sudo make
>cd src
>mkdir /opt/tools/redis
>cp redis-server /opt/tools/redis/
>cp redis-benchmark /opt/tools/redis/
>cp redis-cli /opt/tools/redis/
>cd ..
>cp redis.conf /opt/tools/redis/
>cd /opt/tools/redis/

Start the redis server:
>./redis-server redis.conf

references:
http://krams915.blogspot.com/search/label/Redis
https://github.com/krams915/spring-redis-tutorial.git
http://redis.io/download
http://zheng12tian.iteye.com/blog/1471726
http://ajava.org/article-1137-1.html



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics