Redis deployment configuration - master slave replication

只愿长相守 提交于 2019-12-02 17:43:46

问题


Currently I have two servers which I have deployed node.js/Express.JS based web services API. I am using Redis for caching the JSON strings.

What will be the best option deploying this setup in to production? I see here it advices to go with a dedicated server redis. OK. I take it and use a dedicated server for running redis master. Can I use existing app servers as slave nodes? Note : these app servers are running an Node/Express application.

What other other options do I have?


回答1:


You can.

It all depends on the load that those other servers have, it's a problem of resource sharing. To be honest my main issue with your architecture is not the dedicated vs the non-dedicated servers, it's the fact that you are placing a Redis server (master or not) on a host that most likely will be facing the internet (expressJS app), meaning, it's quite exposed.

If you can simulate HTTP load into your Node/Express JS servers, see the difference between running some benchmark tests on your dedicated server vs the non dedicated ones:

On a running redis server type in:

redis-benchmark -q -n 100000

If the app servers are being hammered and using all cores frequently you should see a substantial difference in the benchmarks.

My suggestion is, go ahead with your first setup and add monitoring for the redis response times, and only act when you have to, which might be now if the benchmarks show very poor results.

As a side note, consider the option of not sharing hosts for services that you expose to the internet with services that perform internal functions to your application.



来源:https://stackoverflow.com/questions/29131003/redis-deployment-configuration-master-slave-replication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!