阿里云服务器搭建网站教程(聚合服务器搭建方法)
程序员文章站
2022-03-12 11:36:06
一. 登录阿里云服务器并安装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数据库。