Я могу использовать советы с подсистемой балансировки нагрузки?

SSL должен быть включен только во фронтэнде (общедоступный сервер), проксирование запроса SSL является тем же повреждением безопасности SSL (человек в среднем нападении). Таким образом, Вы будете иметь: https://www.myexample.com/app-8903/app.html, но это secretely будет служить плоскости http соединения из https://secret.myexample.com:8903/app.html

Конечно, если его приложения попытаются перенаправить URL к чему-то еще без SSL, то будут проблемы.

1
задан 5 June 2012 в 17:52
3 ответа

I would not recommend it. Redis is currently a master-slave replication mechanism and you would need to partition writes vs. reads. A load balancer will not do this for you without significant work. You will need to partition reads vs. writes in your app, or write an intermediary layer. Once you've done this you can put multiple slaves behind a load balancer and point writes to a single master.

Redis is fast enough that rarely will you see a significant delay in replication. Especially if you run the master configured to not write locally, and run one or more slaves not behind the load balancer that handle persistence.

As far as handling a down master, you could write/use a heartbeat style monitor on one or more slaves that monitor for a dead master and take over. You could still use a load balancer for some of this. For example, use a virtual IP on the LB and set the appointed secondary as a lower weight or whatever your chosen LB's term is). Then configure this server to be a slave to the master - but not in the read pool. Have it listen a non-standard port that the LB does not route to. When it detects the master has failed the process you use then reconfigures it to use the proper port and issues a SLAVE OF NOONE command.

I would also prefer to see that monitor process then tell the load balancer to not use the master at all. That way if it comes back online before you are ready you can slave it to the current master and then migrate back to it once it has synchronized with the backup master.

Ultimately how much value is in the work depends on how strict your true requirements are. Either way, if you are truly in need of not losing a single write, you will want to code your writer such that if it can not connect it queues those writes to disk and logs or alerts someone.

0
ответ дан 3 December 2019 в 21:47

Я никогда не пробовал, но главная проблема в том, что при репликации, даже синхронной репликации, redis допускает только отношения главный-подчиненный, а не отношения главный / главный.

Последствия Дело в том, что если вы пишете на подчиненное устройство, эти записи не будут доступны на главном устройстве.

2
ответ дан 3 December 2019 в 21:47

Instead of using the built-in redis sync, what about handling this in the code of your custom state service?

So with two or more servers under load balancing, they would each have a list of the other servers and after writing to their local Redis instance they would just write the same entry to the rest?

Assuming that works, then it should just be a matter of handling synchronization of an instance when bringing a server back online. Could you force this when your service restarts? Make the local version sync to another instance? Or just get all the entries with dates later than the latest locally?

0
ответ дан 3 December 2019 в 21:47

Теги

Похожие вопросы