问题
I am participating in the development of a distributed solution, based on RMI, and deployed on multiple Weblogic 10gR3 (10.3.0.0) nodes. One of the nodes hosts a RMI server, and other nodes access it through a foreign JNDI provider. While trying to improve our infrastructure by adding additional RMI servers, we faced some issues.
Details of our infrastructure:
-RMI server is running on a managed server, on port 7005.
-RMI clients access it through a remote JNDI provider which points to something like: t3://hostname:7005
I am posting what we've tried so far, upon creating additional RMI servers, and why it did not work:
1) Using Amazon ELB --> this is not an option because it requires opening our runtime port (7005) to the whole Internet, which would obviously be a security flaw.
2) Configuring a multi-endpoint JNDI provider (something like: t3://hostname1:7005,hostname2:7005), which apparently works for JMS queues --> all of the requests were directed to the RMI server running on hostname1, and the application in fact worked fine. However, when deliberately making the server behind hostname1 crash, no requests were directed to hostname2. (Should they be redirected at all?)
3) Making use of a software load balancer, such as HAproxy --> when balancing over the HTTP layer, the requests were being interpreted as "t3 10.3.0.0", thus resulting in a HTTP 502 error on HAproxy. When balancing over the TCP layer, we got several "missing object" errors, as if a single TCP connection was being used for several HTTP requests, and after the first one was terminated, the subsequent requests were not able to access the remote objects (just guessing).
4) We were not willing to use a clustered WebLogic environment.
5) We did not consider the usage of high-level frameworks like spring-remoting-cluster yet.
Any clues/suggestions? Thanks in advance!
回答1:
It seems my only (safe) options are either adding my application nodes to a WebLogic Cluster and balance the load through the cluster or perform a redesign in my application.
来源:https://stackoverflow.com/questions/9168441/load-balancing-requests-to-a-weblogic-10gr3-rmi-server-on-amazon-ec2