欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  新闻

阿里云服务器搭建网站教程(聚合服务器搭建方法)

程序员文章站 2022-06-21 15:30:40
一. 登录阿里云服务器并安装redisdownload, extract and compile redis with:$ wget https://download.redis.io/release...

一. 登录阿里云服务器并安装redis

download, extract and compile redis with:

$ wget https://download.redis.io/releases/redis-6.2.1.tar.gz
$ tar xzf redis-6.2.1.tar.gz
$ cd redis-6.2.1
$ make

the binaries that are now compiled are available in the src directory. run redis with:

$ src/redis-server

或者执行,nohup src/redis-server & 来后台运行

you can interact with redis using the built-in client:

$ src/redis-cli
redis> set foo bar
ok
redis> get foo
"bar"

二. 在安全组规则里面添加访问规则,开启6379端口。

阿里云服务器搭建网站教程(聚合服务器搭建方法)

三. 连接redis的时候,出现
redis.exceptions.responseerror: denied redis is running in protected mode because protected mode is enabled 错误

阿里云服务器搭建网站教程(聚合服务器搭建方法)

这时,设置protected-mode no即可

阿里云服务器搭建网站教程(聚合服务器搭建方法)

最后用 another redis desktop manager输入阿里云主机和端口,即可连接redis数据库。