Project Deployment (Magic xpi 4.13)
It is recommended that you deploy Magic xpi projects to a shared folder, accessible by all application servers. Although a shared folder is potentially a single point-of-failure, with today’s storage systems this type of resource is usually highly redundant by itself.
Deploying a project involves copying each project’s folder from the development/staging environment to the designated shared folder location. For projects with connections to external resources (such as databases or enterprise systems), it might be necessary to edit the configuration using the Settings dialog box's Resources or Services sections with the relevant server connections and credentials.
You can create a file called projectsStartup.xml that tells Magic xpi to automatically start your projects and servers when the Magic xpi service deploys the Magic Space.
The structure of the projectsStartup.xml file is identical to the structure of the start.xml created under each project.
-
Make a copy of the start.xml file or the projectsStartup.xml.example file, which is located in the config folder.
-
Make the changes that you want, name it projectsStartup.xml and save it to the config folder.
The startup sequence of the grid is as follows:
-
The Grid Service Agent (GSA) is started 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.
-
One of the GSAs that started successfully deploys the Magic Space. This Magic 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, creating a ServerData object for each of the servers. This enables projects to start automatically.
-
The GSA receives a command from the Space to run the Magic xpi engines. This is based on the list of ServerData objects that were created in the Space as part of the deployment and automatic startup process.
-
For each project that is deployed, the first Magic xpi server that starts is responsible for initiating the project's metadata objects in the Magic Space to enable the projects to start.
Click here to see an example of a projectsStartup.xml file that defines the startup configuration of a sample project called Demo1.
This example file configures the following settings:
-
The project’s shared folder is \\10.1.1.6\projects.
-
The project folder is \\10.1.1.6\projects\Demo1.
-
Each application server will start one server process/instance.
-
APP1 will start 5 workers, and will run all the triggers, the Autostart, and the Scheduler.
-
APP2 will start 3 workers, without loading any triggers, without running any Autostart flows, and without running the Scheduler.
-
APP3 will start 5 workers with triggers, but without the Autostart or the Scheduler.
-
Each application server will set its alternateHosts property to point to the two other application servers. This is done to ensure that if one of the hosts is unavailable, the server defined to run on this host will start on one of the other defined hosts.
The shared projects folder is configured using the ProjectsDirPath attribute. Note that you can define the same folder for all application servers, or have each server access a local projects folder.
|
You can also define where each trigger will run and split the triggers between the engines. Since version: 4.1
|
The Magic Monitor locates the Space using the settings defined in the runwebmonitor.bat file, which is located under the <Magic xpi installation>\Runtime\RTView\magicmonitor folder.
Projects can be started from the command line. To start a project from the command line:
-
Go the Start link in the project’s folder.
-
Right-click and select the Properties option.
-
Find the Target field. The text in the field will look something like this:
"D:\Magic xpi\Magic xpi 4 GS 11_12\MgxpiCmdl.bat" start-servers -startup-config-file "D:\Magic xpi\Magic xpi 4 GS 11_12\projects\Project1\start.xml" -Space-name "MAGIC_SPACE" -group "Magicxpi-4.0.0_AVIW-7-LP" -locators ""
-
This path points to a specific start.xml file that is residing under the project. Change the path to load a different start.xml file whose configurations can load several projects.
-
Click OK.
Magic xpi lets you run the same project under different names and with different configuration files. For example, you can manually configure each project instance so that they run with a set of logical names that point to different customer databases.
To do this, follow these steps:
-
Create a folder named after the second project as a sibling of the original project folder.
-
Copy and paste the following files from the original project folder to the newly created folder:
-
-
In the start.xml file’s Name attribute, enter the second project’s name.
-
In the ifs.ini file, enter the second project’s name in the following entries:
-
-
In the ifs.ini file, enter the original project name in the following entries:
|
The currentprojectdir= and currentproject= entries always point to the original project folder.
|
Since version: 4.1