>> /etc/sysctl.conf
devtoolset-8 bash
redis-6.0.10
"vm.overcommit_memory=1"
.zip
/redis/bin/redis-cli -h 127.0.0.1 -p 6379
/redis/bin/redis-server /usr/
/redis/conf/
/redis/conf/redis.conf
/redis/conf
/redis
/usr/
/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379
/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ```
/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf
/usr/local/redis
0.0.0.0
3
4
5
7
8
9
D:\Redis
Linux编译报错 若提示内存分配错误,需修改系统参数: bash echo "vm.overcommit_memory=1" >> /etc/sysctl.conf sysctl -p ``` ```[3]()
Linux编译报错
PONG
Redis下载安装教程
Windows服务启动失败 确保配置文件路径正确,或手动redis.windows.conf 到令提示符默认目录。 6379端口是否被占用7。 Linux编译报错 若提示内存分配错误,需修改系统参数: bash echo "vm.overcommit_memory=1" >> /etc/sysctl.conf sysctl -p ``` ```[3]() 远程连接限制 修改redis.conf 中的bind参数为服务器IP或0.0.0.0,并配置防火墙开放6379端口4。
Windows服务启动失败 确保配置文件路径正确,或手动redis.windows.conf 到令提示符默认目录。 6379端口是否被占用7。
Windows服务启动失败
]()。
``` ```
``` ```[2]()
``` ```[3]()
``` ```[4]()[11]()
``` ```[6]()
``` ```[6]()[11]()
bash /usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
bash /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ```
bash echo "vm.overcommit_memory=1" >> /etc/sysctl.conf sysctl -p ``` ```[3]()
bash make make install PREFIX=/usr/local/redis ``` ```
bash mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]()
bash ps -ef | grep redis netstat -an | grep 6379 ``` ```
bash redis-cli.exe -h 127.0.0.1 -p 6379 ``` ```
bash redis-server --service-install redis.windows.conf redis-server --service-start
bash redis-server.exe redis.windows.conf ``` ```
bash sudo yum install centos-release-scl sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash ``` ```[2]()
bash wget https://download.redis.io/releases/redis-6.0.10.tar.gz tar -zxvf redis-6.0.10.tar.gz cd redis-6.0.10 ``` ```[4]()[11]()
bash
bash
bind 127.0.0.1
bind
cd redis-6.0.10
cd
conf requirepass yourpassword ``` ``` 重启服务后,客户端需通过`AUTH yourpassword`令验证[5]()。
conf
conf
cp redis.conf /usr/
cp redis.conf /usr/local/redis/conf/
daemonize no
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf sysctl -p ``` ```[3]()
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
echo
enable
local
make make install PREFIX=/usr/local/redis ``` ```
make install PREFIX=/usr/
make install PREFIX=/usr/local/redis
make
mkdir /usr/
mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]()
mkdir /usr/local/redis/conf
netstat -an | grep 6379
ng
protected-mode no
ps -ef | grep redis netstat -an | grep 6379 ``` ```
ps -ef | grep redis
redis-6.0.10.tar.gz
redis-cli.exe -h 127.0.0.1 -p 6379 ``` ```
redis-cli.exe -h 127.0.0.1 -p 6379
redis-cli.exe
redis-server --service-install redis.windows.conf redis-server --service-start
redis-server --service-install redis.windows.conf
redis-server --service-start
redis-server.exe redis.windows.conf ``` ```
redis-server.exe redis.windows.conf
redis-server.exe
redis.conf
redis.windows.conf
requirepass yourpassword ``` ``` 重启服务后,客户端需通过`AUTH yourpassword`令验证[5]()。
requirepass yourpassword
requirepass
scl
scl enable devtoolset-8 bash
sudo yum install centos-release-scl sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash ``` ```[2]()
sudo yum install centos-release-scl
sudo yum install devtoolset-8-gcc*
sysctl -p
tar -zxvf redis-6.0.10.tar.gz
wget https://download.redis.io/releases/redis-6.0.10.tar.gz tar -zxvf redis-6.0.10.tar.gz cd redis-6.0.10 ``` ```[4]()[11]()
wget https://download.redis.io/releases/redis-6.0.10.tar.gz
yes
一、Windows系统安装
三、常见问题处理
下载与解压 从Redis中文网或GitHub下载源码包(如redis-6.0.10.tar.gz ),执行解压: bash wget https://download.redis.io/releases/redis-6.0.10.tar.gz tar -zxvf redis-6.0.10.tar.gz cd redis-6.0.10 ``` ```[4]()[11]()
下载与解压
二、Linux系统安装
从Redis中文网或GitHub下载源码包(如redis-6.0.10.tar.gz ),执行解压: bash wget https://download.redis.io/releases/redis-6.0.10.tar.gz tar -zxvf redis-6.0.10.tar.gz cd redis-6.0.10 ``` ```[4]()[11]()
修改redis.conf 中的bind参数为服务器IP或0.0.0.0,并配置防火墙开放6379端口4。
创建配置目录并配置文件: bash mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]()
后台运行
后台运行:修改redis.conf 中的daemonize no为yes。 远程访问:注释bind 127.0.0.1,关闭保护模式(protected-mode no)。 密码设置:添加requirepass yourpassword43。
后台运行:修改redis.conf 中的daemonize no为yes。
启动与验证 启动服务端: bash /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ``` 进程与端口: bash ps -ef | grep redis netstat -an | grep 6379 ``` ``` 客户端连接测试: bash /usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
启动与验证
启动服务端: bash /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ``` 进程与端口: bash ps -ef | grep redis netstat -an | grep 6379 ``` ``` 客户端连接测试: bash /usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
启动服务端: bash /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ```
安装GCC编译器(Redis 6.0+需GCC 5.0以上): bash sudo yum install centos-release-scl sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash ``` ```[2]()
客户端连接与验证 新开令窗口,进入Redis目录,运行客户端连接令: bash redis-cli.exe -h 127.0.0.1 -p 6379 ``` ``` 输入ng若返回PONG,表示连接成功9。
客户端连接与验证
客户端连接测试: bash /usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
密码设置
密码设置:添加requirepass yourpassword43。
密码配置(可选) 修改redis.windows.conf 文件,找到requirepass参数,设置密码: conf requirepass yourpassword ``` ``` 重启服务后,客户端需通过`AUTH yourpassword`令验证[5]()。
密码配置(可选) 修改redis.windows.conf 文件,找到requirepass参数,设置密码:
密码配置(可选)
打开令提示符,进入Redis目录,执行以下令启动服务端: bash redis-server.exe redis.windows.conf ``` ```
新开令窗口,进入Redis目录,运行客户端连接令: bash redis-cli.exe -h 127.0.0.1 -p 6379 ``` ``` 输入ng若返回PONG,表示连接成功9。
新开令窗口,进入Redis目录,运行客户端连接令: bash redis-cli.exe -h 127.0.0.1 -p 6379 ``` ```
6379端口是否被占用7。
进程与端口: bash ps -ef | grep redis netstat -an | grep 6379 ``` ```
环境准备 安装GCC编译器(Redis 6.0+需GCC 5.0以上): bash sudo yum install centos-release-scl sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash ``` ```[2]() 下载与解压 从Redis中文网或GitHub下载源码包(如redis-6.0.10.tar.gz ),执行解压: bash wget https://download.redis.io/releases/redis-6.0.10.tar.gz tar -zxvf redis-6.0.10.tar.gz cd redis-6.0.10 ``` ```[4]()[11]() 编译与安装 编译源码并指定安装路径(默认/usr/local/redis): bash make make install PREFIX=/usr/local/redis ``` ``` 创建配置目录并配置文件: bash mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]() 配置调整 后台运行:修改redis.conf 中的daemonize no为yes。 远程访问:注释bind 127.0.0.1,关闭保护模式(protected-mode no)。 密码设置:添加requirepass yourpassword43。 启动与验证 启动服务端: bash /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf ``` ``` 进程与端口: bash ps -ef | grep redis netstat -an | grep 6379 ``` ``` 客户端连接测试: bash /usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 ``` ```[6]()[11]()
环境准备 安装GCC编译器(Redis 6.0+需GCC 5.0以上): bash sudo yum install centos-release-scl sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash ``` ```[2]()
环境准备
确保配置文件路径正确,或手动redis.windows.conf 到令提示符默认目录。 6379端口是否被占用7。
确保配置文件路径正确,或手动redis.windows.conf 到令提示符默认目录。
编译与安装 编译源码并指定安装路径(默认/usr/local/redis): bash make make install PREFIX=/usr/local/redis ``` ``` 创建配置目录并配置文件: bash mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]()
编译与安装
编译源码并指定安装路径(默认/usr/local/redis): bash make make install PREFIX=/usr/local/redis ``` ``` 创建配置目录并配置文件: bash mkdir /usr/local/redis/conf cp redis.conf /usr/local/redis/conf/ ``` ```[6]()
编译源码并指定安装路径(默认/usr/local/redis): bash make make install PREFIX=/usr/local/redis ``` ```
若提示内存分配错误,需修改系统参数: bash echo "vm.overcommit_memory=1" >> /etc/sysctl.conf sysctl -p ``` ```[3]()
若需后台运行,可通过安装Windows服务实现: bash redis-server --service-install redis.windows.conf redis-server --service-start
获取安装包 从Redis官网或第三方平台获取Windows版本安装包(通常为.zip格式),包含redis-server.exe (服务端)和redis-cli.exe (客户端)等心文件78。 解压与启动服务 解压文件到指定目录(如D:\Redis)。 打开令提示符,进入Redis目录,执行以下令启动服务端: bash redis-server.exe redis.windows.conf ``` ``` 若需后台运行,可通过安装Windows服务实现: bash redis-server --service-install redis.windows.conf redis-server --service-start 客户端连接与验证 新开令窗口,进入Redis目录,运行客户端连接令: bash redis-cli.exe -h 127.0.0.1 -p 6379 ``` ``` 输入ng若返回PONG,表示连接成功9。 密码配置(可选) 修改redis.windows.conf 文件,找到requirepass参数,设置密码: conf requirepass yourpassword ``` ``` 重启服务后,客户端需通过`AUTH yourpassword`令验证[5]()。
获取安装包 从Redis官网或第三方平台获取Windows版本安装包(通常为.zip格式),包含redis-server.exe (服务端)和redis-cli.exe (客户端)等心文件78。
获取安装包
解压与启动服务 解压文件到指定目录(如D:\Redis)。 打开令提示符,进入Redis目录,执行以下令启动服务端: bash redis-server.exe redis.windows.conf ``` ``` 若需后台运行,可通过安装Windows服务实现: bash redis-server --service-install redis.windows.conf redis-server --service-start
解压与启动服务
解压文件到指定目录(如D:\Redis)。 打开令提示符,进入Redis目录,执行以下令启动服务端: bash redis-server.exe redis.windows.conf ``` ``` 若需后台运行,可通过安装Windows服务实现: bash redis-server --service-install redis.windows.conf redis-server --service-start
解压文件到指定目录(如D:\Redis)。
输入ng若返回PONG,表示连接成功9。
远程访问
远程访问:注释bind 127.0.0.1,关闭保护模式(protected-mode no)。
远程连接限制 修改redis.conf 中的bind参数为服务器IP或0.0.0.0,并配置防火墙开放6379端口4。
远程连接限制
通过以上步骤,可完成Windows与Linux系统下的Redis基础部署。实际使用中需根据业务需求调整持久化策略、集群配置等高级参数。
配置调整 后台运行:修改redis.conf 中的daemonize no为yes。 远程访问:注释bind 127.0.0.1,关闭保护模式(protected-mode no)。 密码设置:添加requirepass yourpassword43。
配置调整
重启服务后,客户端需通过`AUTH yourpassword`令验证[5]()。
重启服务后,客户端需通过`AUTH yourpassword`令验证[
相关问答
还木有评论哦,快来抢沙发吧~