redis-sentinel | PHP 5.3 redis-sentinel client | Command Line Interface library

 by   huyanping PHP Version: 0.3.1 License: No License

kandi X-RAY | redis-sentinel Summary

kandi X-RAY | redis-sentinel Summary

redis-sentinel is a PHP library typically used in Utilities, Command Line Interface applications. redis-sentinel has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

PHP 5.3+ redis-sentinel client for php based on phpredis extension.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              redis-sentinel has a low active ecosystem.
              It has 50 star(s) with 16 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 1 have been closed. On average issues are closed in 8 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of redis-sentinel is 0.3.1

            kandi-Quality Quality

              redis-sentinel has 0 bugs and 0 code smells.

            kandi-Security Security

              redis-sentinel has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              redis-sentinel code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              redis-sentinel does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              redis-sentinel releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              redis-sentinel saves you 120 person hours of effort in developing the same functionality from scratch.
              It has 302 lines of code, 33 functions and 9 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed redis-sentinel and discovered the below as its top functions. This is intended to give you an instant insight into redis-sentinel implemented functionality, and help decide if they suit your requirements.
            • Parse array result
            • Connects to sentinel
            • get redis instance
            • Connect to redis server
            • Get master address by master name
            • Flush all configs
            • Ping redis server
            • Get the current sentinel .
            Get all kandi verified functions for this library.

            redis-sentinel Key Features

            No Key Features are available at this moment for redis-sentinel.

            redis-sentinel Examples and Code Snippets

            redis-sentinel,examples
            PHPdot img1Lines of Code : 19dot img1no licencesLicense : No License
            copy iconCopy
            $sentinel = new \Jenner\RedisSentinel\Sentinel();
            $sentinel->connect('127.0.0.1', 6379);
            $address = $sentinel->getMasterAddrByName('mymaster');
            
            $redis = new Redis();
            $redis->connect($address['ip'], $address['port']);
            $info = $redis->info  

            Community Discussions

            QUESTION

            format json output jq
            Asked 2021-Apr-16 at 19:19

            I'm deploying redis-commander in Kubernetes. I'm creating a configuration connection file for Redis-Commander. I have a command in my bash script to get the required parameters for the connection file as per the link. Managed to connect locally between redis-commander and 1 redis server via sentinel just fine but have many more in non-prod so I need to configure the command below to get desired json output.

            This command

            ...

            ANSWER

            Answered 2021-Apr-16 at 19:19

            Using map with .items is probably a better way to go, along the lines of:

            Source https://stackoverflow.com/questions/67124379

            QUESTION

            Redis sentinel failover
            Asked 2020-Nov-16 at 13:22

            I created a learning project using Spring Data Redis, bitnami/redis and bitnami/redis-sentinel images. The Docker Compose file is here. The deployment command is docker-compose -f redis-sentinel.yaml up --scale redis-sentinel=3 --scale redis-replica=2 -d, so the Redis configuration is as follows:

            After bringing everything up, I stop the master container with docker stop redis-master. After 10 seconds, the sentinels failover to one of the replicas. So far so good. However, nothing is shown in the container console logs for the following very important things:

            1. master down has been detected.
            2. Failover has been initiated.
            3. Failover has successfully completed.

            I was expecting the sentinel to log the aspects indicated above.

            Also, when I run sentinel masters command from the Redis CLI of one of the sentinels, I see no difference in the number of replica before and after failover. I was expecting to see the number drop by 1 when the master is shut down.

            ...

            ANSWER

            Answered 2020-Nov-16 at 13:22

            Please ensure 1. Sentinel Logs are enabled 2. Make sure you are looking at sentinel logs and not master/slave logs. You can find the sentinel.conf file, which has the log file path defined in it .. the default value is logfile "", which logs to standard output.

            Source https://stackoverflow.com/questions/64853596

            QUESTION

            Mark standalone redis as read-only
            Asked 2020-Sep-21 at 09:31

            I want to mark a standalone Redis server (not a Redis-Cluster, not a Redis-Sentinel) as read-only. I have been googling for this for quite sometime but I don't seem to find a definite answer (Almost all answers point to Clustering or Sentinel). I was looking out for some config modification (CONFIG SET something).

            NOTE: config set replica-read-only yes does not make the current redis-server read-only, but only its replicas.

            My use-case basically is I am doing a migration wherein at some point I want to make the redis-server read-only. My application code can handle failures whenever a write call happens so that's not an issue.

            Also, if this is not directly possible from redis server, is there something that I can do in the client code that'll have the same effect (I am using redis-py as the client library)? (Although this is less than ideal)

            Things that I've tried
            • Played around with config set replica-read-only yes and other configs. They don't seem to be applying the current redis-server.
            • Tried marking a redis-server as a replica of itself (This was illogical, but just wanted to see if this worked), but turns out it deleted all keys in my local redis, so not something I can do.
            ...

            ANSWER

            Answered 2020-Sep-21 at 00:21

            There're several solution you can try:

            • You can use the rename-command config to disable write commands. If you only want to disable small number of commands, that's a good solution. However, since there're too many write commands, you might need to have too many configuration, and easy to miss some of them.

            • If you're using Redis 6.0, you can use Redis ACL to disable write commands for specific users.

            • You can setup a read-only Redis replica for your master, and ask clients to read from the replica.

            Source https://stackoverflow.com/questions/63981082

            QUESTION

            How to install python on a docker container
            Asked 2020-Sep-02 at 13:07

            I have created a docker-compose yml file to run a cron-job in a docker container.

            The cron-job which will run inside the docker container has to run a python script and connect to mysql an redis through redis-sentinel.

            Cron-job need python and required python-dependencies(mysql and redis sentinel) to be installed in the docker container to run the python script successfully.

            here is my docker-compose yml file

            ...

            ANSWER

            Answered 2020-Sep-02 at 13:07

            You can use python image directly (if alpine is required, there is versions based on it) https://hub.docker.com/_/python I think that best way to solve your request is build your own docker image:

            create docker file

            Dockerfile

            Source https://stackoverflow.com/questions/63705785

            QUESTION

            Problem running Redis master and sentinel using docker
            Asked 2020-Aug-11 at 07:39

            I wanted to have below configuration:

            • 1 master and 2 sentinels on host A.
            • 1 slave and 1 sentinels on host B.

            So for Master, I have created dockerfile like below:

            ...

            ANSWER

            Answered 2020-Aug-10 at 17:42

            Dockerfile can only have one CMD instruction, and if you specified multiple, the last one will be execute. So this is the reason you can access sentinel but not redis server.

            If you want to execute multiple command, you should use RUN instead and use CMD for the main process.

            But I don't recommend to use RUN for sentinel or redis-server as Docker container is very lightweight and each container should focus on its own process(CMD). For sentinels and redis-server, you can create multiple containers on same host(docker-compose should be a potential solution).

            Source https://stackoverflow.com/questions/63323903

            QUESTION

            Redis 6 TLS Support and Redis Sentinel
            Asked 2020-May-26 at 17:31

            I would like to set up a basic 3-node Redis Sentinel setup using the new TLS features of Redis 6. Unfortunately, it doesn't seem like Redis 6 Sentinel is smart enough to speak TLS to clients.

            Does anyone know of a way to do this, or if it's not possible, if there are any mentions online about adding support for this in the future? It seems a shame to have these nice TLS features and not be able to use them with Redis' own tools.
            I am aware that in the past people have used Stunnel to do this. With TLS support added to Redis, I am only interested in doing this if it can be done without third party addtions.

            My setup:
            3 Redis servers (6.0-rc, last pulled last week), running TLS with the test certs as specified in the Redis docs - one master and 2 replicas
            3 Sentinels (6.0-rc, also last pulled last week), not running TLS on their ports (I would like to, but that's a secondary problem)

            What I've Tried:

            1. Pointing Sentinel to the Redis TLS port - this results in lots of TLS errors in Redis' logs about incorrect TLS version received, as Sentinel is not speaking TLS to Redis. Since it fails, Sentinel thinks the master is down.

            2. Adding "https://" in the Sentinel config in front of the master IP - this results in Sentinel refusing to run, saying it can't find the master hostname.

            3. Adding TLS options to Sentinel - this results in Sentinel trying to talk TLS on its ports, but not to clients, which doesn't help. I couldn't find any options specifically about making Sentinel speak TLS to clients.

            4. Pointing Sentinel to the Redis not-TLS port (not ideal, I would rather only have the TLS port open) - this results in Sentinel reporting the wrong (not-TLS) port for the master to the simple Python client I'm testing with (it literally just tries to get master info from Sentinel) - I want the client to talk to Redis over TLS for obvious reasons

            5. Adding the "replica-announce-port" directive to Redis with Sentinel still pointed to the not-TLS port - this fails in 2 ways: the master port is still reported incorrectly as the not-TLS port (seems to be because the master is not a replica and so the directive does not apply), and Sentinel now thinks the replicas are both down (because the TLS port is reported, replicas are auto discovered, and it can't speak to the replicas on the TLS port).

            I am aware of this StackOverflow question (Redis Sentinel and TLS) - it is old and asks about Redis 4, so it's not the same.

            ...

            ANSWER

            Answered 2020-May-25 at 13:01

            Try to add tls-port option to the sentinel.conf as it seems to enable TLS support in general and the same is stated in documentation. For me the below two statements added to sentinel.conf on a top of the rest of TLS configuration actually made the trick.

            tls-port 26379

            port 0

            Source https://stackoverflow.com/questions/61327471

            QUESTION

            redis-ha in kubernetes cannot failover back to master
            Asked 2020-May-15 at 01:30

            I am trying to create a simple redis high availability setup with 1 master, 1 slave and 2 sentinels.

            The setup works perfectly when failing over from redis-master to redis-slave. When redis-master recovers, it correctly register itself as slave to the new redis-slave master.

            However, when redis-slave as a master goes down, redis-master cannot return as master. The log of redis-master go into the loop showing:

            ...

            ANSWER

            Answered 2018-Dec-22 at 15:45

            It turn out that the problem is related to the used of host name instead of IP:

            Source https://stackoverflow.com/questions/53743032

            QUESTION

            Redis 4 systemd Sentinel config file not writable
            Asked 2020-Apr-07 at 23:27

            I have installed latest Redis 4(4.0.14) version.I am trying to setup a 3 node Redis sentinel. I changed my sentinel config file , when I try to run

            ...

            ANSWER

            Answered 2019-Jun-04 at 15:43

            Check the file permission on /etc/redis-sentinel.conf

            Check for SELINUX sestatus and if it's running, then try disabling it or add an selinux exceptions.

            Source https://stackoverflow.com/questions/56435762

            QUESTION

            How to Configure Airflow Celery executor with redis sentinel?
            Asked 2020-Mar-02 at 13:43

            Redis sentinel setup is done.

            what all changes i have to do to point my celery backend to redis-sentinel? i am using redis as a broker for celery executor.

            ...

            ANSWER

            Answered 2020-Mar-02 at 13:43

            You have an example in the Configuration section of the Using Redis page in the Celery documentation.

            From that page:

            Source https://stackoverflow.com/questions/60486239

            QUESTION

            What is the port opened by kube-proxy for,Why does it listen on so many ports?
            Asked 2020-Feb-24 at 11:40

            What is the port opened by kube-proxy for,Why does it listen on so many ports? From my node, I can see that kube-proxy is listening to a lot of ports. Can someone explain to me why they are listening to so many ports and what is it for? the output like below:

            ...

            ANSWER

            Answered 2020-Feb-24 at 08:59

            Based on the official documentation:

            kube-proxy reflects services as defined in the Kubernetes API on each node and can do simple TCP, UDP, and SCTP stream forwarding or round robin TCP, UDP, and SCTP forwarding across a set of backends

            Basically, it listens for the active Services and forwards them across your cluster.

            You can get the list of registered services with:

            Source https://stackoverflow.com/questions/60370699

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install redis-sentinel

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/huyanping/redis-sentinel.git

          • CLI

            gh repo clone huyanping/redis-sentinel

          • sshUrl

            git@github.com:huyanping/redis-sentinel.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Command Line Interface Libraries

            ohmyzsh

            by ohmyzsh

            terminal

            by microsoft

            thefuck

            by nvbn

            fzf

            by junegunn

            hyper

            by vercel

            Try Top Libraries by huyanping

            php_crontab

            by huyanpingPHP

            simple-fork-php

            by huyanpingPHP

            Zebra-PHP-ArrayGroupBy

            by huyanpingPHP

            async-mysql-php

            by huyanpingPHP