资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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

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

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

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

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

集群代理采用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

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

配置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

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

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

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

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

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

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


文章标题:redis如何用命令web化操作实现
网页链接:http://cdkjz.cn/article/joigog.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220