Project Deployment (Magic xpi 4.1)
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 Magic xpi’s Resource Repository or Service Repository 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.
-
The first GSA that starts successfully is responsible for deploying the Magic Space. The 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 to enable projects to start automatically.
-
All GSAs in the grid query the projectsStartup.xml information in the Magic Space, and load the Magic xpi servers as defined.
-
For each project that is deployed, the first Magic xpi server that starts is responsible for initiating the project objects in the Magic Space to enable the projects to start.
-
For each project, a start.xml file is created automatically in the project folder.
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.
Note:
|
You can also define where each trigger will run and split the triggers between the engines. Since version: V4.1
|
|
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:
Note:
|
The currentprojectdir= and currentproject= entries always point to the original project folder.
|
|
Since version: V4.1
The new Magic Monitor locates the Space using the settings defined in the run_displayserver.bat file, which is located under the <Magic xpi installation>\RTView\magicmonitor folder.
The new Web Monitor shows the projects based on the ApplicationsList.xml file, which is located in the config folder. By default, this file is set to display the projects that are saved to the projects folder.
-
Copy the text in the file, which is the following, by default, and paste it as a new instance underneath the existing instance:
-
In the new section, change the word default to another name, such as deployment.
-
In the new section, change the path to point to the shared drive, such as \\10.1.1.6\projects.
-
Save the file.
-
Refresh the Web Monitor to apply the settings by clicking the Magic xpi tab and then the Browse all projects link.
Backward Compatibility
There are two options for Monitor configurations:
-
If the project folder is not accessible to the Monitor, you can copy it locally as follows:
-
If the project is accessible on the network, the Monitor shows the projects based on the [MAGIC_IBOLT]MPSProjects entry in the ifm.ini file, and runs the projects based on the %projects% environment variable. Follow these steps:
-
Modify the [MAGIC_IBOLT]MPSProjects entry to point to the shared drive (\\10.1.1.6\projects).
-
In the ifm.ini file, create a [MAGIC_LOGICAL_NAMES]projects entry and point to the same shared drive.
-
Restart the Monitor to apply the settings.
Make sure that the Database configuration information in the Monitor installation (in the Magic.ini file) and in the ifs.ini (ifs.<project name> in IBM i) file is the same as in the production server's Magic.ini file. The configuration parameters are:
-
The Database identification (DB name for MySQL and DB2, Connect String for Oracle, and the ODBC Data source for databases connected with the ODBC protocol).
-
Server Name: The name of the machine where the Magic xpi Server is installed.
-
User: The user system name.
-
Password: The user’s password.
Make sure the date format in the [MAGIC_LOGICAL_NAMES] section of the Magic xpi Monitor’s Magic.ini file is the same as the format for the Magic xpi Server.
Copy the contents of the Project folders to the Magic xpi Monitor’s Project folder. Make sure not to change the names or structure of the files.
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.