Redis安装步骤
来源:互联网 发布:淘宝网伴娘礼服 编辑:程序博客网 时间:2024/05/01 15:27
本文详细介绍Redis的安装步骤。
安装环境
操作系统: Centos 6.4 ( cat /etc/redhat-release)
Redis: 3.0.7
下载编译
从Redis官网下载:
wget http://download.redis.io/releases/redis-3.0.7.tar.gz
解压:
tar -zxvf redis-3.0.7.tar.gzcd redis-3.0.7
编译:
make
如果出现找不到gcc编译器错误
yum install -y gcc
编译过程出错,找到redis README中的说明:
Allocator
Selecting a non-default memory allocator when building Redis is done by setting theMALLOC
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 mallocTo force compiling against libc malloc, use:
% make MALLOC=libc
To compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc
因此,由于找不到jemalloc导致出错,make的时候指定MALLOC为libc
make MALLOC=libc
做个链接:
ln -s redis-3.0.7/src/ bin
启动使用
启动redis
nohup bin/redis-server > log.out &
启动交互客户端:
bin/redis-cli
info命令查看redis的一些基本信息:
试用命令:
set命令设置值,get获取值:
详细命令参考:http://redis.io/commands
Redis配置
从redis发行包目录下拷贝一份默认的redis配置到/etc目录下:
cp redis-3.0.7/redis.conf /etc/redis/
启动的时候指定配置文件:
redis-server /etc/redis/redis.conf
设置密码:
requirepass youpassword
配置数据保存路径:
dir /opt/data/redis/
停止redis:
在客户端命令行:
shutdown
使用自定义配置重启:
nohup bin/redis-server /etc/redis/redis.conf >> log/redis.out &cat log/redis.out
此时使用redis-cli登录客户端之后,需要首先授权:
127.0.0.1:6279> auth youpassword
在客户端调用save命令后,数据将被保存在/opt/data/redis/dump.rdb
127.0.0.1:6279> save
- redis安装步骤
- redis安装步骤
- redis安装步骤
- 【转载】redis安装步骤
- Redis安装步骤
- Redis安装步骤
- Redis(1)安装步骤
- windows下安装redis步骤
- php redis扩展安装步骤
- mac安装redis详细步骤
- redis集群安装详细步骤
- Linux[Centos] Redis安装步骤
- windows下安装Redis步骤
- Redis 3.0 Windows 安装步骤
- linux下redis安装步骤
- Redis 集群安装详细步骤
- Ubuntu 安装Redis的步骤
- redis python-redis 安装详细步骤
- 哈希学习(2)—— Hashing图像检索资源
- MySQL读书笔记-事务,隔离级别,死锁
- Java基础入门-关键字、数据类型相关知识
- poj 3974 manacher
- BZOJ 2440: [中山市选2011]完全平方数
- Redis安装步骤
- php7.10
- spring 注解
- 剑指offer--16.反转链表
- .net 服务器控件实现文件上传
- 开发工具:AS如何正确导入下载的开源项目
- uva 11181 DFS+概率计算
- 小谈网络游戏同步
- redhat/centos 搭建svn服务器环境