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

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

被折叠的 条评论
为什么被折叠?



