Redis(1)Install redis on my system

本文提供了在Windows 7、Ubuntu 12.04及Red Hat系统上安装Redis的详细步骤。包括下载、配置环境变量、安装服务及启动客户端等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值