Monday, March 16, 2009

Interview questions.........

Increasing the Java virtual machine heap size using scripting

  • Using Jython:

    AdminTask.setJVMMaxHeapSize ('[-interactive]')
  • Using Jacl:

    $AdminTask setJVMMaxHeapSize {-interactive}
Then specify the ServerName,NodeName,ProcessType,Maximum HeapSize

What is a Virtual host ?

Virtual host refer to the capability of most HTTP servers to support multiple logical hosts sharing one IP address on a server.


To delete a service from services.msc
C:\>sc delete SVNService
SVNService -- service name is case sensitive



Creating a server using scripting(Using wsadmin)

Creating an application server involves a configuration command. Perform the following steps to create a server:

Procedure

  1. Obtain the configuration ID of the object and assign it to the mynode variable, for example:

    Using Jacl:

    set node [$AdminConfig getid /Node:mynode/]

    Using Jython:

    node = AdminConfig.getid('/Node:mynode/')
  2. There are two ways to create the server using the node that you specified in the first step. Perform one of the following:
    • Using the AdminTask object:
      • Using Jacl:

        $AdminTask createApplicationServer mynode
        {-name test1 –templateName default}
      • Using Jython:

        AdminTask.createApplicationServer(mynode,
        ['-name', 'test1', '-templateName', 'default'])
    • Using the AdminConfig object:
      • Using Jacl:

        $AdminConfig create Server $node {{name myserv}
        {outputStreamRedirect {{fileName myfile.out}}}}
      • Using Jython:

        AdminConfig.create('Server', node, [['name', 'myserv'],
        ['outputStreamRedirect', [['fileName', 'myfile.out']]]])
  3. Save the configuration changes.
The wsadmin tool uses the workspace to hold configuration changes. You must save your changes to transfer the updates to the master configuration repository. If a scripting process ends and you have not saved your changes, the changes are discarded.

Procedure

Use the following commands to save the configuration changes:
  1. Using Jacl:
    $AdminConfig save
  2. Using Jython:
    AdminConfig.save()
where:
$ is a Jacl operator for substituting a variable name with its value
AdminConfig is an object representing the WebSphere Application Server configuration
save is an AdminConfig command

If you are using interactive mode with the wsadmin tool, you will be prompted to save your changes before they are discarded.

If you are using the -c option with the wsadmin tool, changes are automatically saved. On a Unix operating system, if you invoke a command that includes a dollar sign character ($) using the wsadmin -c option, the command line attempts to substitute a variable. To avoid this problem, escape the dollar sign character with a backslash character (\). For example: wsadmin -c "\$AdminConfig save".

If a scripting process ends and no save has been performed, any configuration changes made since the last save are discarded. If there are multiple clients (scripts or browser clients) updating the configuration at the same time, it is possible that the changes requested by a script may not be saved. If this happens, you will receive an exception and you must make the updates again. If the save fails, the updates will not be saved to the configuration. If it succeeds, all updates are saved. To avoid save failures, you can invoke the save command after every configuration update.

You can use the reset command of the AdminConfig object to undo changes that you made to your configuration since your last save.

4.In a network deployment environment only, synchronize the node.

A node synchronization is necessary in order to propagate configuration changes to the affected node or nodes. By default, this situation occurs periodically, as long as the node can communicate with the deployment manager. You can propagate changes explicitly by performing the following steps:

Procedure

  1. Set the variable for node synchronization.
    • Using Jacl:

      set Sync1 [$AdminControl completeObjectName type=NodeSync,node=myNodeName,*]
    • Using Jython:
      Sync1 = AdminControl.completeObjectName('type=NodeSync,node=myNodeName,*')
    where:
    set is a Jacl command
    Sync1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans running in a WebSphere Application Server process
    completeObjectName is an AdminControl command
    type=NodeSync,node=myNodeName is a fragment of the object name. The complete name is returned by this command. This fragment is used to find the matching object name which is the SyncNode object for the myNodeName node, where myNodeName is the name of the node that you use to synchronize configuration changes. For example: type=Server, name=serv1. It can be any valid combination of domain and key properties. For example, type, name, cell, node, process, and so on.
    Example output:
    WebSphere:platform=common,cell=myNetwork,version=5.0,name=node
    Sync,mbeanIdentifier=nodeSync,type=NodeSync,node=myBaseNode,
    process=nodeagent
  2. Synchronize the node by issuing the following command:
    • Using Jacl:

      $AdminControl invoke $Sync1 sync
    • Using Jython:
      AdminControl.invoke(Sync1, 'sync')
    where:
    $ is a Jacl operator for substituting a variable name with its value
    AdminControl is an object that enables the manipulation of MBeans that run in a WebSphere Application Server process
    invoke is an AdminControl command
    Sync1 evaluates the ID of the server that is specified in step number 1
    sync is an attribute of modify command
    Example output:
    true
    You receive an output value of true, if the synchronization completes.

Configure LDAP

Install the Lightweight Directory Access Protocol (LDAP) server, and then prepare it to communicate with WebSphere® Application Server.
Install the LDAP server before WebSphere Application Server.
To prepare the LDAP server to communicate with WebSphere Application Server, complete the following steps:
  1. Install a supported LDAP server.
  2. Populate the LDAP directory with user data.
    Note: The mail attribute is required for all users.
  3. Note the values of the following LDAP properties; you must provide these values when you configure WebSphere Application Server:
    • Directory Type
    • Primary host name
    • Port
    • Bind distinguished name
    • Bind password
    • Login properties. For example: mail
    • Certificate Mapping
    • Certificate Filter, if applicable.
    • LDAP Entity types or classes. For example: Group, OrgContainer, PersonAccount, or inetOrgPerson
    • Search base
  4. You are now ready to install WebSphere Application Server.