【centos】redis5.0.3安装以及设置端口和密码登陆

本文详细介绍了Redis数据库的安装步骤,包括下载、解压、编译安装,以及如何配置开机自启动、设置内存限制、更改默认端口和密码认证。同时,提供了设置自定义端口和密码认证的具体操作指南。

1.下载源:

wget http://download.redis.io/releases/redis-5.0.3.tar.gz

2.解压、安装:

tar -zxvf redis-5.0.3.tar.gz
cd redis-5.0.3/
make
make install PREFIX=/usr/local/redis

3.设置配置文件:

    修改开机自启动,修改内存占用大小:vim中输入 /xxx 即可从文件开始查找到匹配的xxx,按n到下一个,按N到上一个

#将源配置文件redis.conf拷贝到安装目录下:
cp ./redis.conf /usr/local/redis/bin/

#修改为开机自启动
vi /usr/local/redis/bin/redis.conf
#用vim打开/usr/local/redis/bin/redis.conf,查找daemonized配置位置
#将daemonize no 改成 yes

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0

# TCP keepalive.
#
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
# of communication. This is useful for two reasons:
#
# 1) Detect dead peers.
# 2) Take the connection alive from the point of view of network
#    equipment in the middle.
#
# On Linux, the specified value (in seconds) is the period used to send ACKs.
# Note that to close the connection the double of the time is needed.
# On other kernels the period depends on the kernel configuration.
#
# A reasonable value for this option is 300 seconds, which is the new
# Redis de
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值