Situation: We're setting up a load-balancer with a self hosted WordPress (4.6) Networks on RHEL 7. MariaDB is replicated via master-slave.
Problem: However, our network team want to point the load-balancing monitor trigger to http://IP/canary-page. There is a certain string we look for. If present, the DNS stays on the primary IP address. If not present (server issue or manually altered), the DNS changes to the fail-over instance.
Question: Can one access a WP site via it's IP?
If the answer to the above question is yes, then the rest of this doesn't matter.
I tried to set up domain aliasing through wordpress-mu-domain-mapping but this doesn't not appear to allow any aliasing of the base site ("site 1"). This complicates the matter. Since I couldn't alias site 1, I thought of the option below.
Alternative options: My other thought was to create a subsite in the networks install called Canary. Since the database is replicated it would have the same primary domain (http://my-canary-url
). At the WP level, we could also assign domain aliases of both my-canary-pirmary
and my-canary-failover
.
Then at a DNS level, the load-balancer would use my-canary-url
. We'd point my-canary-primary
to the primary instance and my-canary-secondary
to the fail over installation.
Ответ - да, но вопрос неверный.
Единственное, что определяет, как можно обращаться к веб-сайту, - это то, как настроен веб-сервер.
Обратите внимание, что если вы используйте записи DNS, тогда вы не получите доступ к сайту по IP.
Несмотря на то, что использование DNS для некоторой балансировки нагрузки возможно и полезно, очень непрактично обрабатывать избыточность из-за кэширования на нескольких уровнях.
Если ваши два сервера находятся в одном месте, лучшим подходом, вероятно, будет иметь фасад (маршрутизатор / брандмауэр), который обрабатывает балансировку нагрузки и избыточность.