Redis-2.8-17 installation configuration process and some errors

Source: Internet
Author: User

Redis installation process:


正常前面3步应该没有问题,主要的问题是执行make的时候,出现了异常。异常一:make[2]: cc: Command not found异常原因:没有安装gcc解决方案:yum install gcc-c++ 异常二:zmalloc.h:51:31: error: jemalloc/jemalloc.h: No such file or directory异常原因:一些编译依赖或原来编译遗留出现的问题解决方案:make distclean。清理一下,然后再make。  在make成功以后,需要make test。在make test出现异常。异常一:couldn‘t execute "tclsh8.5": no such file or directory异常原因:没有安装tcl解决方案:yum install -y tcl。设置内存分配策略(可选,根据服务器的实际情况进行设置)/proc/sys/vm/overcommit_memory可选值:0、1、2。0, 表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。1, 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。2, 表示内核允许分配超过所有物理内存和交换空间总和的内存值得注意的一点是,redis在dump数据的时候,会fork出一个子进程,理论上child进程所占用的内存和parent是一样的,比如parent占用的内存为8G,这个时候也要同样分配8G的内存给child,如果内存无法负担,往往会造成redis服务器的down机或者IO负载过高,效率下降。所以这里比较优化的内存分配策略应该设置为 1(表示内核允许分配所有的物理内存,而不管当前的内存状态如何)    vim /etc/sysconfig/iptables      -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT      service iptables restart       修改 redis/redis.conf,设置redis进程为后台守护进程:   daemonize yes 很多时候这个配置文件修改后,提到redis可能会出现问题,那么一般情况下都是redis.conf配置文件有错误造成的可以在网上找到合适的或者如下,直接复制进去,也可。redis.conf配置:    daemonize yespidfile /usr/local/redis/var/redis.pidport 6379timeout 300loglevel debuglogfile /usr/local/redis/var/redis.logdatabases 16save 900 1save 300 10save 60 10000rdbcompression yesdbfilename dump.rdbdir /usr/local/redis/var/appendonly noappendfsync alwaysglueoutputbuf yesshareobjects noshareobjectspoolsize 1024 $ redis-server   redis.conf[[email protected] redis-2.8.17]# ps -ef | grep redis  root       401 29222  0 18:06 pts/3    00:00:00 grep redis  root     29258     1  0 16:23 ?        00:00:00 redis-server /etc/redis.conf  $ redis-cliredis> set foo jiuOKredis> get foo"jiu"就这样了完成了。。。。。


This article from the "smile fish" blog, please be sure to keep this source http://smilezgy.blog.51cto.com/3308626/1568563

Redis-2.8-17 installation configuration process and some errors

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.