Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement redis with command webization operation

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to use the command webization operation to achieve redis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The stand-alone scenario is not considered. The following is tested in a cluster scenario.

Version / root/redis-6.0.4/src

/ root/redis-6.0.4 compilation and installation requires a higher version of gcc

Operating system centos7

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

CentOS Linux release 7.7.1908 (Core)

Compilation problems reference: 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: there is no such file or directory

[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] #

Create a cluster

Src/redis-cli-- cluster create 127.0.0.1 cluster-replicas 6001 127.0.1 cluster-replicas 1

Cluster agent uses redis6 self-to-tool: https://github.com/RedisLabs/redis-cluster-proxy

Agent startup method:

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

After the agent starts, the default port is 7777

Configure 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] #

Start running. / webdis

Command test

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

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

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

On how to use the command web operation redis to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report