2019独角兽企业重金招聘Python工程师标准>>>

转载自我要求索网 redis3.2安装过程分享

去 redis官网  下载对应的版本。下载地址:https://redis.io/download

centos安装redis

  • 下载redis-3.2.5.tar.gz
  • 解压文件并进入解压后的目录

[root@localhost application]# tar -zvxf redis-3.2.5.tar.gz

......

[root@localhost application]# cd redis-3.2.5

  • 在解压目录运行make编译

[root@localhost redis-3.2.5]# make
cd src && make all
make[1]: Entering directory `/application/redis-3.2.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: Entering directory `/application/redis-3.2.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/application/redis-3.2.5/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS= >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -O2 -g -ggdb   -I../deps/geohash-int -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=  -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua geohash-int jemalloc)
make[2]: Entering directory `/application/redis-3.2.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd geohash-int && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-ldflags)
(echo "" > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/application/redis-3.2.5/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
make[3]: gcc:命令未找到
make[3]: *** [net.o] 错误 127
make[3]: Leaving directory `/application/redis-3.2.5/deps/hiredis'
make[2]: *** [hiredis] 错误 2
make[2]: Leaving directory `/application/redis-3.2.5/deps'
make[1]: [persist-settings] 错误 2 (忽略)
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] 错误 127
make[1]: Leaving directory `/application/redis-3.2.5/src'
make: *** [all] 错误 2

发现报错了由于我未安装gcc,下一步安装gcc

[root@localhost redis-3.2.5]# yum install gcc -y

...............

由于输出太多 省略部分输出

Installed:
gcc.x86_64 0:4.4.7-17.el6

Dependency Installed:
cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-17.el6 glibc-devel.x86_64 0:2.12-1.192.el6 glibc-headers.x86_64 0:2.12-1.192.el6 kernel-headers.x86_64 0:2.6.32-642.11.1.el6
libgomp.x86_64 0:4.4.7-17.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6

Dependency Updated:
glibc.x86_64 0:2.12-1.192.el6 glibc-common.x86_64 0:2.12-1.192.el6 libgcc.x86_64 0:4.4.7-17.el6 tzdata.noarch 0:2016j-1.el6

Complete!

安装完成之后,继续运行make,运行之后又发现了错误

[root@localhost redis-3.2.5]# make
cd src && make all
make[1]: Entering directory `/application/redis-3.2.5/src'
CC adlist.o
在包含自 adlist.c:34 的文件中:
zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录
zmalloc.h:55:2: 错误:#error "Newer version of jemalloc required"
make[1]: *** [adlist.o] 错误 1
make[1]: Leaving directory `/application/redis-3.2.5/src'
make: *** [all] 错误 2

查找资料后发现,解决这个问题只需要运行make MALLOC=libc

[root@localhost redis-3.2.5]# make MALLOC=libc
cd src && make all
make[1]: Entering directory `/application/redis-3.2.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
........................
Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/application/redis-3.2.5/src'

  • 测试安装是否成功

启动redis服务

[root@localhost redis-3.2.5]# src/redis-server
6169:C 14 Dec 20:27:27.807 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
6169:M 14 Dec 20:27:27.809 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-``    `.  `_.  ''-._           Redis 3.2.5 (00000000/0) 64 bit
.-`` .-```.  ```\/    _.,_ ''-._
(    '      ,       .-`  | `,    )     Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
|    `-._   `._    /     _.-'    |     PID: 6169
`-._    `-._  `-./  _.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |           http://redis.io
`-._    `-._`-.__.-'_.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |
`-._    `-._`-.__.-'_.-'    _.-'
`-._    `-.__.-'    _.-'
`-._        _.-'
`-.__.-'

6169:M 14 Dec 20:27:27.812 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
6169:M 14 Dec 20:27:27.812 # Server started, Redis version 3.2.5
6169:M 14 Dec 20:27:27.812 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
6169:M 14 Dec 20:27:27.812 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
6169:M 14 Dec 20:27:27.813 * The server is now ready to accept connections on port 6379

使用内置的客户端命令redis-cli进行使用:

[root@localhost redis-3.2.5]# src/redis-cli
127.0.0.1:6379> set key value
OK
127.0.0.1:6379> get key
"value"
127.0.0.1:6379>

至此,centOS安装redis成功,为了以后运行命令不必每次进入安装目录,也可以把src绝对目录加入到PATH环境变量。

windows安装redis

Redis 没有官方的Windows版本,但是微软开源技术团队(Microsoft Open Tech group)开发和维护着这个 Win64 的版本。

window发布版本列表地址

https://github.com/MSOpenTech/redis/releases

下载Redis-x64-3.2.100.msi

双击msi文件安装,点击next勾选同意协议,再点击next,选择自定义安装目录,也可以勾选上吧安装目录添加到PATH环境变量,

然后一路下一步,其中还包含有修改默认端口,设置内存最大 限制等可自定义。最后点击install安装。

打开cmd命令行进入安装目录运行redis-server.exe redis.windows.conf

