Configuring Servers and Projects to Start Automatically (Automatic Provisioning) (Magic xpa 4.x)
When the Magic Space is deployed, the Grid Service Agent (GSA) automatically loads Magic servers to serve projects defined in the projectsStartup.xml file in the GigaSpaces-xpa\config folder. You will need to update this file with the Magic projects and servers’ details. In this file, any declaration at the Server level will override the declaration at the project level.
Recommendation: Place the projectsStartup.xml in a shared network location and set GigaSpaces-xpa\bin\setenv.bat in all of the cluster’s machines to access the same file. For example: set PROJECTS_STARTUP_XML=\\MyServer\config\projectsStartup.xml.
Note:
-
Different projectsStartup.xml files can be used across the grid – during startup by the StartProjects.bat file and by the GigaSpaces Monitor.
-
You can define repetitive values once in the CMDLineArgs attribute (optional) in the Projects element. For example: <Projects CMDLineArgs="/InternetDispatcherPath=/MagicScripts/MGWebRequester.dll /LicenseName=MGENT1 /MaxConcurrentUsers=100 /MaxConcurrentRequests=10">
-
When starting projects using the GS-agent (from the projectsStartup.xml file), the project name is automatically taken from the ApplicationPublicName environment setting.
When the space is deployed on multiple servers, you should:
-
Configure the GSA in all of the servers to deploy the space and start the Magic xpa servers. This is done in the gs-agent.bat file, found in the GigaSpaces-xpa\bin folder as follows: gsa.deployAndStartProjects 1
-
Start two local LUSs (LookUp Services) and two global GSMs (Grid Service Managers):
a. In two pre-selected machines, set gsa.lus 1 in the gs-agent.bat file.
b. In each machine in which a GSA is started, set gsa.global.gsm 2.
For an explanation about local and global setup refer to GigaSpaces's documentation by going to Home > Administration > Runtime Configuration For example (GigaSpaces V10.1): http://docs.gigaspaces.com/xap101adm/runtime-configuration.html.
-
In the setenv.bat file, found in the GigaSpaces-xpa\bin folder, set: XAP_LOOKUP_LOCATORS=host1,host2 (where host 1 and host 2 are the two machines where the LUSs were started).
This setup should be applied in the setenv.bat file of each machine in which a GSA is started.
-
Similarly, in each Web requester's Mgreq.ini file (found in Scripts\config), set LookupLocators=host1,host2.
-
Similarly, in the GS monitor, set host1,host2 in the Connection details.
-
It is recommended that you refer to the Log Files and Unknown Errors topic for an explanation on directing all log files to a central location.
Space Startup Sequence
The startup sequence of the grid is as follows:
-
The GSA is started (usually as a service) on each application server that is part of the grid. The Grid Service Agent starts the core grid infrastructure to connect all application servers together.
-
The first GSA deploys the Magic Space and starts the projects. This Space contains all Magic-related objects that are shared across the grid.
-
The same GSA also deploys the projectsStartup.xml information into the Magic Space to enable projects to start automatically.
-
All GSAs in the grid load the Magic xpa servers as defined.
The following example of a projectsStartup.xml file defines a start-up configuration of the test application GigaSpaces-xpa\test\GSTest.ecf:
This example file configures the following settings:
-
The application will be started on two server machines: Server1 and Server2.
-
Server1 will start two Magic xpa servers (engines), each with ten worker threads.
-
Server2 will start one Magic xpa server (engine) immediately and another on demand (if all other engines will be busy), each with five worker threads. Each engine will be limited to 200 contexts.
Note:
-
You can have each server start a different application (<StartApplication> in the <Server level). However, it is recommended to use the same application for all of the servers, from a shared location, as shown in the <Project element.
-
To use an @ini file with a space in its names, wrap the file name with single quotes.