Ubuntu安装redis6
安装gcc环境
sudo apt install build-essential
所有版本下载地址
https://download.redis.io/releases
https://download.redis.io/releases/redis-6.2.1.tar.gz
安装redis
root@arbor-virtual-machine:/home/arbor# wget http://download.redis.io/releases/redis-6.2.1.tar.gz
root@arbor-virtual-machine:/home/arbor# tar -zxvf redis-6.2.1.tar.gz
root@arbor-virtual-machine:/home/arbor# sudo mkdir -p /usr/local/redis/
root@arbor-virtual-machine:/home/arbor# sudo cp -r redis-6.2.1/* /usr/local/redis/
root@arbor-virtual-machine:/home/arbor# cd /usr/local/redis/
root@arbor-virtual-machine:/usr/local/redis# ls
00-RELEASENOTES COPYING MANIFESTO runtest-cluster src
BUGS deps README.md runtest-moduleapi tests
CONDUCT INSTALL redis.conf runtest-sentinel TLS.md
CONTRIBUTING Makefile runtest sentinel.conf utils
root@arbor-virtual-machine:/usr/local/redis#
root@arbor-virtual-machine:/usr/local/redis# sudo apt install build-essential
......
......
root@arbor-virtual-machine:/usr/local/redis# gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@arbor-virtual-machine:/usr/local/bin# sudo make
启动redis服务
root@arbor-virtual-machine:/usr/local/bin# redis-server /usr/local/redis/redis.conf
root@arbor-virtual-machine:/usr/local/bin# redis-cli -p 6379
127.0.0.1:6379>
关闭redis服务
redis-cli -h 127.0.0.1 -p 6379 shutdown
远程连接
sudo vi /etc/redis/redis.conf
将 bind 127.0.0.1 ::1 改为 bind 0.0.0.0
sudo service redis restart # 重启