NoSQL之Redis - CentOS 6.5安装测试
2014-10-29 10:34
495 查看
1.下载redis可以在线安装或者下载redis①在线安装前需要检测是否存在rpm包不存在的话查看yum在线是否存在rpm包不存在的话就只能手动下载或者用别的方式下载[root@localhost~]#rpm-qa|grepredis
[root@localhost~]#yumlist|grepredis说明不存在。②去官网下载或者在线下载wgethttp://redis.googlecode.com/files/redis-2.2.13.tar.gz官网下载好的redis[b] [/b]已经存在博客中了点击下载redis 。2.安装由于是tar.gz格式的所以需要解压安装下载好之后查找下载文件所在路径[root@localhost~]#whereisredis
redis:/etc/redis
[root@localhost~]#解压编译redis的软件包需要有gcc环境总之缺少什么安装什么。tar-zxvfreids-2.8.13.tar.gzcdredis-2.8.13makesudomakeinstall#配置开始---编译完成后在Src目录下有四个可执行文件redis-server、redis-benchmark、redis-cli和redis.conf。然后拷贝到一个目录下。mkdir/usr/rediscpredis-server/usr/rediscpredis-benchmark/usr/rediscpredis-cli/usr/rediscpredis.conf/usr/rediscd/usr/redis#配置结束--或者可以这样配置redis.conf
mkdir/etc/rediscpredis.conf/etc/redis/redis.confmkdir/var/lib/redis可从此处下载修改好的
启动redisredis-server/etc/redis/redis.conf#即可在后台启动redis服务确认运行了之后可以用redis-benchmark命令测试看看还可以通过redis-cli命令实际操作一下比如#install的时候redis的命令会被拷贝到/usr/local/bin下面3.测试客户端测试一下是否启动成功
[root@localhostsrc]#ps-aux|grepredisWarning:badsyntax,perhapsabogus'-'?See/usr/share/doc/procps-3.2.8/FAQroot232660.00.71373567768?Sl00:230:04redis-server*:6379root239820.00.5194045100pts/0S+01:090:00redis-cliroot243980.00.0103244876pts/2S+01:440:00grepredis[root@localhostsrc]#redis-cli127.0.0.1:6379>setwwangOK127.0.0.1:6379>getw"wang"127.0.0.1:6379>4.关闭服务
redis-clishutdown如果端口变化可以指定端口:redis-cli-p6379shutdown
127.0.0.1:6379>i+jCouldnotconnecttoRedisat127.0.0.1:6379:Connectionrefusednotconnected>setw3CouldnotconnecttoRedisat127.0.0.1:6379:Connectionrefusednotconnected>5.启动服务
[root@localhostsrc]#redis-server[24502]28Oct01:54:35.784#Warning:noconfigfilespecified,usingthedefaultconfig.Inordertospecifyaconfigfileuseredis-server/path/to/redis.conf[24502]28Oct01:54:35.784*Increasedmaximumnumberofopenfilesto10032(itwasoriginallysetto1024)._.__.-``__''-.__.-```.`_.''-._Redis2.8.13(00000000/0)64bit.-``.-```.```\/_.,_''-._(',.-`|`,)Runninginstandalonemode|`-._`-...-`__...-.``-._|'`_.-'|Port:6379|`-._`._/_.-'|PID:24502`-._`-._`-./_.-'_.-'|`-._`-._`-.__.-'_.-'_.-'||`-._`-.__.-'_.-'|启动之后最好重新打开个窗口运行redsi-cli进入控制台否则可能出现连接错误。和windows下cmd运行tomcat类似。http://redis.io`-._`-._`-.__.-'_.-'_.-'|`-._`-._`-.__.-'_.-'_.-'||`-._`-.__.-'_.-'|`-._`-._`-.__.-'_.-'_.-'`-._`-.__.-'_.-'`-.__.-'`-.__.-'[24502]28Oct01:54:35.786#Serverstarted,Redisversion2.8.13[24502]28Oct01:54:35.786#WARNINGovercommit_memoryissetto0!Backgroundsavemayfailunderlowmemorycondition.Tofixthisissueadd'vm.overcommit_memory=1'to/etc/sysctl.confandthenrebootorrunthecommand'sysctlvm.overcommit_memory=1'forthistotakeeffect.[24502]28Oct01:54:35.786*DBloadedfromdisk:0.000seconds[24502]28Oct01:54:35.786*Theserverisnowreadytoacceptconnectionsonport6379
[root@localhostredis]#redis-cliCouldnotconnecttoRedisat127.0.0.1:6379:Connectionrefusednotconnected>redis-cliCouldnotconnecttoRedisat127.0.0.1:6379:Connectionrefusednotconnected>[root@localhostredis]#redis-cli127.0.0.1:6379>setname=wangxin(error)ERRsyntaxerror127.0.0.1:6379>setnamewangxinOK127.0.0.1:6379>setage26OK127.0.0.1:6379>getnameage(error)ERRwrongnumberofargumentsfor'get'command127.0.0.1:6379>getname"wangxin"127.0.0.1:6379>getage"26"127.0.0.1:6379>
相关文章推荐
- centos6.5上redis集群搭建,基于redis-3.0.0-beta8--安装redis并测试
- centos 6.5 安装redis 2.8.3 测试和应用
- NoSQL之Redis(一)---CentOS6.5安装Redis
- centos6.5安装redis 2.8.19 和 phpredis 扩展
- NOSQL系列-Redis精简版安装与Ruby测试
- CentOS6.5安装Redis2.8.19
- 测试安装Centos 7 和 6.5
- CentOS 6.5玩转自制Linux、远程登录及Nginx安装测试
- CentOS 6.5 下安装 Redis 2.8.7
- centos 6.5安装 redis
- Redis的安装与部署(CentOS6.5)
- CentOS 6.5 下安装 Redis 2.8.13(转)
- centos_6.5_x64 上快速编译安装redis
- 大数据之Hadoop平台(二)Centos6.5(64bit)Hadoop2.5.1伪分布式安装记录,wordcount运行测试
- CentOS6.5安装Redis2.8.19
- zabbix 一键安装,前提是mysql已安装好,且已设好密码,已在centos 6.5上做过测试
- centos6.5安装配置nginx+php+mysql+httpsqs+ttserver+redis
- ffmpeg centos6.5上安装(测试 amr 转换为 mp3)
- CentOS 6.5 下安装 Redis 2.8.7
- CentOS 6.5 下安装 Redis 2.8.7