CentOS6 安装Redis

打开Reids的官网,看看有没quick install之类的文档,一看傻眼了,啥都没有,关于安装的,只字未提。这点让我不爽,不如oracle。


解包3.0.7版本,里面有个INSTALL,嘿嘿,打开一看,呵呵--->look README.


好吧,移步README。里面好详细啊,给个赞!


首先进入解压后的目录,make 一下,make之前确定你已经安装了make,gcc,等组件。


果然报错了:

zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
    zmalloc.h:55:2: error: #error "Newer version of jemalloc required"

需要这个东西,按照以往的惯例,可以yum install 啊!网上一搜,千篇一律,在make的时候加参数:


Allocator
---------

Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.

To force compiling against libc malloc, use:

    % make MALLOC=libc

To compile against jemalloc on Mac OS X systems, use:

    % make MALLOC=jemalloc

Verbose build

看见了吗?说的很清楚了吧?我决定不用上面的参数:MALLOC=libc人家告诉你可能错误会很多,你还傻乎乎的去用吗?生产环境下坚决不用,平时也不用,养成良好习惯PS:开发者自动忽略。


这个软件可以用yum安装只是在EPEL源里。

yum install jemalloc-devel

如果你没有epel 那么先装上:yum install epel-release

这是方法1。

另外还有方法2:

进入deps  在里面  make jemalloc



--------------------------以上是错误1------------------------

错误2:

$ make
clang: error: no such file or directory: '../deps/hiredis/libhiredis.a'
clang: error: no such file or directory: '../deps/lua/src/liblua.a'
make[1]: *** [redis-server] Error 1
make: *** [all] Error 2
方法:
cd deps
make lua hiredis linenoise


---------------------------错误3-------------------------
You need tcl 8.5 or newer in order to run the Redis testmake: *** [test] Error 1
方法:
yum install  tcl


官网这么说的:http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html




好了,make test 一下,如果开始报错了,再make test一下,卧槽,错误没了。真是奇葩啊!


make  --PREFIX=/usr/lcoal/redis  install   

指定安装目录。

/usr/local/redis/bin/redis-server  /path/redis.conf

指定配置文件启动服务

默认端口6379


可以这样:nohup   /usr/local/redis/bin/redis-server  /path/redis.conf $

启动之后按照提试改改内核参数即可。

---------------------------------关于用户和密码---------------------------

http://www.2cto.com/database/201412/365757.html

你可能感兴趣的:(redis,centos,安装)