在VMware的Linux系统上安装Redis
具体过程如下:
下载,解压和编译:
$ wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz $ tar xzf redis-2.6.14.tar.gz $ cd redis-2.6.14 $ make
在执行make的时候报错,具体报错信息如下:
zmalloc.o: In function `zmalloc_used_memory': /usr/local/redis-2.6.14/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4' collect2: ld returned 1 exit status make[1]: *** [redis-server] Error 1 make[1]: Leaving directory `/usr/local/redis-2.6.14/src' make: *** [all] Error 2网上查了下资料,主要是因为我的linux是32位的,所以会报这个错,解决方案如下:
在make操作的时候加一个执行参数:make CFLAGS="-march=i686"
然后就不报错了。
附:启动并运行Redis
编译的可执行文件在src目录中,使用以下命令运行Redis:
[root@localhost redis-2.6.14]# src/redis-server启动成功后控制台打印如下信息:
[2918] 03 Jul 09:05:01.011 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf [2918] 03 Jul 09:05:01.017 * Max number of open files set to 10032 [2918] 03 Jul 09:05:01.024 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now. _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.6.14 (00000000/0) 32 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 2918 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [2918] 03 Jul 09:05:01.029 # Server started, Redis version 2.6.14 [2918] 03 Jul 09:05:01.030 # 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. [2918] 03 Jul 09:05:01.030 * The server is now ready to accept connections on port 6379我们可以使用内置的客户端来连接Redis
[root@localhost redis-2.6.14]# src/redis-cli redis 127.0.0.1:6379> set name chenzhou OK redis 127.0.0.1:6379> get name "chenzhou" redis 127.0.0.1:6379>附2:把Redis作为Linux服务开机启动
这里只提供一种最简单的方式,最好的是通过编写开机启动脚本来做。
如果要开机启动redis,我们需要把redis设置为daemon后台启动(如果不设置为后台启动,则linux启动后图形界面会卡在一个空白的页面),而redis只有1个启动参数,就是redis的配置文件路径。redis的默认配置文件redis.conf位于redis的安装目录下。我们可以把该文件copy到/etc目录下
[root@localhost redis-2.6.14]# cp redis.conf /etc/redis的默认配置文件中daemonize参数的值为no,代表为非后台启动,所以我们需要把该参数的值修改为yes。至于其它的参数在这里就不详细说了,具体可以参见:http://blog.csdn.net/htofly/article/details/7686436
修改完daemonize参数之后,redis就能够通过daemon方式启动了,那么下一步就是把redis加入到linux开机启动服务配置中了,具体步骤如下:
使用VI编辑器打开Linux开机启动服务配置文件/etc/rc.local,并在其中加入下面的一行代码:
/usr/local/redis-2.6.14/src/redis-server /etc/redis.conf编辑完后保存,然后重启系统就OK了。
停止Redis服务:
src/redis-cli shutdown
相关推荐
redis 连接报错 GET_LIKE_ERROR 处理过程.rar
陶器:人类的Redis :globe_showing_Americas: :globe_showing_Europe-Africa: :globe_showing_Asia-Australia: 很棒,但是并不总是很有趣。 陶器是一种访问Redis的Python方法。 如果您知道如何使用Python字典,那么...
cpp_redis cpp_redis是C ++ 11异步多平台轻量级Redis客户端,支持同步操作,流水线,标记和高可用性。需求cpp_redis没有依赖项。 它唯一的要求是C++11 。 它没有网络模块,因此您可以自由配置自己的模块,也可以使用...
基于acl库封装的redis client vs2010工程; 运行时解压到: redis-acl\lib_acl_cpp\samples\redis路径下,把lib_acl_vc2010d.lib、lib_acl_cpp_vc2010d.lib放到 \redis-acl\lib_acl_cpp\samples\redis\redisclient...
Redis Desktop Manager是一款好用的Redis桌面管理工具。 支持命令控制台操作,以及常用,查询key、rename、delete等操作。 支持跨平台的 Redis DB管理工具,基于Qt 5开发,支持SSL / TLS加密,SSH隧道和Cloud Redis
cpp_redis cpp_redis是C ++ 11异步多平台轻量级Redis客户端,支持同步操作,流水线,标记和高可用性。需求cpp_redis没有依赖项。 它唯一的要求是C++11 。 它没有网络模块,因此您可以自由配置自己的模块,也可以使用...
Redis,典型的NoSQL数据库服务器,和BerkeleyDB相比,它可以作为服务程序独立运行于自己的服务器主机。在很多时候,人们只是将Redis视为Key/Value数据库服务器,然而事实并非如此,在目前的版本中,Redis除了Key/...
1、redis_4.0.10-1_arm64.deb 银河麒麟v4+飞腾 安装包 2、自带服务启动 3、目录树 /opt/redis-4.0.10/ ├── bin │ ├── redis-benchmark │ ├── redis-check-aof │ ├── redis-check-rdb │ ├── ...
redis连接报错error:NOAUTH Authentication required
redis php redis扩展dll文件 版本为5.4.x ...下载后php_redis.dll,php_igbinary.pdb放到php安装目录中ext文件夹下面 并且在php.ini文件中添加extension=php_igbinary.dll extension=php_redis.dll 然后重启apache 即可
该资源合集内容包括:redis-x64-2.8,与之匹配的扩展文件php_redis.dll和php_igbinary.dll文件,使用php5.6 -ntx(亲测有效,注意文件适用都是nts的)
labview调用redis的工具包,vi很齐全,各种命令均有
netty,redis,zookeeper高-netty_redis_zookeeper_source_code
:check_mark_button: 链式缓存:按优先级顺序使用多个缓存(例如,内存然后回退到Redis共享缓存) :check_mark_button: 可加载的缓存:允许您调用回调函数以将数据放回缓存 :check_mark_button: 指标缓存,用于...
windows下的redis数据管理图形工具包含0.8和0.6
Redis实战-REDIS_IN_ACTION
redis数据库c语言源码,非常好,值得学习借鉴。
mac界面化redis管理工具Another_Redis_Desktop_Manager
wallproxy Errno 10054 解决方法
redis.jar,使用redis开发的jar包