From 76494fd37d79ef8197bbd963ed53cadf928f83d1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Sep 2023 16:29:59 +0000 Subject: [PATCH] [redis] update predixy for Task#12003 --- redis/docker-compose.yaml | 6 ++ redis/predixy/conf/auth.conf | 8 +++ redis/predixy/conf/cluster.conf | 20 ++++++ redis/predixy/conf/latency.conf | 104 ++++++++++++++++++++++++++++++++ redis/predixy/conf/predixy.conf | 38 ++++++++++++ redis/predixy/conf/predixy.log | 75 +++++++++++++++++++++++ 6 files changed, 251 insertions(+) create mode 100644 redis/predixy/conf/auth.conf create mode 100644 redis/predixy/conf/cluster.conf create mode 100644 redis/predixy/conf/latency.conf create mode 100644 redis/predixy/conf/predixy.conf create mode 100644 redis/predixy/conf/predixy.log diff --git a/redis/docker-compose.yaml b/redis/docker-compose.yaml index 4419cfb..09504c8 100644 --- a/redis/docker-compose.yaml +++ b/redis/docker-compose.yaml @@ -1,5 +1,11 @@ version: '3' services: + predixy: + image: haandol/predixy:latest + container_name: predixy + network_mode: "host" + volumes: + - ./predixy/conf:/etc/predixy/conf redis-master: container_name: "redis-master" image: redis:7.2-alpine diff --git a/redis/predixy/conf/auth.conf b/redis/predixy/conf/auth.conf new file mode 100644 index 0000000..38ffe5c --- /dev/null +++ b/redis/predixy/conf/auth.conf @@ -0,0 +1,8 @@ +Authority { + Auth { + Mode write + } + Auth "#bccomplexpassword#" { + Mode admin + } +} diff --git a/redis/predixy/conf/cluster.conf b/redis/predixy/conf/cluster.conf new file mode 100644 index 0000000..6166a03 --- /dev/null +++ b/redis/predixy/conf/cluster.conf @@ -0,0 +1,20 @@ +## redis cluster server pool define + +ClusterServerPool { + MasterReadPriority 60 + StaticSlaveReadPriority 50 + DynamicSlaveReadPriority 50 + RefreshInterval 1 + ServerTimeout 1 + ServerFailureLimit 10 + ServerRetryTimeout 1 + KeepAlive 120 + Servers { + + 185.203.114.220:7001 + + 185.203.114.211:7001 + + 185.203.114.219:7001 + + 185.203.114.220:7101 + + 185.203.114.211:7101 + + 185.203.114.219:7101 + } +} diff --git a/redis/predixy/conf/latency.conf b/redis/predixy/conf/latency.conf new file mode 100644 index 0000000..cf6029e --- /dev/null +++ b/redis/predixy/conf/latency.conf @@ -0,0 +1,104 @@ +LatencyMonitor all { + Commands { + + all + - blpop + - brpop + - brpoplpush + } + TimeSpan { + + 100 + + 200 + + 300 + + 400 + + 500 + + 600 + + 700 + + 800 + + 900 + + 1000 + + 1200 + + 1400 + + 1600 + + 1700 + + 1800 + + 2000 + + 2500 + + 3000 + + 3500 + + 4000 + + 4500 + + 5000 + + 6000 + + 7000 + + 8000 + + 9000 + + 10000 + } +} + +LatencyMonitor get { + Commands { + + get + } + TimeSpan { + + 100 + + 200 + + 300 + + 400 + + 500 + + 600 + + 700 + + 800 + + 900 + + 1000 + } +} + +LatencyMonitor set { + Commands { + + set + + setnx + + setex + } + TimeSpan { + + 100 + + 200 + + 300 + + 400 + + 500 + + 600 + + 700 + + 800 + + 900 + + 1000 + } +} + +LatencyMonitor blist { + Commands { + + blpop + + brpop + + brpoplpush + } + TimeSpan { + + 1000 + + 2000 + + 3000 + + 4000 + + 5000 + + 6000 + + 7000 + + 8000 + + 9000 + + 10000 + + 20000 + + 30000 + + 40000 + + 50000 + + 60000 + + 70000 + + 80000 + + 90000 + + 100000 + } +} diff --git a/redis/predixy/conf/predixy.conf b/redis/predixy/conf/predixy.conf new file mode 100644 index 0000000..192080e --- /dev/null +++ b/redis/predixy/conf/predixy.conf @@ -0,0 +1,38 @@ +################################### GENERAL #################################### +## Predixy configuration file example + +## Specify a name for this predixy service +## redis command INFO can get this +Name PredixyExample + +## Default is 0.0.0.0:7617 +Bind 0.0.0.0:7300 + +## Worker threads +WorkerThreads 4 + +MaxMemory 0 + +ClientTimeout 300 + +Log /etc/predixy/conf/predixy.log + +LogVerbSample 0 +LogDebugSample 0 +LogInfoSample 10000 +LogNoticeSample 1 +LogWarnSample 1 +LogErrorSample 1 + + +################################### AUTHORITY ################################## +Include auth.conf + +################################### SERVERS #################################### +Include cluster.conf +# Include sentinel.conf +# Include try.conf + +################################### LATENCY #################################### +## Latency monitor define, see latency.conf +Include latency.conf diff --git a/redis/predixy/conf/predixy.log b/redis/predixy/conf/predixy.log new file mode 100644 index 0000000..62b2f11 --- /dev/null +++ b/redis/predixy/conf/predixy.log @@ -0,0 +1,75 @@ +2023-09-26 16:10:28.587875 N Proxy.cpp:112 predixy listen in 0.0.0.0:7300 +2023-09-26 16:10:28.588171 N Proxy.cpp:143 predixy running with Name:PredixyExample Workers:4 +2023-09-26 16:10:28.589548 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.211:7101 +2023-09-26 16:10:28.589639 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.211:7101 9 +2023-09-26 16:10:28.596954 N ClusterServerPool.cpp:174 redis cluster create new group 9a89cb0bf9e4a403bd8875fc9f783e54935b3f6b :7101@17101 myself,master - +2023-09-26 16:10:29.595047 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.220:7101 +2023-09-26 16:10:29.595190 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.220:7101 10 +2023-09-26 16:10:29.596290 N ClusterServerPool.cpp:174 redis cluster create new group 728512c4abb3e6cd7df6ec46efeace2cd24be5cc :7101@17101 myself,master - +2023-09-26 16:10:30.597794 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.219:7101 +2023-09-26 16:10:30.597900 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.219:7101 11 +2023-09-26 16:10:30.600884 N ClusterServerPool.cpp:174 redis cluster create new group a92b657d21d80ddd0b144276b6106ce6cc7b847c :7101@17101 myself,master - +2023-09-26 16:10:31.600400 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.211:7101 +2023-09-26 16:10:31.600506 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.211:7101 12 +2023-09-26 16:10:32.608599 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.220:7001 +2023-09-26 16:10:32.608770 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.220:7001 13 +2023-09-26 16:10:32.610100 N ClusterServerPool.cpp:174 redis cluster create new group 3212a757444eabeecf409fc46134e36b44f9bdf2 :7001@17001 myself,master - +2023-09-26 16:10:33.611837 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.219:7101 +2023-09-26 16:10:33.611948 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.219:7101 14 +2023-09-26 16:10:34.684681 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.219:7101 +2023-09-26 16:10:34.684783 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.219:7101 15 +2023-09-26 16:10:35.687556 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.219:7001 +2023-09-26 16:10:35.687668 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.219:7001 16 +2023-09-26 16:10:35.689825 N ClusterServerPool.cpp:174 redis cluster create new group 6a7ecdb9d5db221b39e6e168e2fa52e4f83b3252 :7001@17001 myself,master - +2023-09-26 16:10:36.690234 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.211:7001 +2023-09-26 16:10:36.690327 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.211:7001 17 +2023-09-26 16:10:36.692940 N ClusterServerPool.cpp:174 redis cluster create new group 1bed7719b0588caafc65182a5071cf3722abf131 :7001@17001 myself,master - +2023-09-26 16:10:38.695346 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.220:7101 +2023-09-26 16:10:38.695459 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.220:7101 18 +2023-09-26 16:10:40.700876 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.219:7001 +2023-09-26 16:10:40.700969 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.219:7001 19 +2023-09-26 16:10:41.703501 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.211:7101 +2023-09-26 16:10:41.703600 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.211:7101 20 +2023-09-26 16:10:44.712329 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.219:7001 +2023-09-26 16:10:44.712451 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.219:7001 21 +2023-09-26 16:10:46.717456 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.211:7101 +2023-09-26 16:10:46.717554 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.211:7101 22 +2023-09-26 16:10:49.725349 N Handler.cpp:453 h 3 create connection pool for server 185.203.114.219:7101 +2023-09-26 16:10:49.725462 N ConnectConnectionPool.cpp:42 h 3 create server connection 185.203.114.219:7101 23 +2023-09-26 16:10:50.727881 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.211:7001 +2023-09-26 16:10:50.727986 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.211:7001 24 +2023-09-26 16:10:51.730870 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.211:7001 +2023-09-26 16:10:51.730949 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.211:7001 25 +2023-09-26 16:10:52.734852 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.220:7101 +2023-09-26 16:10:52.734995 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.220:7101 26 +2023-09-26 16:10:53.737706 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.220:7001 +2023-09-26 16:10:53.737804 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.220:7001 27 +2023-09-26 16:10:54.740238 N Handler.cpp:453 h 1 create connection pool for server 185.203.114.220:7001 +2023-09-26 16:10:54.740350 N ConnectConnectionPool.cpp:42 h 1 create server connection 185.203.114.220:7001 28 +2023-09-26 16:11:09.785618 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.211:7001 +2023-09-26 16:11:09.785859 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.211:7001 29 +2023-09-26 16:11:14.798944 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.220:7101 +2023-09-26 16:11:14.799245 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.220:7101 30 +2023-09-26 16:11:20.814272 N Handler.cpp:453 h 0 create connection pool for server 185.203.114.219:7001 +2023-09-26 16:11:20.814395 N ConnectConnectionPool.cpp:42 h 0 create server connection 185.203.114.219:7001 31 +2023-09-26 16:11:31.946414 W ClusterServerPool.cpp:227 redis cluster update server 153ecac0cbbd9f5fc732fe667542ff4d60437168 185.203.114.219:7101 role unknown +2023-09-26 16:11:37.862876 N Handler.cpp:453 h 2 create connection pool for server 185.203.114.220:7001 +2023-09-26 16:11:37.862978 N ConnectConnectionPool.cpp:42 h 2 create server connection 185.203.114.220:7001 32 +2023-09-26 16:16:20.809370 N Handler.cpp:318 h 2 accept c 185.203.114.199:57448 33 +2023-09-26 16:16:20.809712 N Handler.cpp:318 h 3 accept c 185.203.114.199:57450 34 +2023-09-26 16:16:20.839201 N ConnectConnectionPool.cpp:82 h 0 create private server connection 185.203.114.211:7001 35 +2023-09-26 16:16:22.062163 N Handler.cpp:318 h 1 accept c 185.203.114.199:57460 36 +2023-09-26 16:16:22.062258 N Handler.cpp:318 h 1 accept c 185.203.114.199:57462 37 +2023-09-26 16:16:22.063781 N ConnectConnectionPool.cpp:82 h 2 create private server connection 185.203.114.220:7001 38 +2023-09-26 16:16:22.439657 N Handler.cpp:318 h 3 accept c 185.203.114.199:57470 39 +2023-09-26 16:16:22.439705 N Handler.cpp:318 h 3 accept c 185.203.114.199:57472 40 +2023-09-26 16:16:22.444573 N ConnectConnectionPool.cpp:82 h 1 create private server connection 185.203.114.220:7001 41 +2023-09-26 16:18:50.853693 N Handler.cpp:212 h 2 remove c 185.203.114.199:57462 37 with status 2 End +2023-09-26 16:18:50.853980 N Handler.cpp:276 h 2 close s 185.203.114.220:7001 38 and c None -1 with status 101 Custom +2023-09-26 16:18:50.855311 N Handler.cpp:212 h 1 remove c 185.203.114.199:57460 36 with status 2 End +2023-09-26 16:18:50.902178 N Handler.cpp:212 h 1 remove c 185.203.114.199:57472 40 with status 2 End +2023-09-26 16:18:50.902308 N Handler.cpp:276 h 1 close s 185.203.114.220:7001 41 and c None -1 with status 101 Custom +2023-09-26 16:18:50.909188 N Handler.cpp:212 h 3 remove c 185.203.114.199:57470 39 with status 2 End +2023-09-26 16:19:01.283074 N Handler.cpp:212 h 0 remove c 185.203.114.199:57448 33 with status 2 End +2023-09-26 16:19:01.283278 N Handler.cpp:212 h 0 remove c 185.203.114.199:57450 34 with status 2 End +2023-09-26 16:19:01.283331 N Handler.cpp:276 h 0 close s 185.203.114.211:7001 35 and c None -1 with status 101 Custom