[mdrop@deployment1-1 newDeploy]$ cat config-new-environment.bat
@echo off
set DOMAIN=domain1
set CLUSTER=server
set MASTERIP=127.0.0.1
set NODE1=agent1
set INSTANCE1=ps1
set NODE2=agent2
set INSTANCE2=ps2
if "%1" == "" goto :ERROR
if "%2" == "" goto :ERROR
call %1"bin"asadmin stop-domain domain1
xcopy classes"*.* /s %1"domains"domain1"lib"classes
copy mysql-connector-java-5.1.5-bin.jar %1"domains"domain1"lib"ext
call %1"bin"asadmin start-domain domain1
call %1"bin"asadmin set server.java-config.classpath-suffix=%1"domains"domain1"lib"ext"mysql-connector-java-5.1.5-bin.jar
call %1"bin"asadmin set server.java-config.classpath-suffix=${com.sun.aas.instanceRoot}/lib/classes
call %1"bin"asadmin set server.system-property.com_outblaze_config_cobrand="C:"config"
call %1"bin"asadmin create-auth-realm --classname com.outblaze.glassfish.security.OBAppservRealm --property auth-type=obRealm:jaas-context=obRealm --target server obRealm
echo obRealm {com.outblaze.glassfish.security.OBPasswordLoginModule required;}; >> %1"domains"domain1"config"login.conf
call %1"bin"asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=root:Password=123:URL=jdbc":mysql"://localhost/pointsystem_sd --target server mysqlPool
call %1"bin"asadmin create-jdbc-resource --connectionpoolid mysqlPool --target server jndi/cobrandpsDS
call %1"bin"asadmin delete-jdbc-connection-pool --cascade=true --target server mysqlPoolOffline
call %1"bin"asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=root:Password=123:URL=jdbc":mysql"://localhost/pointsystem_off --target server mysqlPoolOffline
call %1"bin"asadmin create-jdbc-resource --connectionpoolid mysqlPoolOffline --target server jndi/cobrandpsDS_of
call %1"bin"asadmin delete-jdbc-connection-pool --cascade=true --target server mysqlPoolLog
call %1"bin"asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=root:Password=123:URL=jdbc":mysql"://localhost/wslog_stats_db --target server mysqlPoolLog
call %1"bin"asadmin create-jdbc-resource --connectionpoolid mysqlPoolLog --target server jndi/cobrandpsDS_log
call %1"bin"asadmin delete-jdbc-connection-pool --cascade=true --target server itemmallsqlPool
call %1"bin"asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=root:Password=123:URL="jdbc":mysql"://localhost/obcart" --target server itemmallsqlPool
call %1"bin"asadmin create-jdbc-resource --connectionpoolid itemmallsqlPool --target server jndi/itemmallDS
call %1"bin"asadmin delete-jdbc-connection-pool --cascade=true --target server mysqlPoolpsClusterTimer
call %1"bin"asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=root:Password=123:URL="jdbc":mysql"://localhost/glassfishtimer" --target server mysqlPoolpsClusterTimer
call %1"bin"asadmin create-jdbc-resource --connectionpoolid mysqlPoolpsClusterTimer --target server jndi/ps_cluster_timer
call %1"bin"asadmin set --user admin --port 4848 server-config.ejb-container.ejb-timer-service.timer-datasource=jndi/ps_cluster_timer
echo prepare for MQ
echo =============================================================================
call %1"bin"asadmin delete-jmsdest --desttype queue --target server ActiveMqQueue
call %1"bin"asadmin delete-admin-object --target server jms/ActiveMqQueue
call %1"bin"asadmin delete-connector-resource --target server jms/ActiveMQConnectionFactory
call %1"bin"asadmin delete-connector-connection-pool --target server jms/ActiveMQpool
call %1"bin"asadmin undeploy --target server activemq-rar-5.1.0
echo finished prepare for MQ
echo =============================================================================
echo start config for MQ
echo --------------------------------------------------------------------------------
XCOPY activeMQ_config"bin"*.* %2"bin" /k /y /z
XCOPY activeMQ_config"conf"*.* %2"conf /k /y /z
XCOPY activeMQ_config"webapps"admin"*.* %2"webapps"admin" /k /y /z
XCOPY activeMQ_config"webapps"admin"decorators"*.* %2"webapps"admin"decorators" /k /y /z
XCOPY activeMQ_config"webapps"admin"WEB-INF"*.* %2"webapps"admin"WEB-INF" /k /y /z
call %1"bin"asadmin deploy --user admin --host localhost --port 4848 --target server activemq-rar-5.1.0.rar
echo finished deploying activemq-rar-5.1.0.rar
call %1"bin"asadmin create-admin-object --raname activemq-rar-5.1.0 --restype javax.jms.Queue --property DestinationJndiName=ActiveMqQueue --target server jms/ActiveMqQueue
echo finished create admin object jms/ActiveMqQueue
call %1"bin"asadmin create-jmsdest --desttype queue --target server ActiveMqQueue
echo finished create jmsdest ActiveMqQueue
call %1"bin"asadmin create-connector-connection-pool --raname activemq-rar-5.1.0 --connectiondefinition javax.jms.ConnectionFactory --transactionsupport XATransaction --target server jms/ActiveMQpool
echo finished create connector connection pool jms/ActiveMQpool
call %1"bin"asadmin create-connector-resource --poolname jms/ActiveMQpool --target server jms/ActiveMQConnectionFactory
echo finished create connector resource jms/ActiveMQConnectionFactory
echo MQ Setup complete
echo --------------------------------------------------------------------------------
echo Shutting down Glassfish
call %1"bin"asadmin stop-domain domain1
echo Setup complete
goto :END
:ERROR
echo Please set glassfish base path and activeMQ path.
echo e.g. config-new-glassfish c:"glassfish c:"apache-activemq-5.1.0-bin
:END
posted on 2009-07-31 11:55
Blog of JoJo 阅读(391)
评论(0) 编辑 收藏 所属分类:
每日一记 、
My Script