Redis: How to setup a cluster - for beginners

  Рет қаралды 57,120

That DevOps Guy

That DevOps Guy

Күн бұрын

Пікірлер: 76
@Redisinc
@Redisinc 3 жыл бұрын
Fantastic work, couldn't have put it better myself!
@zinobi
@zinobi 2 жыл бұрын
This is a really good overview-video for someoone like me who is kind of used to redis and Docker and does not want a 2 hour introduction on how to install Docker and write a hello-world in Qbasic before getting to the relevant stuff.
@alfa-being
@alfa-being 4 жыл бұрын
Thank you so much always learning something from this channel...waiting for "kafka Cluster on Kubernetes".
@elibukin4840
@elibukin4840 2 жыл бұрын
my dude.... you are officially awesome!
@mahmoudalaskalany
@mahmoudalaskalany 3 жыл бұрын
most valuable video on clustering for redis thanks but i have a tiny question how to connect automatically to the new elected master if the main one fails
@Dobby_zuul
@Dobby_zuul 2 жыл бұрын
This video was absolutely stellar
@et4493
@et4493 Жыл бұрын
Outstanding job man! I'm all in
@devtech7830
@devtech7830 2 жыл бұрын
Very Good content. How can I do this as a service on Docker swarm?
@dila2219
@dila2219 2 жыл бұрын
+++
@ragnadrok7
@ragnadrok7 2 жыл бұрын
I have a doubt at this point, how to configure client to switch to new master on the fly without manual config ?
@MrApalazuelos
@MrApalazuelos 6 ай бұрын
Thank you so much for this video! I learned a lot. Just one question how do you know what's the new master after the failover?? Thanks
@ApodyktycznyCzlek
@ApodyktycznyCzlek 3 жыл бұрын
12:00 if you came here for Redis Sentinel :P
@rajeevkalangi2472
@rajeevkalangi2472 3 жыл бұрын
Wow... Superb bro... Very crisp and clear... Thank You...
@andresantana9148
@andresantana9148 8 ай бұрын
Hey, great video, but I have a question. If services provides loadbalancer, how can I ensure my externall app will always hit the master for RW operations?
@linovieira9739
@linovieira9739 7 ай бұрын
Great work! Thank you very much. I just have a quick question: How do you suggest running one container of Redis Cluster and Redis Sentinel across three different hosts?
@wisdom514
@wisdom514 Ай бұрын
Thanks for the information video
@harshakkrishnaa2014
@harshakkrishnaa2014 9 ай бұрын
Hey great video, I tried this for the new versions, and when I delete the redis-0, my sentienl get this error "Failed to resolve hostname 'redis-0'". Is there anything I need to change in the sentinel config? I also tried announcing the ips
@samuelvicent5034
@samuelvicent5034 3 жыл бұрын
Thank you so much, really helpful for understanding the fundamentals! just to mention that I added to the redis-1 and redis-2 configuration the following parameters for those replicas to work as "master" (writable): replicaof redis-0 6379 and replica-read-only no. Very appreciated for your tutorial!
@NeilMcFadyen-r2z
@NeilMcFadyen-r2z Жыл бұрын
how would this work to run the redis containers on separate machines, do you need to use docker swarm?
@RahulSharmaSingularity
@RahulSharmaSingularity 6 ай бұрын
Brilliant !
@swarajlaha6778
@swarajlaha6778 2 жыл бұрын
How can we implement cross kuberantes cluster replication in the sentinel mode?
@moma2189
@moma2189 3 жыл бұрын
Awesome 👌. I think it is time for ELK and Graylog :)
@techbeauty205
@techbeauty205 Жыл бұрын
- so how will our application detect the failover and change the connection to new master automatically? - and what if one of sentinels go down?
@brianhernandez2919
@brianhernandez2919 Жыл бұрын
Great video!!.. question for you:i see you shut down master, there is anyway to switch in the app to new master without manual modification?, imagine you have a web app and you don't want this process be transparent!! thx
@jadeedstoresupport8916
@jadeedstoresupport8916 Жыл бұрын
Sir, you have this gift of communicating in a way that I find very easy to understand. Many thanks. Would be great if you could produce content pertaining to MySQL as well (like replication, sharding etc.) Thanks
@sijaanhallak5279
@sijaanhallak5279 7 ай бұрын
Too bad I didn't discover this channel a long time ago. Can I ask about your background?
@nirmaln
@nirmaln 4 жыл бұрын
Thank you so much, as always i find lot of information in your videos. Quick question - In a production env, how do you prefer the client application to detect the current master? Do you recommend connecting to any one of the Sentinel to query the current master or put a proxy server in front of the Redis cluster to make the master switch transparent to the client application. Thanks
@MarcelDempers
@MarcelDempers 4 жыл бұрын
Thanks for the kind words 💪🏽Check your client library and ensure it has sentinel support. Your client library should allow you to query the sentinel to discover the current master
@varunmb3310
@varunmb3310 3 жыл бұрын
Very good tutorial. Able understand easily with the github code.
@attrib75
@attrib75 4 жыл бұрын
Great video, thanks for doing this work. It would be great if you could create a video that talks about partitioning data across Redis instances, and the implications of doing so. Particularly insofar as, can you achieve clustering for redundancy as you show here, but also for partitioning?
@MarcelDempers
@MarcelDempers 4 жыл бұрын
Thanks! Sure you can definitely do sharding as well as high availability. Sharding is very powerful in Redis. I have not had a chance to play with it yet 💪🏽
@tornoutlaw
@tornoutlaw 3 жыл бұрын
I have a hard time setting up a daemonized/dockerized redis instance with the sysctl-param vm.overcommit=1. As far as I understand, sysctl-commands have to be executed on the host-system, therefore cannot be put into the dockerfile. Does anyone have a good example how to do it with a docker-compose.yml, if possible? I would like to avoid additional .sh files.
@raphaelquivel6399
@raphaelquivel6399 3 жыл бұрын
I had to use in a newer version replicaof instead of salveof and I had to remove the bind directive from the redis config so it will bind to all ips
@budi0580
@budi0580 3 жыл бұрын
Your video really help me. I am on mission to setup redis cluster, rabbit cluster and postgres cluster for production, would be very nice if you can have video about postgres cluster as well 🙏
@Shubham__Saroj
@Shubham__Saroj Жыл бұрын
Tremendous!😃
@shashankshekhar7839
@shashankshekhar7839 4 жыл бұрын
Thank you for sharing such a great video. Waiting for more such videos... :)
@predcr
@predcr 2 жыл бұрын
How to get all this content into a vs code editor. Pls explain that
@GruffGuy
@GruffGuy Жыл бұрын
Thanks. It was useful for me. Does anyone know, If I dont use docker then I need to install a new redis instances manually on a different ports (ofc If it's local). So for example, my master will be 6379 redis and slaves 6380, 6381.
@zoom0211
@zoom0211 2 жыл бұрын
Thanks a lot!
@loftkey
@loftkey 3 жыл бұрын
Thank you so much, your explanation really helped me!!
@lokmanhossen7354
@lokmanhossen7354 2 жыл бұрын
Thank you so much for your video, it's really helped a lot. But I have a question that is you changed the REDIS_HOST manually. Is there any way to find the new master automatically without restarting the application ?
@MarcelDempers
@MarcelDempers 2 жыл бұрын
Yes, you need a sentinel aware library. Checkout one if my new uploads on Go with Redis
@sberthu
@sberthu 3 жыл бұрын
thank you for your explanation, but don't work for me with your scripts. I have "Running in standalone mode" and no cluster feature seems to be available. What about cluster-enabled yes, cluster create, etc... ? Thank you for your reply. Sylvain
@akashshukla177
@akashshukla177 3 жыл бұрын
What if we Set appendonly yes And we have 1 cluster of 3 master and 3 slave that mean we've 3 shard. After adding data into one shard that shard got down. . . I've tried this and my hole cluster stop working, I want to know why that happened Why consistent hashing won't works or hash slot won't shift
@Stanoweb
@Stanoweb 3 жыл бұрын
Hi, I thank you for your tutorial very very very helpful :-) A quick question, is it bad to use Redis Sentinel on the same Redis host (for each instance, let's say I have 3 redis servers)?
@MarcelDempers
@MarcelDempers 3 жыл бұрын
Thanks! 🙏🏽 It's quite common for folks to pair a sentinel with a redis host on the same server, no problem with that, as long as you maintain quorum among the sentinels (I.E majority to vote on leader election), you're good 💪🏽
@seven-life
@seven-life 4 жыл бұрын
Thank you for sharing such a great video. I have a question here, why you use slaveof but no replacof ? The redis will use replaceof to take replace of slaveof after 5.0.0 version, is no right?
@MarcelDempers
@MarcelDempers 4 жыл бұрын
Thank you💪🏽 As far as I am aware, you initially set the `slaveof` value, and when the sentinels take over, they will automatically set `replicaof` fields and manage it based on availability and status I am not aware of >5.0.0 and would need to check the docs to confirm it
@seven-life
@seven-life 4 жыл бұрын
@@MarcelDempers You are welcome. You can check this doc: redis.io/commands/slaveof
@kumaranil181
@kumaranil181 3 жыл бұрын
Could you please make one on Redis ACL and TLS ?
@martinzen
@martinzen 4 жыл бұрын
Great vid. How would this look in a production deployment though? Surely you wouldn't dedicate a separate box for each sentinel?
@MarcelDempers
@MarcelDempers 4 жыл бұрын
Thank you 💪🏽This really depends, the sentinel can technically run anywhere as long as it has network connectivity and running as per availability zones and meets quorum requirements. you want to run more than 3 and you want to ensure they are distributed in case of host failure. As per docker best practices you always want to run only 1 process per container. I would not run redis + sentinel in the same container, but definitely consider running 1 redis container + 1 sentinel container per box as it may help having 1 sentinel local to the redis instance. And then distribute this across a few boxes. Hope that helps
@martinzen
@martinzen 4 жыл бұрын
That DevOps Guy thank you, that’s what I figured, looking forward to the follow up vid!
@Oyedeloy
@Oyedeloy 4 жыл бұрын
I am a little bit confused about the choice of port 5000 in the sentinel.conf file. i thought sentinel will run on 26379.
@MarcelDempers
@MarcelDempers 4 жыл бұрын
That's the defaults correct, you can override the ports for sentinel to use any desired ports
@AskewTarantula
@AskewTarantula 4 жыл бұрын
So this is probably not the place to post a question for you but not sure where else. I followed these instructions and when I go to info replication on a replica it says master_link_status:down. Any ideas?
@AskewTarantula
@AskewTarantula 4 жыл бұрын
Figured it out. Commented out bind 127.0.0.1 and now status is connected. This wasn't mentioned in the video.
@itguymichal
@itguymichal 4 жыл бұрын
Like the video very informative. :)
@thebluesclues2012
@thebluesclues2012 4 жыл бұрын
great vid, redis clustering on kubernetes is a steep learning curve and Redis Enterprise is not viable for us, so it looks to me Sentinel is to be avoided and using an operator in K8s is the way to go but there seems to be too few mature OSS operators, are you going to do the K8S vid with an operator?
@AnilRoyalJSp
@AnilRoyalJSp Жыл бұрын
useful 🙂
@amirbakz
@amirbakz 4 жыл бұрын
Can you make a video about the Amadeus operator and how to spin up a redis cluster with master/slaves on kubernetes using Amadeus operator ?
@eriktomcsyk8483
@eriktomcsyk8483 3 жыл бұрын
Does anyone know why I can't change my password? When I try to modify the "a-very-complex-password-here" section in the configuration files unfortunately the slaves can't connect to the master.
@MarcelDempers
@MarcelDempers 3 жыл бұрын
Yes! A kind contributer has made a PR with explanation for the fix here github.com/marcel-dempers/docker-development-youtube-series/pull/62 Hope that helps 💪🏽
@eriktomcsyk8483
@eriktomcsyk8483 3 жыл бұрын
@@MarcelDempers Thank you very much your suggestion solved the issue. Greetings from Hungary!
@MrVnelis
@MrVnelis 4 жыл бұрын
As usual, you are my go-to channel for any topic related to kubernetes and devops. Thank you! PS: Can you make a tutorial on kafka?
@geoffmahugu8983
@geoffmahugu8983 4 жыл бұрын
Quick question, is there an instance you would prefer running the Redis application on docker rather than a Kubernetes cluster? Awesome Tutorial Marcel🔥 👍🏾
@MarcelDempers
@MarcelDempers 4 жыл бұрын
My first choice would be neither. I would choose a hosted offering first which avoids having to deal with all the HA engineering overhead. Very rarely would I use docker over k8s. Possibly if there is an existing infrastructure constraint that makes running k8s more difficult, like PCI compliance. I'll also use docker for learning, it helps me peel away k8s layers and just get to understanding Redis.
@geoffmahugu8983
@geoffmahugu8983 4 жыл бұрын
@@MarcelDempers, well understood i'll keep an eye on the upcoming Redis Kubernetes deployment tutorial.
@tkk554
@tkk554 3 жыл бұрын
what if Redis run on different machine?
@siulian
@siulian 2 жыл бұрын
Nice video regarding redis but unfortunately is not covering one major aspect. Application needs to know automatically who is master and use it instead of changing the code manually. How do you achieve this ?
@MarcelDempers
@MarcelDempers 2 жыл бұрын
Your application needs to use an SDK that is sentinel aware. An example in Go is covered here kzbin.info/www/bejne/bJ2tdKyBrNSEl7M
@studio99webagencysanmarino48
@studio99webagencysanmarino48 Жыл бұрын
I followed your "tutorial" and everything went smooth. Redis master replicates over the 2 replicas, and the 3 sentinels can see correctly the master and the 2 replicas. But something strange happens to me. If I connect with redis-cli on one of each sentinel and I run the command "SENTINEL FAILOVER mymaster" the failover procedure works correctly and a new master is elected, but if I put down the master redis server service, the 3 sentinels start the voting procedure but they vote just for themselves withour reaching the quorum. I even tried lower the quorum to 1 but they keep voting for just themselves and no slave is elected to master. So sentinel1 votes for redis1 (even if it's down), sentinel2 votes for redis2 and sentinel 3 votes for redis3. Why???? I'm losing sleep over this pal.
@foobar1963
@foobar1963 3 жыл бұрын
You have massive arms :P
@cdev4040
@cdev4040 Жыл бұрын
My sentinel pod false after 1 or 2 days. I deleted it and it recreate and work perfect for the next 1-2 day and false again @MarcelDempers can you help me with this? 2023-05-29T09:07:03.359Z | 2023-05-29T09:07:03.359Z | *** FATAL CONFIG FILE ERROR (Redis 7.0.11) *** 2023-05-29T09:07:03.359Z | Reading the configuration file, at line 4 2023-05-29T09:07:03.359Z | >>> 'sentinel monitor mymaster 6379 2' 2023-05-29T09:07:03.359Z | Unrecognized sentinel configuration statement.
Redis on Kubernetes for beginners
21:18
That DevOps Guy
Рет қаралды 43 М.
Redis : The Basics for beginners
21:28
That DevOps Guy
Рет қаралды 31 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 16 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 47 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 57 МЛН
How to Create a Cluster in Redis
12:02
Redis
Рет қаралды 30 М.
RabbitMQ : How to setup a RabbitMQ cluster - for beginners
23:12
That DevOps Guy
Рет қаралды 66 М.
Kubernetes cluster autoscaling for beginners
12:55
That DevOps Guy
Рет қаралды 53 М.
What is Kubernetes AFFINITY ?
17:28
That DevOps Guy
Рет қаралды 7 М.
Simplify Kubernetes YAML with Kustomize
20:37
That DevOps Guy
Рет қаралды 77 М.
Storing Secrets in GIT | GitOps | Kubernetes
27:17
That DevOps Guy
Рет қаралды 18 М.
Clustering in Redis
8:28
Redis
Рет қаралды 52 М.
Understanding StatefulSets in Kubernetes
28:44
That DevOps Guy
Рет қаралды 49 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 373 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 16 МЛН