Get Server Address in the cluster

I want to get all the servers IP's participating in my cluster.
          Is there a way to do it?
          (I tried to use ClusterMBean APIs but it returns only the server names)
          Thanks.
          

Pls find the attached code snippet.
          Kumar
          Shiri G wrote:
          > I want to get all the servers IP's participating in my cluster.
          > Is there a way to do it?
          > (I tried to use ClusterMBean APIs but it returns only the server names)
          >
          > Thanks.
          >
          import java.util.Set;
          import java.util.Iterator;
          import java.rmi.RemoteException;
          import javax.naming.*;
          import weblogic.jndi.Environment;
          import weblogic.management.MBeanHome;
          import javax.management.ObjectName;
          import weblogic.management.WebLogicMBean;
          import weblogic.management.configuration.ServerMBean;
          import weblogic.management.configuration.ClusterMBean;
          import weblogic.management.WebLogicObjectName;
          import weblogic.management.MBeanHome;
          public class getServersInCluster {
          static final int MAX_SERVERS_IN_CLUSTER = 10;
          public static void main(String[] args) {
          MBeanHome home = null;
          //url of the Admin server
          String url = "t3://172.17.240.99:8001";
          String username = "system";
          String password = "weblogic";
          ClusterMBean clusterMBean = null;
          Set mbeanSet = null;
          Iterator mbeanIterator = null;
          ServerMBean[] serverMbeanArray = new ServerMBean[MAX_SERVERS_IN_CLUSTER];
          String clusterName = "MyCluster"; // name of your cluster
          try {
          Environment env = new Environment();
          env.setProviderUrl(url);
          env.setSecurityPrincipal(username);
          env.setSecurityCredentials(password);
          Context ctx = env.getInitialContext();
          home = (MBeanHome) ctx.lookup("weblogic.management.adminhome");
          } catch (Exception e) {
          System.out.println("Exception caught: " + e);
          try {
          mbeanSet = home.getMBeansByType("Cluster");
          mbeanIterator = mbeanSet.iterator();
          while(mbeanIterator.hasNext()) {
               clusterMBean = (ClusterMBean)mbeanIterator.next();
               if(clusterMBean.getName().equals(clusterName)) {
               System.out.println("Name: " + clusterMBean.getName());
          serverMbeanArray = clusterMBean.getServers();
          } catch (Exception e) {
          System.out.println("Caught exception: " + e);
          System.out.println("The servers in the cluster: " + clusterName + " are: " );
          for (int i=0; i < serverMbeanArray.length; i++) {
               System.out.println("\n\nserver " + i + " : " + serverMbeanArray.getName());
               System.out.println("ListenAddress: " + serverMbeanArray[i].getListenAddress() + " ListenPort: " + serverMbeanArray[i].getListenPort());

Similar Messages

  • What/where is the "server address" for the My Cloud NAS?

    I recently purchased a 2TB My Cloud NAS to store my FLAC music files (many thousands of them). I'm trying to use JRiver as a media controller but I can't find a path to the files. I'm using a Macbook Air (osx 10.10.4). The controller program asks for a "server address" and I have no idea what it is or where I may find an address. The music files are in the Public folder and there is no other identiification for it as far as I know. One forum suggested the following link : http://wdc.custhelp.com/app/answers/detail/a_id/2686/~/how-to-map-a-wd-network-drive-on-a-mac This link offers several suggestions for a server address, but they are for My Book units and of course they don't work. Where, or how do I get a server address for my files on a My Cloud unit? I'm lost. I would appreciate any help. Thank you for your time.     Bill

    Welcome to the Community.
    In most cases, the Server Address is the current path that leads to the devices and/or shared folders. This means the IP address of your unit or your device name, and depending on your system, the exact location to the share with your data. You can obtain the current IP address used by your WD My Cloud in your router and also in your NAS's admin page.

  • How to get IP address of the Managed Server, in a cluster?

    Hello,
    I have created a cluster and have two managed servers in it. WLS version is 10.3 and paltform is Windows. Both the managed servers are on different machines. And I have Sun one web server (version 6) configured instead of the WLS in-built web server. I want to display, in my JSP, the IP/host name of the managed server to which the request is going to (forwarded by the Sun one server). How do I do that?
    Any help would be greatly appreciated. Thanks in advace.
    Thanks,
    Sanjay

    There isint a way to get this which is weblogic specific.
    you can try the following code to get it
    import java.util.*;
    import java.lang.*;
    import java.net.*;
    public class GetOwnIP
    public static void main(String args[]) {
    try{
    InetAddress ownIP=InetAddress.getLocalHost();
    System.out.println("IP of my system is := "+ownIP.getHostAddress());
    System.out.println("hostname = " + ownIP.getHostName());
    }catch (Exception e){
    System.out.println("Exception caught ="+e.getMessage());
    Hope this works

  • Why the non-cluster SQL Server appeared in the cluster nodes list

    1, I install the node rs6 standalone, Why it appeared in the cluster node list by inquiry the dmv?
    2, how to removed the rs6 from the cluster node list ?
    by "set -clusterownernode -resource "XXXASQL" -owners NODE1,NODE2"?
    But how to find the resource  name? I tried to use window cluster name, SQL cluster name, and SQL role name , All of them say failed to get the cluster object.
     3,how to set the owers to {}, I try below, but failed.

    IMHO, sys.dm_os_cluster_nodes  DMV is associated with the SQL Server
    Operating System (SQLOS), sys.dm_os_cluster_nodes returns one row for each node in the failover cluster configuration.
    As you are running standalone instance on cluster I am assuming this information is being picked from
    OS and not from RS6 SQL instance.
    As you have confirmed Is_cluster is false and if you don’t see RS6 instance in failover cluster manager I don’t think anything damaged here. Everything looking as expected, dont change owner node as its standalone instance.

  • How to get IP-Address of the database

    Hi,
    I need to get the IP address of the database (MSSQL7.0) , that connects to my application . There are two ways to be connected: via DSN(jdbc:odbc:dsnName) or directly (jdbc:odbc:host:port). How can I get (both cases) the IP address of server I connected to.
    Cheers

    Hi,
    You could try connecting and then typing netstat -a at the DOS command prompt. This should show all open connections etc.
    best,
    kev

  • Error calling a webservice from one server process of the cluster

    Hi ,
    I have a servlet which on startup makes a call to a webservice. I deploy this webapp on the cluster.
    The cluster has two instances each instance having one server process.
    So when the server restarts one server process on one instance calls the web service the other process on other instance fails with a 503 response code.
    When I tried to reproduce the same problem using two server processes on the same instance both processes are able to call the webservice properly.
    I am slightly confused as to how different the second scenario is from first one as both are individual server process and may or may not run on same instance.
    Can anyone tell me the real cause.
    Rgds
    Shashank

    Hi Rajat,
    This is how the default trace looks
    FATAL: Application Servlet failed to notify devices.
    Caught java.rmi.RemoteException: Service call exception; nested exception is:
         com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (503) Service Unavailable. The requested URL was:"http://<<server>>:50000/ManagementService/ManagementService?style=document"
         at com.om.mws.standaloneproxy.ManagementServiceBindingStub.notifyDevice(ManagementServiceBindingStub.java:1289)
         at com.om.mws.standaloneproxy.ManagementServiceBindingStub.notifyDevice(ManagementServiceBindingStub.java:1298)
         at com.om.ApplicationServlet$NotifyDevices.run(ApplicationServlet.java:86)
    Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (503) Service Unavailable. The requested URL was:"http://<<server>>:50000/ManagementService/ManagementService?style=document"
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.handleResponseMessage(MimeHttpBinding.java:980)
         at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1430)
         at com.om.mws.standaloneproxy.ManagementServiceBindingStub.notifyDevice(ManagementServiceBindingStub.java:1282)
         ... 2 more
    java.lang.NoSuchMethodError
    at java.lang.Thread.destroy(Thread.java:779)
         at com.omApplicationServlet$NotifyDevices.run(ApplicationServlet.java:92)
    Rgds
    Shashank

  • Get IP address of the machine

    Hello Experts,
    I am writing one program, in my program i want whenever it runs on any machine i got the IP adress of that machine in my program output,
    Is it possible with which function i can get the IP address of the machine...........
    Please revert back me soon........

    Pls check the forum you may get.
    I checked and found this link
    Re: BAPI for MB1B/MB1A - Goods Movement 555 and 344
    You may get more examples
    Regards
    MD

  • Network stream get IP address of the other side

    Hello 
    If I wire the reader url (computer A) input of the Writer Endpoint function in computer B, the Network Stream will run. Then how can I get the IP address of computer B in computer A.
    Thanks.

    or just use the host name as part of the URL.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Get server address from RemoteStub?

    I hope this is possible...
    How can I get the hostname/port from a java.rmi.server.RemoteStub?
    I can see it, when I call a toString() on it, along with a lot of other interesting information as well, for example:
       gnu.cajo.invoke.Remote_Stub[RemoteStub[ref:[endpoint:
       [JohnnyLaptop:1234,gnu.cajo.invoke.Remote$RCSF@1479feb]
       (remote), objID:[fa3ac1:febb6046e0:-8000, 0]]]]I really don't want to parse this string; there must be a simple way to get these; right?
    Many Dukes of appreciation!
    John

    Unfortunately the SecurityManager approach is already causing problems; obviously on hosts which prohibit its installation. Keep looking... sigh.
    To be honest Esmond, I am still considering all of the implications of clients being aware of the host from which a remote reference came. However, it still astonishes me that is not more easily available. I understand the motivation for data hiding and all, but I really see no harm in letting a user know, if he wants to. In fact I can see more harm in not.
    For example, a server, particularly one with an RMISecurityManager installed, could then prevent a potentially catastrophic compromise that could occur by simply calling any method. (As a trojan could even be carried in a RemoteException)
    I don't want to say too much on that; as I would rather not provide skr1pt k1dd13z with information on crashing J2EE infrastructure. But you know what I mean.

  • How to get IP address of the client?

    Hi,
    I use the SAP Portal 6 SP2. I need to prevent user from accessing to iview depending of their IP. How can I get the IP of the users? What would the best practice in this case to personalize the iview depending of the IP?
    Thank you,
    Maria

    HI,
    Use the below without Proxy detection:
    <%
        String ipaddress = request.getRemoteAddr();
    %>
    with Proxy detection:
    <%
        if (request.getHeader("HTTP_X_FORWARDED_FOR") == null) {
            String ipaddress = request.getRemoteAddr();
        } else {
            String ipaddress = request.getHeader("HTTP_X_FORWARDED_FOR");
    %>
    Regards,
    Birla.

  • How to get servername from a request but not the cluster name?

    hi all,
    how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
    When i say request.getServerName();---- This is giving me the cluster name and not the server name.
    any suggestions/idea ? Thanks alot in advance.
    Edited by: new_member on Apr 18, 2008 9:11 PM

    ADJavaUser wrote:
    You could try this:
    Create a batch or shell script that executes ifconfig or ipconfig and writes the IP address out to a file.
    Place each shell script file at different locations on each server within the cluster.
    Then within the code, try to execute each script from an external process (Runtime.exec). Since the files are at different locations within each server only the correct shell script for each server should execute and write the IP Address to a file. You'll have to detect which one ran. Then open the file that was written, possible parse it for the IP Address and use the code that I already provided.
    This is a time consuming process that will slow your application. Additionally depending on how your cluster is set up it might not work and still return the cluster's IP address.I got the solution....java.net.InetAddress.getLocalHost().getHostName(); works fine...But thanks guyz for ur responses

  • WLC 5760 with internal DHCP server, clients no get IP address

    Hi all,
    I have  2  Cisco 5760 WLC (active-standby)  IOS-Xe 03.03.03SE  with  one WLAN.
     sh wlan summary 
    Number of WLANs: 1
    WLAN Profile Name                     SSID                           VLAN Status 
    1    Invitados_ADSL                   Guest                          905  UP
    sh vlan         
    VLAN Name                             Status    Ports
    1    default                          active    Te1/0/3, Te1/0/4, Te1/0/5, Te1/0/6, Te2/0/3
                                                    Te2/0/4, Te2/0/5, Te2/0/6
    100  VLAN0100                         active    Te1/0/1, Te2/0/1
    101  Planta_1                         active    
    905  Internet                         active    Te1/0/2, Te2/0/2
    The DHCP server is internal.
    Sometimes the clients no get IP address and the DHCP pool has IP addresses available.
    The workaround done by me to solve the issue is “clear  ip dhcp  binding *”.
    Some days later the problem appears again.
    I see this bug with a similar problem:
    NGWC blocks DHCP traffic if wireless broadcast disabled
    CSCun88928
    Description
    Symptom:
    Some clients set the BROADCAST flag on the DHCP Discover packet. This requires the DHCP server to reply with a broadcast.
    In that case and if you are not using DHCP snooping on the 5760/3850, then the controller will block the return traffic unless you enable "wireless broadcast" which enables broadcast globally (and is thus not always desirable)
    Conditions:
    Seen on 3.3.2 IOS-XE
    Workaround:
    Use DHCP snooping with the "ip dhcp snooping wireless bootp-broadcast command"
    OR
    Enable "wireless broadcast" globally
    My DHCP configuration is:
    ip dhcp relay information trust-all
    ip dhcp snooping vlan 905
    ip dhcp snooping
    ip dhcp excluded-address 172.16.0.1 172.16.0.19
    ip dhcp excluded-address 172.16.1.250 172.16.1.254
    ip dhcp pool Invitados
     network 172.16.0.0 255.255.254.0
     default-router 172.16.0.1 
     dns-server 212.66.160.2 212.49.128.65 
     lease 0 8
    I see in Cisco documentation (http://www.cisco.com/en/US/docs/wireless/technology/5760_deploy/CT5760_Centralized_Configuration_eg.html) this configuration:
    DHCP Snooping and Trust Configuration on CT5760
    ip dhcp snooping vlan 100, 200
    ip dhcp snooping wireless bootp-broadcast enable
    ip dhcp snooping
    interface TenGigabitEthernet1/0/1
    description Connection to Core Switch
    switchport trunk allowed vlan 100, 200
    switchport mode trunk
    ip dhcp relay information trusted ip dhcp snooping trust
    interface Vlan100
    description Client Vlan
    ip dhcp relay information trusted
    My question is,Do I have to add the command "ip dhcp snooping wireless bootp-broadcast enable" to solve the issue?
    Thanks in advance.
    Regards.
    D

    Yes, test it with the command you mentioned
    ip dhcp snooping wireless bootp-broadcast enable
    HTH
    Rasika
    **** Pls rate all useful responses *****

  • Re: how to get servername from a request but not the cluster name?

    hi all,
    how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
    When i say request.getServerName();---- This is giving me the cluster name and not the server name. Say cluster1 has server1 and server2 and request is dispatched to any of one these servers. request.getServerName() - gives me cluster1 but I need to get server1/server2.
    any suggestions/idea ? Thanks alot in advance.

    http://forum.java.sun.com/thread.jspa?threadID=5287623

  • Cookie bug using Administrative Server as part of the Cluster

    All using Weblogic 6.0:
              Administrative Server running on Windows 2000 Professional
              Managed Server running on Windows 2000 Server
              Both machines running in the same cluster.
              Requests being proxied by the Windows 2000 Professional machine running IIS
              Ok, now that you know our test environment, here's a little about our bug.
              If we begin an http session with requests being fulfilled by the
              administrative server (through the proxy), and shut down and bring the
              managed server back up, everything is fine. (No big surprise.)
              However, if requests are being fulfilled by the managed server and the
              administrator goes down and then comes back up, we get a
              "ReplicationManager: object 722399223287670702 not found" error, where the
              number seems to refer to value stored in the cookie after the last OR
              symbol as shown below.
              When the session is created, the cookie contains the following value:
              session id =
              OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              84610/-1062731365/7001/7002|4648941459387506517/-1062731381/7001/7002|722399
              223287670702
              When the administrative server goes down, the cookie contains the following
              value:
              session id =
              OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              84610/-1062731365/7001/7002|NONE|722399223287670702
              When the administrative server comes back up, the cookie contains the
              following value:
              session id =
              OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              84610/-1062731365/7001/7002|4563245475623454445/-1062731381/7001/7002|722399
              223287670702
              Its pretty obvious how the cookie id breaks down, information before the
              first OR is client info specific to each client, between the first and
              second OR is information regarding the first server from the cluster to
              fulfill the requests. The info between the second and third is the
              identification of the backup server containing the replicated version of the
              session. And the last bit of information seems to be an ID referring to the
              session object as stored in memory. As you can see, the value that the error
              is referring to never changes. SO WHY DOES THE OBJECT GET LOST?
              This is a big problem for us, as our resources are limited (as I assume
              everyone else's is). Is this just a bug? If so, is there a service pack
              already available? If its not a bug, it should be as resolving the bug
              allows the administrative server to be part of the cluster saving everyone
              the money for an extra machine and (here's the killer) the money for an
              extra weblogic license to run on a administrative server separate from the
              cluster (in which case it works fine, just costs a whole lot more).
              Well, I hope this is clear enough. If not please ask whatever you need to
              know. We are looking for any information anyone can provide.
              Thank you,
              Chad Griffith
              Software Engineer
              VisionTEK Inc.
              [email protected]
              

    To answer your question, fail over works fine, i.e. if a session is
              maintained on the managed server, we can shut it down and the session is
              transferred to the administrative sever.
              The only problem we are having is when the session is on the MANAGED server,
              and the ADMIN server goes down and back up WITHOUT any session transfer.
              As for shutting down an admin server, you can bring it back up while managed
              servers are running by using the -Dweblogic.management.discover=TRUE
              setting.
              I hope this clarifies everything.
              Thanks again,
              Chad
              "Sioux France" <[email protected]> wrote in message
              news:[email protected]...
              > Is this an admin server problem though? Can you try the opposite? i.e. IS
              it
              > possible to connect to the Managed server for your http requests (through
              > the proxy)? If so, then shut down and bring back the managed server. I'd
              > expect that to go wrong in the same way? Likewise if you shutdown and
              bring
              > back the admin server in that configuration you would not have a problem?
              > "Chad Griffith" <[email protected]> wrote in message
              > news:[email protected]...
              > > All using Weblogic 6.0:
              > > Administrative Server running on Windows 2000 Professional
              > > Managed Server running on Windows 2000 Server
              > > Both machines running in the same cluster.
              > > Requests being proxied by the Windows 2000 Professional machine running
              > IIS
              > >
              > > Ok, now that you know our test environment, here's a little about our
              bug.
              > > If we begin an http session with requests being fulfilled by the
              > > administrative server (through the proxy), and shut down and bring the
              > > managed server back up, everything is fine. (No big surprise.)
              > >
              > > However, if requests are being fulfilled by the managed server and the
              > > administrator goes down and then comes back up, we get a
              > > "ReplicationManager: object 722399223287670702 not found" error, where
              the
              > > number seems to refer to value stored in the cookie after the last OR
              > > symbol as shown below.
              > >
              > > When the session is created, the cookie contains the following value:
              > > session id =
              > > OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              > >
              >
              84610/-1062731365/7001/7002|4648941459387506517/-1062731381/7001/7002|722399
              > > 223287670702
              > >
              > > When the administrative server goes down, the cookie contains the
              > following
              > > value:
              > > session id =
              > > OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              > > 84610/-1062731365/7001/7002|NONE|722399223287670702
              > >
              > > When the administrative server comes back up, the cookie contains the
              > > following value:
              > > session id =
              > > OnIXh5A6DxUWgBrA2qCLIDN0Co1dewmjdV1ze1isn9Wur2CHl2k2|60563422118895
              > >
              >
              84610/-1062731365/7001/7002|4563245475623454445/-1062731381/7001/7002|722399
              > > 223287670702
              > >
              > > Its pretty obvious how the cookie id breaks down, information before the
              > > first OR is client info specific to each client, between the first and
              > > second OR is information regarding the first server from the cluster to
              > > fulfill the requests. The info between the second and third is the
              > > identification of the backup server containing the replicated version of
              > the
              > > session. And the last bit of information seems to be an ID referring to
              > the
              > > session object as stored in memory. As you can see, the value that the
              > error
              > > is referring to never changes. SO WHY DOES THE OBJECT GET LOST?
              > >
              > > This is a big problem for us, as our resources are limited (as I assume
              > > everyone else's is). Is this just a bug? If so, is there a service pack
              > > already available? If its not a bug, it should be as resolving the bug
              > > allows the administrative server to be part of the cluster saving
              everyone
              > > the money for an extra machine and (here's the killer) the money for an
              > > extra weblogic license to run on a administrative server separate from
              the
              > > cluster (in which case it works fine, just costs a whole lot more).
              > >
              > > Well, I hope this is clear enough. If not please ask whatever you need
              to
              > > know. We are looking for any information anyone can provide.
              > >
              > > Thank you,
              > > Chad Griffith
              > > Software Engineer
              > > VisionTEK Inc.
              > > [email protected]
              > >
              > >
              >
              >
              

  • Get ip address of client machine and server

    Respected experts,
    I want to get ip address of the client machin and server machine.
    Which method should i use for getting this.

    drvijayy2k2 wrote:
    hi
    i am not sure
    but try request / servletrequest -> getRemoteHost() and getLocalHost()There isn't any getLocalHost() method for HTTPServletRequest. And in anycase, the getXXXHost() methods would return the hostname. You'll only get an IP address if the name cannot be resolved.
    @OP:
    [getRemoteAddr()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRemoteAddr()] - be warned that this may be the IP address of the last proxy in the chain
    [getLocalAddr()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getLocalAddr()] - this is the address of the interface that the request came in on, so for a server with multiple NICs, you will only be getting one possible IP address.

Maybe you are looking for

  • TO Display the row data as column in ALV

    Hi experts , Need to display the row data in ALV as column. The column of an ALV has the fieldnames of a table , this needs to be displayed as row data , that is as single row. How can this can be achieved?

  • Print from context menu don't resize document

    I have a problem on Acrobat Reader X (but the same problem exists on reader from version 9). I have a pdf file with image inside, page size A3, when click print on context menu (right click on the file), the document is send to print, but it's not re

  • Deleting photos and no pics in photostream on iPad 3

    I see from other discussion sites that this is a problem with photos that have been uploaded from computer.  They need to be deleted by re-synching.  I have done this and photos are still there.  Also, I have no pictures in photostream on iPad.  This

  • Skype - Problem with conversations (group)

    Hello i have problem : I call to friend - work i call to friend and add 2 friend = It does not work why? I add 2 friend to conversation and 1 friend add 2 friend no (After addition of 2 people can not write in a conversation (connection problem)) Lea

  • A variation on a theme - iPhoto and modified photos

    I want to ask a question that's been asked before, but with a twist: I just spent several hours editing photos I had imported into iPhoto. Photoshop Elements is set as my preferred editor in iPhoto. After editing each photo, I chose "Save for Web." I