Skip to content

Remote Administration Of Domain Through WLST

For administration of the whole domain and all the servers in the domain, we can use WLST commands. This is the best way for a monitoring and managing the complete domain using nodemanager.

To start the admin server using WLST, ensure that the admin server is associated to a machine. Once done, start the WLST tool.

Start the nodemanager using the command startNodeManager() as seen in the image.

Note: Nodemanager starts and runs irrespective of the WLST tool. Even if you exit from WLST, the nodemanager will still be running.

Now you need to connect to the nodemanager using the nmConnect() command. This needs to be done because you need to start the the servers through node manager.

Example:  nmConnect(‘weblogic’, ‘weblogic’, ‘localhost’, ’5556′, ‘example_domain’,'D:/BEA103/user_projects/domains/example_domain’,'plain’)
- The above command takes username, password, hostname, port, domain name, domain directory and nodemanager type (SSL, Plain) as arguments.

1) To start the admin server through WLST using nodemanager, type the below command:
- nmStart(‘AdminServer’)

2) To check the status of the admin/managed servers, type the command:
- nmServerStatus(‘AdminServer’)
- nmServerStatus(‘MS1′)

3) To stop/kill the server, enter the command:
- nmKill(‘AdminServer’)

Steps to start the managed servers remotely:

- On the remote machine, start the WLST tool and connect to the local running admin server:

Once connected, do the nmEnroll from the remote machine:
nmEnroll(‘D:/BEA103/wlserver_10.3/common/nodemanager’)

Now to start the managed servers from the remote machine, connect to the nodemanager using nmConnect as above and do the nmStart on the managed servers.

The servers status can be checked from the remote machine.

If you have any queries, do get back to us.

Best Regards,
Wonders Team!

