日期:2014-05-16  浏览次数:20784 次

Redis安装整理(window平台和Linux平台)
window平台Redis安装

redis windows安装文件下载地址
:http://code.google.com/p/servicestack/wiki/RedisWindowsDownload#Download_32bit_Cygwin_builds_for_Windows
我选择的redis为最新版的安装文件,见下图:

redis-server.exe:服务程序
redis-check-dump.exe:本地数据库检查
redis-check-aof.exe:更新日志检查
redis-benchmark.exe:性能测试,用以模拟同时由N个客户端发送M个 SETs/GETs 查询 (类似于 Apache 的ab 工具).

在解压好redis的安装文件到E:\根目录后,还需要在redis根目录增加一个redis的配置文件redis.conf,文件具体内容附件中有,不过这里我仍然把配置文件的内容贴上来:
Java代码 收藏代码
  1. #Redisconfigurationfileexample
  2. #BydefaultRedisdoesnotrunasadaemon.Use'yes'ifyouneedit.
  3. #NotethatRediswillwriteapidfilein/var/run/redis.pidwhendaemonized.
  4. daemonizeno
  5. #Whenrunasadaemon,Rediswriteapidfilein/var/run/redis.pidbydefault.
  6. #Youcanspecifyacustompidfilelocationhere.
  7. pidfile/var/run/redis.pid
  8. #Acceptconnectionsonthespecifiedport,defaultis6379
  9. port6379
  10. #Ifyouwantyoucanbindasingleinterface,ifthebindoptionisnot
  11. #specifiedalltheinterfaceswilllistenforconnections.
  12. #
  13. #bind127.0.0.1
  14. #ClosetheconnectionafteraclientisidleforNseconds(0todisable)
  15. timeout300
  16. #Setserververbosityto'debug'
  17. #itcanbeoneof:
  18. #debug(alotofinformation,usefulfordevelopment/testing)
  19. #notice(moderatelyverbose,whatyouwantinproductionprobably)
  20. #warning(onlyveryimportant/criticalmessagesarelogged)
  21. logleveldebug
  22. #Specifythelogfilename.Also'stdout'canbeusedtoforce
  23. #thedemontologonthestandardoutput.Notethatifyouusestandard
  24. #outputforloggingbutdaemonize,logswillbesentto/dev/null
  25. logfilestdout
  26. #Setthenumberofdatabases.ThedefaultdatabaseisDB0,youcanselect
  27. #adifferentoneonaper-connectionbasisusingSELECT<dbid>where
  28. #dbidisanumberbetween0and'databases'-1
  29. databases16
  30. ################################SNAPSHOTTING#################################
  31. #
  32. #SavetheDBondisk:
  33. #
  34. #save<seconds><changes>
  35. #
  36. #WillsavetheDB