千家信息网

redis如何用命令web化操作实现

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章给大家介绍redis如何用命令web化操作实现,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。单机场景不考虑,以下以集群场景进行测试版本/root/redis-6.0.4/
千家信息网最后更新 2026年11月01日redis如何用命令web化操作实现

这篇文章给大家介绍redis如何用命令web化操作实现,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

单机场景不考虑,以下以集群场景进行测试

版本/root/redis-6.0.4/src

/root/redis-6.0.4 编译安装需要采用较高版本gcc

操作系统centos7

[root@localhost src]# cat /etc/redhat-release

CentOS Linux release 7.7.1908 (Core)

编译问题参考:https://www.cnblogs.com/sanduzxcvbnm/p/12955145.html

yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

[root@localhost redis-6.0.4]# cat cluster/redis6001.conf

port 6001

cluster-enabled yes

cluster-config-file nodes6001.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]# cat redis6002.conf

cat: redis6002.conf: 没有那个文件或目录

[root@localhost redis-6.0.4]# cat cluster/redis6002.conf

port 6002

cluster-enabled yes

cluster-config-file nodes6002.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]# cat cluster/redis6003.conf

port 6003

cluster-enabled yes

cluster-config-file nodes6003.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]# cat cluster/redis6004.conf

port 6004

cluster-enabled yes

cluster-config-file nodes6004.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]# cat cluster/redis6005.conf

port 6005

cluster-enabled yes

cluster-config-file nodes6005.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]# cat cluster/redis6006.conf

port 6006

cluster-enabled yes

cluster-config-file nodes6006.conf

cluster-node-timeout 5000

appendonly yes

[root@localhost redis-6.0.4]#

创建集群

src/redis-cli --cluster create 127.0.0.1:6001 127.0.0.1:6002 127.0.0.1:6003 127.0.0.1:6004 127.0.0.1:6005 127.0.0.1:6006 --cluster-replicas 1

集群代理采用redis6 自己到工具:https://github.com/RedisLabs/redis-cluster-proxy

代理启动方式:

./redis-cluster-proxy 127.0.0.1:6001 127.0.0.1:6002 127.0.0.1:6003 127.0.0.1:6004 127.0.0.1:6005 127.0.0.1:6006 &

代理启动后默认端口是7777

配置webdis

[root@localhost webdis]# cat webdis.json

{

"redis_host": "127.0.0.1",

"redis_port": 7777,

"redis_auth": null,

"http_host": "0.0.0.0",

"http_port": 7379,

"threads": 5,

"pool_size": 20,

"daemonize": false,

"websockets": false,

"database": 0,

"acl": [

{

"disabled": ["DEBUG"]

},

{

"http_basic_auth": "user:password",

"enabled": ["DEBUG"]

}

],

"verbosity": 6,

"logfile": "webdis.log"

}

[root@localhost webdis]#

启动运行./webdis

命令测试

curl -v http://localhost:7379/GET/books

curl -v http://localhost:7379/DEL/books

curl -v http://localhost:7379/SET/books/java

关于redis如何用命令web化操作实现就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

命令 集群 代理 内容 场景 更多 版本 参考 帮助 测试 编译 不错 操作系统 兴趣 单机 小伙 小伙伴 工具 文件 文章 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技有限公司 南京欣网互联网络科技 互联网科技园 重生之互联网科技帝国 杭州互联网科技公司 互联网 新科技 上海亿帐通互联网科技 博兴的互联网电子科技公司 中盈科技互联网信息有限公司 移动互联网科技公司 移动互联网年度科技创新 允成互联网科技有限公司融资 徐州市互联网科技有限公司 恒生互联网科技业指数调整周期 区块链结合互联网科技 浙南科技城互联网大厦招聘 西安左小互联网科技有限公司 科技互联网经济论坛 10位科技互联网大佬 河南商务圈互联网科技有限公司 互联网科技工作委员会毛军 互联网品科技 互联网最新的科技有限公司 壹账通互联网科技 互联网科技公司介绍 成都仁贤领冠互联网科技有限公司 重庆互联网医院沙龙医盟信息科技 崇明区互联网教育科技售后服务 从那以后互联网科技有限公司 互联网科技包装股
0