Load balancing with Apache Karaf Cellar
Consider your application have different components like CXF services, Camel Routes, DOSGi services, Distributed Session.... etc. If you can deploy your applications on several Karaf nodes and with help of Cellar, you may need load balancing for CXF/HTTP endpoints, need is to load balance the HTTP requests on the Karaf nodes.
Apache httpd with mod_proxy_balancer
There are different ways to do that and here i am explaining Apache httpd with mod_proxy_balancer. It’s a very stable solution, easy to setup.
Consider you have three Karaf nodes, having the following services:
- http://192.168.1.10:8181/services
- http://192.168.1.11:8181/services
- http://192.168.1.12:8181/services
install Apache httpd
# on Debian/Ubuntu system
aptitude install apache2
# enable network connect on httpd
/usr/sbin/setsebool -P httpd_can_network_connect 1
# on CentOS/RHEL/Fedora system
yum install httpd
Just check if mod_proxy, mod_proxy_http, and mod_proxy_balancer modules are there in the main httpd.conf.
Edit the main httpd.conf or create a conf file in etc/httpd/conf.d and add
<Proxy balancer://mycluster>
BalancerMember http://192.168.1.10:8181
BalancerMember http://192.168.1.11:8181
BalancerMember http://192.168.1.12:8181
</Proxy>
ProxyPass /services balancer://cluster
This load balancer will easily proxy the /services requests to the different Karaf nodes.
The mod_proxy_balancer module is able to support session as well. Means, when a request is proxied to one node, then all following requests from the same user should be proxied to the same node.
For this, you can use the cookie in header to define the session.
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://mycluster>
BalancerMember http://192.168.1.10:8181 route=1
BalancerMember http://192.168.1.11:8182 route=2
ProxySet stickysession=ROUTEID
</Proxy>
ProxyPass /myapp balancer://mycluster
mod_proxy_balancer: web manager
This allows you to see if your Karaf nodes are up or not, the number of requests received by each node, and the current load balancing method in use and all.
<Location /balancer-manager>
SetHandler balancer-manager
Order allow,deny
Allow from all
</Location>
Point your browser to http://host:port/balancer-manager and you will see the manager page.
Reference:
http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html.
https://bayanlarsitesi.com/
ReplyDeleteGöktürk
Yenidoğan
Şemsipaşa
Çağlayan
7RZZU8
görüntülü show
ReplyDeleteücretlishow
OOT3G
68574
ReplyDeleteDüzce Parça Eşya Taşıma
Rize Evden Eve Nakliyat
Bayburt Evden Eve Nakliyat
İzmir Şehir İçi Nakliyat
Kırıkkale Şehirler Arası Nakliyat
Eryaman Parke Ustası
Edirne Şehir İçi Nakliyat
Van Şehir İçi Nakliyat
Eskişehir Şehir İçi Nakliyat
FAB60
ReplyDeleteKarabük Şehir İçi Nakliyat
Kripto Para Borsaları
Giresun Şehirler Arası Nakliyat
Erzincan Lojistik
Şırnak Şehirler Arası Nakliyat
Ünye Çatı Ustası
Kütahya Parça Eşya Taşıma
Manisa Şehirler Arası Nakliyat
Urfa Evden Eve Nakliyat
6EB38
ReplyDeleteŞırnak Telefonda Rastgele Sohbet
gümüşhane kızlarla rastgele sohbet
mersin en iyi ücretsiz sohbet siteleri
ısparta Rastgele Görüntülü Sohbet Uygulamaları
gümüşhane rastgele canlı sohbet
konya kadınlarla rastgele sohbet
karaman canlı sohbet et
samsun rastgele sohbet
kastamonu canlı sohbet et
D13B6
ReplyDeleteledger web
arculus
onekey
wallet arculus
ledger web
bitbox
web trezor suite
web trezor suite
ledger live
FC79C
ReplyDeletewhatsapp görüntülü şov