澳门新蒲京娱乐


配置及命令简介【澳门新蒲京娱乐】
澳门新蒲京娱乐 1
nfs网络共享服务基础,nfs网络共享基础

Centos 陆.玖 安装 Redis 三.二.九

重命名redis
mv redis-3.2.9 /usr/local/redis

ps -ef|grep 6379    

编译(make)时:

依赖包和常用包
yum install gcc gcc-c++ make zlib-devel readline readline-devel tkutil
tk tkutil-devel tk-devel openssl openssl-devel wget vim ntp -y

———————————————————————————————————————————————————————————————————————————————

  1. 安装编译后的文件:make
    install,redis可执行文件将被复制到/usr/local/bin/,但没有配置,手动复制配置:cp
    redis.conf /usr/local/bin

  2. 设置Redis密码,编辑刚刚复制的配置文件:vi
    redis.conf,解除requirepass参数的注释,并设置值,例如:requirepass
    ljx520

  3. 使用配置文件启动Redis数据库:./redis-server redis.conf

(2)若出现如下提示,则将make改为make
MALLOC=libc,推测是因为编译库的问题。

如果看到如下的界面,那么恭喜你,Redis已安装成功

端口状态查看

[root@localhost redis-2.8.17]# make
cd src && make all
make[1]: Entering directory `/root/redis-2.8.17/src‘
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/root/redis-2.8.17/src‘
make: *** [all] Error 2

创建端口
cd /usr/local/redis/utils

redis-cli -h ip -p 6379

sh ./install_server.sh 
6379
一直Enter

测试

(1)若出现如下提示,则说明未安装gcc,使用命令安装gcc:yum install gcc

redis 开机自启动(3.2.9默认默认有启动脚本/etc/init.d)
chkconfig –add redis_6379 
chkconfig redis_6379  on

编译安装redis
cd /usr/local/redis

[root@localhost redis-2.8.17]# make
cd src && make all
make[1]: Entering directory `/root/redis-2.8.17/src‘
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/redis-2.8.17/src‘
make: *** [all] Error 2

下载redis
wget

make & make install

netstat -lntp | grep 6379

解压redis 
tar -zxvf  redis-3.2.9.tar.gz

图片 1

修改连接IP
vi /etc/redis
62 bind IP

 

redis 目录结构
/usr/local/redis
/etc/redis
/var/lib/redis

相关文章

No Comments, Be The First!
近期评论
    功能
    网站地图xml地图