linux安装redis服务器

linux安装redis服务器

官网

wget http://download.redis.io/releases/redis-2.8.17.tar.gz
tar xzf redis-2.8.17.tar.gz
cd redis-2.8.17
make
# make完后 redis-2.8.17目录下会出现编译后的redis服务程序redis-server,还有用于测试的客户端程序redis-cli,两个程序位于安装目录 src 目录下
# 启动redis服务
./src/redis-server
# 使用配置
./src/redis-server ./redis.conf

配置文件

# /src/redis.conf
# 添加,守护运行
daemonize yes
# 执行
# /home/lxx/tools/redis-2.8.17/src/redis-server redis.conf

启动报错

# WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
sudo sysctl vm.overcommit_memory=1
# Fatal error loading the DB: Invalid argument. Exiting.
# 异常退出服务器导致,删除缓存.rdb文件
rm ./src/dump.rdb

猜你喜欢

转载自blog.csdn.net/HD2killers/article/details/82865193
今日推荐