Chapter 3 Creating and Configuring Servers


Starting the server

Before you can develop EAServer applications, you must start the server.

You can run a server in different modes, debug and normal, using different Java runtime versions and different Java virtual machines (VMs). To start the server in the desired configuration, change to EAServer's bin directory and run either serverstart.sh (UNIX) or serverstart.bat (Windows) with the options described in Table 3-9.

Table 3-9: Server start options
Option Description
-servername server
Specify the name of the server; the default is "Jaguar".
-jdk12 | -jdk13
Specify the JDK version; the default is 1.3.
-debug
Run the server in debug mode.
-msdev
Windows only - enable in-process debugging in Microsoft Visual C++. The required Microsoft Visual C++ environment settings must be in effect for the server process. If necessary, add the Microsoft Visual C++ settings to the bin\user_setenv.bat file.
-xterm
UNIX only - run the server in a new window opened by xterm.
-jvmtype [classic | client |
server]
Specify which Java VM to use:
  • Classic - classic Java VM
  • Client - HotSpot Client VM
  • Server - HotSpot Server VM


On Solaris, if you use JDK 1.2, you must run the classic Java VM; if you use JDK 1.3, you can run either of the HotSpot VMs.

On Windows NT or Windows 2000, if you run JDK 1.2, the default is the HotSpot Server VM; if you run JDK 1.3, the default is the HotSpot Client VM.
-install | -uninstall | 
-remove | -removeandinstall | 
-stop | -start | -c
Windows only - these options apply to servers that run as NT services:
  • -install installs the server as an NT service.
  • -uninstall and -remove uninstalls the server from the list of NT services.
  • -removeandinstall removes the server from the list of NT services, then reinstalls it.
  • -stop shuts down a server that has been installed as an NT service. You can also stop the server using the NT Services dialog in the Control Panel, or from Jaguar Manager.
  • -start starts a server that has been installed as an NT service. When installed as an NT service, the server starts automatically when NT starts. Use this option only after you have stopped or shut down the server.
  • -c (the default) starts the server as a console application. Use this option if you have configured the server to run as an NT service, but you want to run it in a console.
-v
Windows only - displays version information in the console then exits.

"Operating system configuration" describes how to set environment variables that you may need to run the server.

Steps Starting a server in UNIX

  1. Add the location of the X-Windows xterm utility to your path variable. For example:
    set path = ($path /usr/local/SUNWmotif/bin/)
    
  2. Edit the $JAGUAR/bin/setenv.sh shell script. Change the JAGUAR variable to the EAServer home directory, then run the serverstart.sh script, using this syntax:
    serverstart.sh [-servername server] [-jdk12 | -jdk13] [-debug] \
       [-xterm] | [-jvmtype classic | client | server]
    


    See Table 3-9 for a description of the server options.

Note  

Debug and JDK 1.3 servers Debug-mode servers allow you to remotely debug components from tools that support EAServer component debugging, such as PowerBuilder or PowerJ. You cannot run the debug-mode server unless you installed the debug libraries and binaries. The debug server cannot run as an NT service.

EAServer can run with your choice of Java runtime engines, including Sun JDK 1.2 or 1.3. You must run EAServer with JDK 1.3 to use the full set of available features.


Running servers in the background

You should run production servers in the background with the nohup command. This allows you to log out of the system without shutting down the server.

To run a server in the background, change to the $JAGUAR directory, and run this command:

nohup ./serverstart.sh -servername server > serverconsole.log 2>&1 serverconsole.log &

where server is the server name as displayed in Jaguar Manager. nohup runs the server and prevents its shutdown when you log out. Console output (stderr and stdout) is directed to a file named serverconsole.log.

Steps Starting a server in Windows

  1. Change to the %JAGUAR%\bin directory, and run serverstart.bat using this syntax:

    serverstart [-servername server] [-jdk12 | -jdk13] [-debug] \
       [-msdev] [-jvmtype classic | client | server] \
       [-install | -uninstall | -remove | -removeandinstall | \
        -stop | -start | -c] [-v]
    


    See Table 3-9 for a description of the server options.

Starting servers that are installed as NT services

If a server is installed as an NT service, the server is started automatically whenever you start NT. To start a service manually, you can use the Services dialog in the Windows NT Control Panel, as follows:

  1. On the NT desktop, select Start | Settings | Control Panel.
  2. Double-click the Services icon.
  3. In the list of Services, find the name of your server (for example, the preconfigured server is "Jaguar"). To stop the server, highlight the server name and click Stop. To start the server, highlight the name and click Start.

You can also run this command in the EAServer bin subdirectory:

serverstart -servername service_name -start
where service_name is the name of the server. To stop the server, use:
serverstart -servername service_name -stop

Installing servers as NT services

You should install production servers as NT services, so the server starts automatically when NT starts. Do not install development servers as NT services, since you will often want to run the debug server on your development machine, and you cannot run the debug server as an NT service.

Steps Installing a server as an NT service

  1. If the server is not running, start it on the desktop.
  2. Start Jaguar Manager and connect to the server using Jaguar Manager. See "Starting Jaguar Manager" for instructions.
  3. In Jaguar Manager, display the Server Properties dialog box by highlighting the server's icon and choosing File | Server Properties. On the Java VM tab, select the Java runtime to be used by the server.
  4. Configure any environment variables required for the server process. The JAGUAR, PATH, CLASSPATH, BOOTCLASSPATH, and BOOTLIBRARYPATH environment variables are saved in the Windows Registry when you install the server as a service. These variables keep the values they have when the server is installed as a service. Other variables must be set in the server properties file, using the All Properties tab to specify values as described in Environment variable properties. Settings in the startup scripts (serverstart.bat, setenv.bat, and user_setenv.bat) do not apply when the server runs as a service.
  5. Shut down the server by highlighting its icon and choosing File | Shutdown.
  6. Depending on which JDK you configured, run one of the following commands in the Jaguar bin subdirectory, specifying the server name in place of server:

    For JDK 1.2:
    serverstart -servername server -jdk12 -install
    


    For JDK 1.3:
    serverstart -servername server -jdk13 -install
    

Steps Removing a server from the list of NT services

  1. Run the command:

serverstart -servername servicename -remove
where servicename is the name of the server as displayed in the Services dialog in the Windows NT Control Panel.


Note  

Edit service names separately If you delete a server definition in Jaguar Manager after installing an NT service for that server, run the serverstart command to remove the server from the list of services.

Determining server version level

Run the following command from the %JAGUAR%\bin directory:

serverstart -servername server -v

This command displays the version of the server, without starting the server.

Using the JagRepair server

You can use the JagRepair server when you cannot start your server; for example, if you have specified incorrect Object Transaction Service (OTS) settings which prevent the server from starting and makes it impossible to correct the problem. The JagRepair server is read-only and provided for repair purposes only.

Steps Starting and connecting to the JagRepair server

  1. Change to EAServer's bin directory and enter:
  2. Start Jaguar Manager.
  3. Select Tools | Connect | Jaguar Manager and enter:

  4. Click Connect.

 


Copyright © 2002 Sybase, Inc. All rights reserved.