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

Redis Agent tool Predixy installation and deployment

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Predixy

Predixy is a high-performance full-feature redis agent that supports redis-sentinel and redis-cluster

Characteristics

High performance and lightweight

Support for multithreading

Multi-platform support: Linux, OSX, BSD, Windows (Cygwin)

Redis Sentinel is supported, and one or more groups of redis can be configured

Support for Redis Cluster

Support for redis blocking commands, including blpop, brpop, brpoplpush

Scan command is supported, whether it is a single redis or multiple redis instances

Multiple key command support: mset/msetnx/mget/del/unlink/touch/exists

Multi-data libraries that support redis, that is, you can use the select command

Transactions are supported. Currently, only a single redis group under Redis Sentinel is available.

Support scripts, including commands: script load, eval, evalsha

Support publish and subscribe mechanism, that is, Pub/Sub series commands

Multi-data center support, read-write separation support

Extended AUTH command, powerful access control mechanism for read, write and management, and healthy space restriction mechanism

Logs can be sampled and output by level, and asynchronous logging prevents threads from being blocked by io

Log files can be automatically split according to time and size

Rich statistical information, including CPU, memory, request, response, etc.

Delay monitoring information. You can see the overall delay, including backend redis instance delay.

Predixy is very fast. How fast is it? Predixy is much faster than several popular redis agents (twemproxy,codis,redis-cerberus).

Compile

Predixy can be compiled on all major platforms, recommended for use under linux, and requires a compiler that supports Clover 11.

Compilation is very simple. Download or git clone code to the predixy directory and execute it directly: first, solve the compilation dependency:

Yum install libstdc++-static-y git clone https://github.com/joyieldInc/predixy.git cd predixy/$ make

After compilation, an executable file predixy is generated in the src directory

Compile the debug version:

$make debug

More compilation options:

CXX=ccompiler, which specifies the c compiler. The default is glossy compiler, which can be specified as something else, such as: CXX=clang++

EV=epoll | poll | kqueue, which specifies the asynchronous io model. By default, it is detected based on the platform

MT=false, turn off multithreading support

TS=true, which enables time-consuming analysis of function calls. This option is only used in development mode.

Some examples of compiling with parameters:

$make CXX=clang++$ make EV=poll$ make MT=false$ make debug MT=false TS=true installation

Simply copy src/predixy to the destination path

$cp src/predixy / usr/local/bin/$ mkdir-p / var/log/predixy/

The configuration of predixy is similar to redis. The meaning of specific configuration items is explained in detail in the configuration file. Please refer to the following configuration files:

Predixy.conf, the overall configuration file, references the following configuration file

Cluster.conf, when used in Redis Cluster, configure the backend redis information

Sentinel.conf, when used in Redis Sentinel, configure the backend redis information

Auth.conf, access control configuration, can define multiple authentication passwords, each password specifies read, write, administrative permissions, and defines accessible key spaces

Dc.conf, multi-data center support, can define read-write separation rules, read traffic weight distribution

Latency.conf, definition of delay monitoring rules, which can specify commands to be monitored and delay intervals

Providing so many configuration files is actually separated by function, and all configurations can be written to one file or multiple files and referenced in the main configuration file.

Run $predixy/ predixy/conf/predixy.conf

Using the default profile predixy.conf, predixy will listen on the address 0.0.0.0 redis 7617, and the backend redis will be Redis Cluster 127.0.0.1 redis 6379. In general, 127.0.0.1 6379 is not running in Redis Clusterr mode, so Predixy will have a lot of error log output. But you can still use redis-cli to connect to predixy to try it out:

$redis-cli-p 7617 info

After executing the previous command, you can see some information about predixy itself. If 127.0.0.1 predixy 6379 is running, you can try other redis commands to see how it works.

For more startup command line parameters, see help:

$src/predixy-h statistics

Like redis, predixy uses the INFO command to give statistics.

Execute the following command under the redis-cli connection:

Redis > INFO

You will see output similar to that of redis executing the INFO command, but here are the statistics for predixy.

Benchmark configuration detail documentation

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

Database

Wechat

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

12
Report