首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >redis|命令web化操作实现

redis|命令web化操作实现

作者头像
heidsoft
发布2020-06-06 16:46:28
5240
发布2020-06-06 16:46:28
举报

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

版本/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

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-06-04,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 云数智圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 Redis
腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档