C:\Program Files\Redis>redis-server.exe redis.windows.conf
_._
_.-``__ ''-._
_.-``    `.  `_.  ''-._           Redis 3.2.100 (00000000/0) 64 bit
.-`` .-```.  ```\/    _.,_ ''-._
(    '      ,       .-`  | `,    )     Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
|    `-._   `._    /     _.-'    |     PID: 4292
`-._    `-._  `-./  _.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |           http://redis.io
`-._    `-._`-.__.-'_.-'    _.-'
|`-._`-._    `-.__.-'    _.-'_.-'|
|    `-._`-._        _.-'_.-'    |
`-._    `-._`-.__.-'_.-'    _.-'
`-._    `-.__.-'    _.-'
`-._        _.-'
`-.__.-'

[4292] 26 Dec 17:28:35.496 # Server started, Redis version 3.2.100
[4292] 26 Dec 17:28:35.496 * The server is now ready to accept connections on port 6379

打开另一个cmd命令

C:\Program Files\Redis>redis-cli.exe
127.0.0.1:6379> set key value
OK
127.0.0.1:6379> get key
"value"
127.0.0.1:6379>

至此,window安装redis成功。

转载于:https://my.oschina.net/www51qiuusocom/blog/812654

redis3.2安装过程分享相关推荐

  1. VMware16安装过程分享

    VMware16安装过程分享 本次内容是参考该博客:VMware16安装过程分享,附VMware 16密钥_Jason Li808的博客-CSDN博客 本次将介绍如何安装VMware 16 官网下载链 ...

  2. Saber 2016安装过程分享

    Saber2016安装完成后,破译过程比较繁琐,结合我自身安装过程中遇到的问题分享给大家,在此仅作破译部分的分享!安装环境为win10. 我多少失败的原因是第2步骤与第19步骤的时间不一致导致. 1. ...

  3. 在linux安装java过程_挑战Java在Linux上安装过程分享

    java是一种可以撰写跨平台应用软件的面向对象的程序设计语言,之前大部分用户都是在Windows平台上进行搭建的,对于在Linux环境上进行安装也会比较陌生,可见是一种挑战,下面一起来看看豆豆系统给大 ...

  4. 模拟影像射击设备在室内靶场安装过程分享

    靶场设备在实际场地的应用较多的是自动报靶的靶机和相应的报靶系统,更多实际场地的设备更新也是如此的要求.在室内靶场中,训练项目以实弹打靶为主,所以对于打靶靶机的要求是很严格.靶机设备在室内的应用较多的则 ...

  5. proxmox ve win7/windows7安装过程分享

    1.下载 安装包最新的2.1版本, 刻盘,安装(或用virtualbox虚拟机安装也行,虚拟机选其他系统其他版本) 2.安装很简单, 网上很多教程,但是安装好后出现一个问题,用另一台电脑 访问 htt ...

  6. LayaAir Typescript安装过程详解

    最近正在学习LayaAir但是官方的Typescript安装过程太过简陋,我直接就没安装上,所以在自己摸索了半天(物理)之后,我终于在学姐的帮助下完成了安装,我又在我老爸的电脑上装了一遍,现在我将我自 ...

  7. cve-2019-2725补丁安装过程

    Weblogic反序列化远程代码执行漏洞(CVE-2019-2725)补丁安装过程分享 oracle官网给的信息如下 applprod账户把java进程都关掉,具体如下 升级jdk 备份weblogi ...

  8. as安装过程中gradle_柯赛分享:楼顶大字安装过程中需要用到哪些工具?

    经过前面一系列标识行业常识和制作工艺相关知识的分享,我们知道楼顶大字是标识行业下属的一个重要分支产品类别,也明白了楼顶大字主要制作材料是金属的,尺寸和自重都比较大,运输安装过程相对复杂,安装施工的难度 ...

  9. 域控制器安装过程中断电!与Windows Server 2008 林功能级别提升之“冬夜”分享...

    域控制器安装过程中断电!与Windows Server 2008 林功能级别提升之"冬夜"分享 记得上一次删除脱线域控制器的时间还是在11个月前,在一台老掉牙的机器上操作着那个几乎 ...

最新文章

  1. .net autofac Web Forms
  2. [HNOI 2014]画框
  3. java对象是 什么的集合_java持有对象-集合类
  4. 【过程记录】springcloud配置使用Eureka作服务发现组件并进行微服务注册
  5. 为什么要叫长虹玻璃呢_中和热测定实验中为什么温度计要放到环形玻璃棒中间?放外面可行吗?...
  6. 终于找到原因!大厂面试被拒,是你不会数据结构
  7. 数据加密技术之加密算法
  8. 为什么jar包代码与源代码不一致_Jacoco代码覆盖率工具
  9. Eclipse插件开发之拖拽功能
  10. C++“准”标准库Boost学习指南(3):Boost.Utility
  11. C4D中常用材质的创建与赋予
  12. 二维图片做出三维效果
  13. RFT API初涉——之解决RFT无法识别windows对话框的问题
  14. Photoshop CC重磅功能发布:复杂抠图也能一键搞定
  15. 0 基础 Java 自学之路(2022年最新版)
  16. 推荐系统论文阅读——Factorizing Personalized Markov Chains for Next-Basket Recommendation
  17. c语言变量按作用域范围分两种,第02天C语言(10):变量-作用域
  18. vba 窗体计时器 出现类型错误
  19. 立志 - 天行健,君子以自强不息
  20. golang im实战入门

热门文章

  1. HDOJ_ACM_超级楼梯
  2. 对计算机科学技术的看法
  3. jrtplib 分包处理
  4. F5配置irule,使其系统在X个时间段提供服务,其余时间显示维护页面
  5. list、dict、tuple的一些小操作总结
  6. 【C语言】12-指向一维数组元素的指针
  7. [深入浅出Cocoa]详解键值观察(KVO)及其实现机理
  8. C#异步编程模式IAsyncResult概述
  9. linux与windos 设置 tomcat 内存
  10. golang多核的使用