cd /usr/local/
mkdir redis
cd redis
wget https://download.redis.io/releases/redis-6.2.2.tar.gz
tar xzf redis-6.2.2.tar.gz
#解压cd redis-6.2.2
make
cd src
make install
cd /usr/local/redis/redis-6.2.2/
vi redis.conf
- 修改
port 6379
为port 3300
bind 127.0.0.1 -::1
注释可以外网连接 #bind 127.0.0.1 -::1
daemonize no
设置后台运行 daemonize yes
protected-mode yes
的是为了解决安全模式引起的报错 protected-mode no
#requirepass foobared
- 电脑键盘按esc 输入
:wq!
cp redis.conf /etc/redis/3300.conf
复制到/etc/redis命名为3300.conf
- 开启redis
/usr/local/redis/redis-6.2.2/src/redis-server /etc/redis/3300.con