Salesforce

Starting and Stopping the Magic xpi Project (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Starting and Stopping the Magic xpi Project (Magic xpi 4.13)

The following diagram explains what happens when you start a Magic xpi project.

  1. Starting a project can be done manually in one of the following ways:

    • By clicking the link. The Start link is created in the project’s directory when the project is built. The link points to the start.xml configuration file.

    • By clicking the Start option from the Monitor or the Debugger. This option also uses the start.xml file that is in the project folder.

Or automatically:

    • By creating a file called projectsStartup.xml and saving it in the <Magic xpi installation>\Runtime\Config folder.

      When the Magic xpi service starts and manages to deploy the Magic Space, it will automatically start the projects and servers that are listed in the projectsStartup.xml file. The structure of the projectsStartup.xml is identical to the structure of the start.xml created under each project.

  1. The options in step 1 create a server entity (or entities) in the Magic Space with the metadata from the project’s start.xml file, a unique ID and a status of START_REQUESTED.( You can see the server entities and the statuses in the Monitor.) Every time you start the project, another instance of the entity is created in the Magic Space.

  2. The Magic processing unit scans the Magic Space looking for server entities whose status is START_REQUESTED.

  3. Once the processing unit finds a server entity with a status of START_REQUESTED, it scans for the Grid Service Agent (GSA) according to the host name or IP address defined in the server entity, which is based on the start.xml file. The Magic processing unit passes all of the parameters/startup information defined in this server entity to the GSA. If the GSA is not available, the processing unit will keep checking at a later stage to see if it is available.

In the start.xml file, you can define machines that are not running or you can define that the GSA is not running. You can start the GSA on those machines when the workload is high. Once the GSA loads, the Magic processing unit will find it and the cycle will begin.

  1. The GSA running on the host machine specified in the server entity starts the Magic xpi Server (the MgxpiServer.exe process, also known as the engine) according to the parameters passed to it from the Magic processing unit.

    • If a project is not running, the first MgxpiServer.exe process that starts will create the project by loading the project entity to the Magic Space.

    • If a project is running already, the loaded MgxpiServer.exe process will join the existing project and add its own workers and triggers to the work force.

  1. One of the parameters passed to the Magic xpi project is also the ID of the server entity created in the Space. When the Magic xpi server registers, it connects to the Magic Space and searches for the server entity identified by the ID and updates the status to RUNNING. For more information about the project's running sequence, click here.

  2. The server can now start handling requests.

Stopping a project can be done by:

  • Clicking the link. The Stop link is created in the project’s directory when the project is built.

  • By clicking the Stop option from the Monitor or the Debugger.

Startup Failed

If a server entity’s status remains as START_REQUESTED and does not change to RUNNING, the Magic processing unit checks with the GSA to see whether the actual process is running. If the process is not running, the server entity’s status will change to START_FAILED. If the process is running, the Magic processing unit will first instruct the GSA to terminate the process and then it will update the server entity with START_FAILED.

Information about why the startup fails and how to deal with this are discussed in the Troubleshooting section.

Reference
Attachment 
Attachment