Related Topics |
---|
Overview of Spatial Servers, Virtual Servers, and ArcIMS services ADMINCMD in the ArcXML Programmer's Reference Guide |
ArcIMS services, Spatial Servers, and Virtual Servers can be managed from the command line. In addition, information about an ArcIMS site can be retrieved using the command line. To manage ArcIMS from the command line, the ArcIMS Servlet Connector must be installed on the Web server.
You can do most of the tasks you do in Administrator using the command line. The exception is managing MapNotes and EditNotes. One of the advantages of the command line is it allows you to automate processes such as starting, stopping, and refreshing ArcIMS services.
To administer ArcIMS services, Spatial Servers, and Virtual Servers from the command line you must create two files:
The ADMINCMD xml file contains the instructions for adding or removing ArcIMS services, Spatial Servers, and Virtual Servers, and starting or stopping of ArcIMS services. Before you continue, you should be familiar with the terms Spatial Server, Virtual Server, and ArcIMS service.
The following table lists tags available for command line administration:
Tag | Description |
---|---|
ADMINCMD | Root element. |
SERVICES and SERVICE | Used for managing ArcIMS services. |
PSERVERS and PSERVER | Used for managing Spatial Servers |
VSERVERS and VSERVER | Used for managing Virtual Servers. |
The following examples show typical xml files for managing ArcIMS services and servers from the command line.
During administration, starting a service is a two-step process: first add the service and then start it. Each service type also has a set of required attributes. See SERVICE for descriptions of these attributes. The following example shows starting one of each type of service.
<?xml version="1.0"?> <ADMINCMD version="1.0"> <SERVICES> <!--Add and start an Image Service--> <SERVICE type="add" name="world_image" axl="c:\arcims\axl\world.axl" vsname="ImageServer1" imgloc="c:\arcims\output" imgurl=http://mycomputer.domain.com/output imagememory="4" cleanup="20" imgtype="GIF" /> <SERVICE type="start" name="world_image" /> <!--Add and start an ArcMap Image Service--> <SERVICE type="add" name="world_arcmap" axl="c:\arcims\axl\world.mxd" vsname="ImageServerArcMap1" imgloc="c:\arcims\output" imgurl=http://mycomputer.domain.com/output imagememory="4" cleanup="20" imgtype="JPG" /> <SERVICE type="start" name="world_arcmap" /> <!--Add and start a Feature Service--> <SERVICE type="add" name="world_feature" axl="c:\arcims\axl\world.axl" vsname="FeatureServer1" /> <SERVICE type="start" name="world_feature" /> </SERVICES> </ADMINCMD> |
When a service is refreshed in Administrator, it is actually removed, added, and started again. Therefore, the xml file for refreshing services must follow the same sequence.
<?xml version="1.0"?> <ADMINCMD version="1.0"> <SERVICES> <!--Refresh (remove, add, and start) an Image Service--> <SERVICE type="remove" name="world_image" /> <SERVICE type="add" name="world_image" axl="c:\arcims\axl\world.axl" vsname="ImageServer1" imgloc="c:\arcims\output" imgurl=http://mycomputer.domain.com/output imagememory="4" cleanup="20" imgtype="GIF" /> <SERVICE type="start" name="world_image" /> <!--Refresh (remove, add, and start) an ArcMap Image Service--> <SERVICE type="remove" name="world_arcmap" /> <SERVICE type="add" name="world_arcmap" axl="c:\arcims\axl\world.mxd" vsname="ImageServerArcMap1" imgloc="c:\arcims\output" imgurl=http://mycomputer.domain.com/output imagememory="4" cleanup="20" imgtype="JPG" /> <SERVICE type="start" name="world_arcmap" /> <!--Refresh (remove, add, and start) a Feature Service--> <SERVICE type="remove" name="world_feature" /> <SERVICE type="add" name="world_feature" axl="c:\arcims\axl\world.axl" vsname="FeatureServer1" /> <SERVICE type="start" name="world_feature" /> </SERVICES> </ADMINCMD> |
By default, the ArcIMS Application Server starts one Spatial Server process on every machine with a registered Monitor. If you have installed ArcMap Server, two additional Spatial Server processes start. If you need more than the default number of Spatial Servers, you need to add them. You then must associate any newly added Spatial Servers to a Virtual Server. When using the command line, you can associate new Spatial Servers to new Virtual Servers but not to existing Virtual Servers.
Before you can add the Spatial Servers, you will need to determine their name ahead of time. Spatial Servers are numbered sequentially. Once you have this information, you can add them to Virtual Server groups.
Machine | Default Spatial Servers | New Spatial Server you add |
---|---|---|
machinea | machinea_1 machinea_2 machinea_3 |
machinea_4 |
machineb | machineb_1 | machineb_2 |
In the following example, one Spatial Server is added to "machinea", and a second Spatial Server is added to "machineb". The machine name may be case sensitive. Both of these Spatial Servers are added to ImageServer2. See VSERVER for a description of the attributes.
<?xml version="1.0"?> <ADMINCMD version="1.0"> <PSERVERS> <PSERVER type="add" machine="machinea"/> <PSERVER type="add" machine="machineb"/> </PSERVERS> <VSERVERS> <VSERVER type="add" name="ImageServer2" access="Public" description="ImageServer Example" servicetype="ImageServer" version="" > < PSERVER id="machinea_4" threads="2"/> < PSERVER id="machineb_2" threads="2"/> </VSERVER> </VSERVERS> </ADMINCMD> |
The following example is a combination of the previous examples. This example can be used as a backup or alternative to the site configuration file (ArcIMSSite.sez). First, two Spatial Servers (PSERVER) are added. Next they are associated with a Virtual Server (VSERVER). Once this association is made, a service can be added.
<?xml version="1.0"?> <ADMINCMD version="1.0"> <PSERVERS> <PSERVER type="add" machine="machinea"/> <PSERVER type="add" machine="machineb"/> </PSERVERS> <VSERVERS> <VSERVER type="add" name="ImageServer2" access="Public" description="ImageServer Example" servicetype="ImageServer" version="" > < PSERVER id="machinea_4" threads="2"/> < PSERVER id="machineb_2" threads="2"/> </VSERVER> </VSERVERS> <!--Add and start an Image Service--> <SERVICE type="add" name="world_image" axl="c:\arcims\axl\world.axl" vsname="ImageServer2" imgloc="c:\arcims\output" imgurl=http://mycomputer.domain.com/output imagememory="4" cleanup="20" imgtype="GIF" /> <SERVICE type="start" name="world_image" /> </ADMINCMD> |
The following example shows how to remove services. You must first stop the service before removing it.
<?xml version="1.0"?> <ADMINCMD version="1.0"> <SERVICES> <SERVICE type="stop" name="world_image" /> <SERVICE type="remove" name="world_image" /> </SERVICES> </ADMINCMD> |
You can remove Spatial Servers and Virtual Servers using the command line. You must be careful with these operations since some of the safeguards provided through Administrator and Service Administrator are not present in the command line. In Administrator you must first remove all services associated with a Spatial Server you want to remove. This safeguard is not in the command line. Therefore, you can delete both Spatial Servers and Virtual Servers without first removing services.
You can also delete both the default Spatial Servers and Virtual Servers, such as mymachine_1 and ImageServer1, respectively. It is recommended that you never delete either the default Spatial Servers or Virtual Servers. If you do, your site will no longer run correctly.
The following example shows removing a Spatial Server and Virtual Server.
<PSERVERS> <PSERVER type="remove" machine="mymachine" id="mymachine_4"/> <PSERVER type="remove" machine="mymachine" id="mymachine_5"/> </PSERVERS> <VSERVERS> <VSERVER type="remove" name="ImageServer2"/> </VSERVERS> </ADMINCMD> |
You can get different statistics on ArcIMS services, Spatial Servers, and Virtual Servers using the following key words.
Command | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SERVICE | Lists service names, the configuration files used, and the virtual server each service is running on. | ||||||||||||||||||
VSERVER | Lists each ArcIMS Spatial Server and the number of instances within each ArcIMS Virtual Server for the host site. | ||||||||||||||||||
PSERVER | Lists each ArcIMS Spatial Server ID and its host. | ||||||||||||||||||
MONITOR | Lists each host that an ArcIMS Monitor is running on. | ||||||||||||||||||
SAVE | Saves the current ArcIMS configuration. | ||||||||||||||||||
STATS | Gives the information described in the following table for each Virtual Server. The fields described in this table correspond to fields that display when you view Virtual Server statistics from within Administrator. For more information, see the statistics section of Managing ArcIMS Virtual Servers using Administrator.
|
||||||||||||||||||
SERVICESTATS | This command pings a service. If a machine name is returned, the service is running successfully. | ||||||||||||||||||
VSERVICESTATS | This command pings a Virtual Server. If a machine name is returned, the Virtual Server is running successfully. |
Windows: The batch file contains one line.
<jre directory>/java com.esri.aims.admincore.cmd.Exec http://mymachine.domain.com Username Password file filename |
Where:
The above command can also be typed on the command line in lieu of using the batch file.
UNIX or Linux: A script file is used containting the following lines. In the following example, note that the line beginning with "java -cp" is all one line:
#!/bin/csh setenv JARHOME $AIMSHOME/Manager/lib setenv AIMSHOST $argv[1] java -cp $JARHOME/jaxp.jar:$JARHOME/parser.jar:$JARHOME/esri_mo10.jar: $JARHOME/esri_mo10res.jar:$JARHOME/arcims_admincore.jar:$JARHOME/arcims_admin.jar: $JARHOME/jcert.jar:$JARHOME/jnet.jar:$JARHOME/jsse.jar:$JARHOME/arcims_resadmin.jar com.esri.aims.admincore.cmd.Exec http://$AIMSHOST Username Password file $argv[2] |
Where:
<jre directory>/java com.esri.aims.admincore.cmd.Exec http://mymachine.domain.com Username Password cmd <COMMAND> |
Where:
The ArcIMS jar files must be included in the JRE bin directory you are referencing: jaxp.jar, parser.jar, esri_mo10.jar, esri_mo10res.jar, arcims_admincore.jar, arcims_admin.jar, jcert.jar, jnet.jar, jsse.jar, arcims_resadmin.jar. These jar files can be found in the following locations:
Windows: <ArcIMS install location>\ArcIMS\Jre\Lib\Ext
UNIX and Linux: $AIMSHOME/lib/ext.