• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Cluster configuration with managed servers on a single machine

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks,
I've been trying to configure a cluster with two managed servers and an admin server for a domain name clmydomain. I've successfully created the cluster and can run and stop both managed servers. Below is my configuration information:
admin server address: localhost
port: 7001
cluster name: my_cluster_1
cluster address: localhost
multicast port : 7020
multicast address: 237.0.0.1
my_managed_server_1 (first managed server) port: 7005
address: localhost
my_managed_server_2 (second managed server) port: 7010
address: localhost
I've app.jar file that includes EJBs with a session bean acting as session facade. I then use a servicelocator class to get a handle to sessiona facade object using following code:
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "weblogic");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
I'm successfully able to deploy and test the JNDI names for the underlying datasource and all the EJBs plus session facade on managed servers.
If I deploy app.jar only to cluster (both managed servers) then I cannot succussfully get a handle to session facade and get the NameNotFoundException. If I changed the port number to 7005 in the above code (t3://localhost:7005) and my managed server 1 is running (on port 7005 obviously) then I'm able to get the session object and the data fetched from datasource successfully. If shut down managed server 1 and start managed server 2 then again I get the NameNotFoundException.
In order to get the t3://localhost:7001 part of the code to work, I have to deploy app.jar on admin server as well as the cluster but my understanding is that I don't have to deploy the app.jar to admin server itself.
I can start a managed server successfully using the startManagedServer.bat using the http://localhost:7001 url (while the admin server is running).
What am I doing wrong? Am I missing some sort of configuration somewhere that I cannot specify 7001 port in the url without deploying app.jar on admin server? I'd greatly appreciate any help. Thanks.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look here
http://edocs.bea.com/wls/docs81/cluster/best.html
 
A Wolfe
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nizan, thanks. But not much of any help. I did change my weblogic-ejb-jar.xml to include cluster related configuration information (although the default values for related elements are already "True" so not much difference there). But I still can't test failover.
Here is the situation now: I run a java class in console to test running both managed servers. I notice that even if I'm using 7005 port to test (managed server 1 listening port), after the first test run, the second run test shows the test messages in managed server 2 (port 7010) console window instead of server 1. This means that both servers are synchronized and multicast port configuration is working and probably due to load balancing algorithm server 2 is handling the request instead of server 1. But when I shut down server 1 (mimicing as system failure) then I expect the server 2 to still handle the request but at that point I get the "CommunicationException" "Destination unreachable" error. So failover is failing.
Any ideas?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if the server is in the middle of a process and you shut it down do not expect it to failover to the other server with your current configuration. You need to use session replication. I am also working on clustering for a client of ours using weblogic81 and I encountered the same problem you were facing. To perform session replication, you will have to build your application after adding a weblogic.xml file to be placed in the application's WEB-INF directory. The purpose of this is to pass a parameter so as to indicate that in memory session replication is to take place. Also you will have to specify a replication group for the managed servers. A replication group is simply a common name that you give to the appropriate field for each managed server you want in the group. You should go through this link and read up about session replication first:
http://edocs.bea.com/wls/docs60/cluster/servlet.html#1008602
It applies to all versions of weblogic even though its meant for weblogic6.0
Hope this helps!

Misnad
Virtusa Corp.
 
A Wolfe
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Misnad, thanks for reply. I did see the documents but it doesn't apply to my test case. I'm not using any sort of web components (JSP, servlets) to test my deployed EJBs. I'm simply testing it using a simple java class running on dos prompt. The only thing I can see relevant to my test case scenario is Replication group. I'll give that a try. Thanks again.
 
Let's go to the waterfront with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic