Sei sulla pagina 1di 7

How to Start and Stop TIBCO Active Matrix Services Using Script.

Configuration Steps for Command Line Scipts. 1. Three four file are important for starting,start or doing any other action using command line utility provided by active matrix. a. admincmdline.exe b. admincmdline.tra c. build file

d. data file

2.

command for using command line utility is ../admincmdline.exe build.xml

3. First we need to create build file. In build file ( basically same as we do for ant deployment ), we specify the action on object that we need to do as well as the data file (this file specify the active matrix componenent details). 4. I have create one build file for start action and another for stop action.
<project default="sa-start"> <property file="login.properties"/>

<taskdef name="AMXAdminTask" classname="com.tibco.matrix.administration.command.line.ant.AMXAdminTask"/>

<target name="sa-start" description="Start service assembly"> <AMXAdminTask adminURL="http://localhost:8120/amxadministrator" username="${username}" password="${password}" action="start" dataFile="../samples/end_to_end_data.xml" objectSelector="Environment/ServiceAssembly" overwrite="true"

merge="true" createIfNotExists="true" force="true" failOnError="true"/> </target> </project>

5. User and password for admin is taken from login.properties property file. Please remember that
you may need to give user and obfustacated password in this file. Login.properties file is present in <home-dir>\tibco\amxadministrator\2.0\samples 6. action=start mean that this build file will start the active matrix service.

7. dataFile="../samples/end_to_end_data.xml" 8. objectSelector="Environment/ServiceAssembly"
9. Data file Reference in the Build File will look like this. You can take the sample provided and modify the data as per your environment like node name, environment etc.
<?xml version="1.0" encoding="UTF-8"?>

<!-README This data file accompanies build script end_to_end_build.xml.

It contains data for one machine, one environment, one messaging server, two nodes, six containers, two shared resources, one default connector, one service assembly, and two service units. -->

<amxdata_base:Enterprise xmlns:amxdata="http://tibco.com/amxadministrator/command/line/types" xmlns:amxdata_base="http://tibco.com/amxadministrator/command/line/types_base" xmlns:amxdata_detailed="http://tibco.com/amxadministrator/command/line/types_detailed" xmlns:amxdata_reference="http://tibco.com/amxadministrator/command/line/types_reference" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tibco.com/amxadministrator/command/line/types_base ../schemas/amxdata_base.xsd http://tibco.com/amxadministrator/command/line/types ../schemas/amxdata.xsd http://tibco.com/amxadministrator/command/line/types_detailed ../schemas/amxdata_detailed.xsd http://tibco.com/amxadministrator/command/line/types_reference ../schemas/amxdata_reference.xsd">

<Machine xsi:type="amxdata:Machine" hostName="01hw133316" tibcoHome="D:/tibco" managementURL="service:jmx:jmxmp://01hw133316:9998"/> <Environment xsi:type="amxdata:Environment" name="development"> <Machine hostName="01hw133316" tibcoHome="D:/tibco"/> <MessagingBus> <MessagingServer xsi:type="amxdata:MessagingServer" name="ms1" clientID="" username="admin" password=""> <DirectConfiguration providerURL="tcp://localhost:7222"/> </MessagingServer> </MessagingBus> <Node xsi:type="amxdata:Node" name="node1" hostName="01hw133316" tibcoHome="D:/tibco" productInstallDirectory="D:/tibco\amx\2.0" productVersion="2.0.0" managementPort="4432"> <Container type="com.tibco.matrix.container.soapbinding.runtime" version="2.0.0"/>

<Container type="com.tibco.matrix.container.javase.runtime" version="2.0.0"/> <Container type="com.tibco.matrix.container.jmsbinding.runtime" version="1.0.0"/> <SharedResource name="HTTP Server Shared Resource"/> <MessagingServer name="ms1"/> </Node>

<ServiceAssembly xsi:type="amxdata:ServiceAssembly" name="HelloWorld" archivePath="../samples/HelloWorld.zip" contact="ranjeet" exposeEndpoints="All" useLocalProviders="true" importSharedResourceConfiguration="true"> <ServiceUnit name="HelloJava"> <Node environmentName="development" nodeName="node1"/> </ServiceUnit> <ServiceUnit name="HelloSOAP"> <Node environmentName="development" nodeName="node1"/> </ServiceUnit> </ServiceAssembly> </Environment> </amxdata_base:Enterprise>

10. You need to put the SA zip (which is deployed in AM) at some location and give reference in
archivePath="../samples/HelloWorld.zip".

11. Procedure to start and stop. Below is screen shot for start and stop SA.

Manual Changes Cheklist for your environment 1. Changes adminURL=http://localhost:8120/amxadministrator in start_SA.xml to correct URL as per your admin and port. 2. Make sure that user and password is correct in login.properties file under D:\tibco\amxadministrator\2.0\samples. 3 .Repeat above point for stop_SA.xml file. 4.Copy start_SA.xml and stop_SA.xml files to D:\tibco\amxadministrator\2.0\samples location. 5.Take a backup of end_to_end_data.xml. I took back up of original file and then edit . 6.Copy the attached end_to_end_data.xml to D:\tibco\amxadministrator\2.0\samples location. 7.Change the environment and node name as well as service unit name to your s one. 8.Go to command prompt and type.
D:\tibco\amxadministrator\2.0\bin>admincmdline.exe D:\tibco\amxadministrator\2.0\samples\stop_SA.xml Buildfile: D:\tibco\amxadministrator\2.0\samples\stop_SA.xml sa-stop: [AMXAdminTask] INFO - Processing 1 objects [AMXAdminTask] INFO - Stopping service assemblies. [AMXAdminTask] INFO - Successfully stopped service assembly 'HelloWorld'. BUILD SUCCESSFUL Total time: 24 seconds D:\tibco\amxadministrator\2.0\bin>admincmdline.exe D:\tibco\amxadministrator\2. \samples\start_SA.xml Buildfile: D:\tibco\amxadministrator\2.0\samples\start_SA.xml

sa-start: [AMXAdminTask] INFO - Processing 1 objects [AMXAdminTask] INFO - Starting service assemblies. [AMXAdminTask] INFO - Successfully started service assembly 'HelloWorld'.

BUILD SUCCESSFUL Total time: 24 seconds

All the artifact are attached here. Start build file.

start_SA.xml

Stop build file

stop_SA.xml

Config File

end_to_end_data.x ml

SA File Data File

HelloWorld.zip

Potrebbero piacerti anche