15 Comments

  1. sahil

    Hi Divya,
    what nmEnroll command is doing here?
    Is it pasing some security information..

    Posted on 05-Jan-11 at 7:00 am | Permalink
  2. Ravi

    Hi
    Thanks for sharing such a nice information.
    can you please let us know how to associate machine with Admin server.

    Posted on 05-Jan-11 at 9:06 am | Permalink
  3. Ravi

    Hi Divya,

    Good one, this is very import when we are using big environments having many managed servers, clusters and n number remote machine’s ,though we can do this through console we cannot trust it as command line gives you what actually going on when try to start remote managed server from different R server where admin is running

    Please keep posting such type of articles.

    Thanks,
    Ravi

    Posted on 06-Jan-11 at 6:04 pm | Permalink
  4. ram

    Hi Team, how do we know the installed weblogic is evalution or enterprise

    and one more question is how do we subit the questions in this forum

    Posted on 07-Jan-11 at 5:26 am | Permalink
  5. Administrator

    Hi Ram,

    You get full version of Weblogic installers. There is not evaluation version.
    During the time of BEA, there were evaluation licenses, with Oracle its different.

    You can join our forum and start posting

    http://weblogic-wonders.com/weblogic/forum/#/

    Cheers!
    Faisal

    Posted on 07-Jan-11 at 9:00 am | Permalink
  6. divya

    Hi Sahil,

    Yes running nmenroll means the correct username and password are supplied to each managed server.

    Regards,
    Divya

    Posted on 11-Jan-11 at 6:32 am | Permalink
  7. divya

    Hi Ravi,

    From the admin console, expand Environments, click on machines, create a new machine. Then go to the machine created, configurations -> servers tab. Click on add. There you can add the admin server.

    Regards,
    Divya

    Posted on 11-Jan-11 at 6:38 am | Permalink
  8. pls tell me moniternig tools in weblogic srever jdbc,jms

    Posted on 21-Jan-11 at 2:25 am | Permalink
  9. Administrator

    Hi Kishore,

    You can monitor resources on WLS using WLST or JMX.
    You can also use some third party tools like introscope.

    Is there anything specific you are looking for?

    -Faisal

    Posted on 21-Jan-11 at 5:20 pm | Permalink
  10. suresh

    is it possible to have cluster of clusters configuration in weblogic..?

    Posted on 07-Feb-11 at 2:21 am | Permalink
  11. divya

    Hi Suresh,

    It is not possible in weblogic to have cluster of clusters. I do not see any need of it either when you have horizontal clustering in picture.

    Regards,
    Divya

    Posted on 09-Feb-11 at 4:44 am | Permalink
  12. Great Post on Weblogic Scripting Tool (WLST).

    Posted on 20-Jun-11 at 6:34 pm | Permalink
  13. Alok

    Hello Wonders Team!
    I am looking for a use case, where i need to create two managed servers to running admin servers

    condition 1: Adminserver and managed_server1 will be in same machine.

    codition 2: managed_server2 will be in other machine.

    I have a code which will create two managed servers in a same machine.

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.*;
    import weblogic.management.scripting.utils.WLSTInterpreter;
    import org.python.util.InteractiveInterpreter;

    public class EmbeddedWLST
    {
    static InteractiveInterpreter interpreter = null;
    EmbeddedWLST()
    {
    System.out.println("Inside the constructor()");
    interpreter = new WLSTInterpreter();
    }
    private static void connect()
    {
    System.out.println("Inside the Connect method()");

    StringBuffer buffer = new StringBuffer();
    buffer.append("connect('weblogic','1qaz2wsx','t3://localhost:7001')");
    System.out.println("After Connect method()");
    interpreter.exec(buffer.toString());
    System.out.println("at the end of conenct method");
    }
    private static void createServers()
    {
    System.out.println("Inside the CreateServer method()");
    StringBuffer buf = new StringBuffer();
    buf.append(startTransaction());
    buf.append("man1=create('msEmbedded1','Server')\n");
    buf.append("man2=create('msEmbedded2','Server')\n");
    buf.append("mach=create('machineEmbedded','Machine')\n");
    buf.append("clus=create('clusterEmbedded','Cluster')\n");
    buf.append("man1.setListenPort(8001)\n");
    buf.append("man2.setListenPort(9001)\n");
    buf.append("man1.setCluster(clus)\n");
    buf.append("man2.setCluster(clus)\n");
    buf.append("man1.setMachine(mach)\n");
    buf.append("man2.setMachine(mach)\n");
    buf.append(endTransaction());
    //buf.append("print Script ran successfully ... \n");
    interpreter.exec(buf.toString());
    }
    private static String startTransaction() {
    StringBuffer buf = new StringBuffer();
    buf.append("edit()\n");
    buf.append("startEdit()\n");
    return buf.toString();
    }
    private static String endTransaction() {
    StringBuffer buf = new StringBuffer();
    buf.append("save()\n");
    buf.append("activate(block='true')\n");
    return buf.toString();
    }
    public static void main(String[] args) throws IOException
    {
    System.out.println("inside the main ");
    Runtime rt2 = Runtime.getRuntime();
    Process pr2 = rt2.exec("cmd /c C:\\Oracle\\Middleware\\wlserver_10.3\\server\\bin\\setWLSEnv.cmd ");
    BufferedReader br = new BufferedReader(new InputStreamReader(pr2.getInputStream()));
    String line = "";
    while ((line = br.readLine()) != null)
    {
    System.out.println(line);
    }
    new EmbeddedWLST();
    connect();

    createServers();
    }
    }

    Thanks Alok

    Posted on 22-Sep-11 at 8:31 am | Permalink
  14. Administrator

    Okay.. so you are looking to modify this code to create managed server on two different machine??

    Posted on 27-Sep-11 at 5:27 am | Permalink
  15. Alok

    Yes, i am trying to modify the code, to create the managed servers in two different machines,

    Loooking for help

    Thanks,
    Alok G

    Posted on 13-Oct-11 at 2:11 am | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*