Redis安装+密码认证
redis:
安装:
$ wget http://download.redis.io/releases/redis-3.2.7.tar.gz
$ tar xzf redis-3.2.7.tar.gz
$ cd redis-3.2.7
$ make
报错:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
README.md中:
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
分配器allocator,如果有MALLOC这个环境变量,会用这个环境变量去建立redis,
而且libc并不是默认的分配器,默认的是jemalloc,但是如果没有jemalloc,而只有libc,就会make出错,所以需要添加参数.
解决:$ make MALLOC=libc
启动redis失败:
vim /usr/local/redis/etc/redis.conf
daemonize yes ---将daemonize的值修改为yes.
redis密码设置:
方法1:
vim /usr/local/redis/etc/redis.conf
requirepass kasumi 去掉本行的注释 ----重启服务
$redis-cli -h 127.0.0.1 -p 6379 -a kasumi ---使用密码登录执行成功.
方法2:
config set requirepass kasumi
修改后不需要重启服务,但是服务重启后,会使用配置文件中的密码.
最新文章
- LeetCode House Robber III
- Codeforces 271 Div 2 A	 Keyboard
- JavaScript基础--面向对象三大特性(八):继承封装多态
- Beta项目冲刺汇总贴
- Tr A(矩阵快速幂)
- 25. Reverse Nodes in k-Group
- layout相关
- Java [leetcode 22]Generate Parentheses
- Oracle中的AS和IS
- dnw for linux: Ubuntu下可用,无需编译驱动,mini2440可用
- README 语法编写
- c# 输出excel、word实例只需一行代码
- Docker - 生成镜像
- Java基础知识二次学习--第六章 常用类
- swiper拖拽之后不自动滑动问题
- Python之scrapy实例1
- 自主学习之RxSwift(一) -----Driver
- 记录未预编译文件“*.aspx”,因此不能请求该文件的几种处理办法
- python(leetcode)-66加一问题
- sqlserver 跨服务器备份表
热门文章
- 几个与特殊字符处理有关的PHP函数(过滤html js 标签)
- j2ee 项目部署指引
- Android SearchView设置与用法的那点事儿
- ZooKeeper翻译(一)
- 设置zookeeper开机自启动
- Java 异常(Java Exception)
- socket 极值数量
- 【BZOJ4818】【SDOI2017】序列计数 [矩阵乘法][DP]
- 「6月雅礼集训 2017 Day10」perm(CodeForces 698F)
- 【BZOJ】1697: [Usaco2007 Feb]Cow Sorting牛排序