<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    jojo's blog--快樂憂傷都與你同在
    為夢想而來,為自由而生。 性情若水,風起水興,風息水止,故時而激蕩,時又清平……
    posts - 11,  comments - 30,  trackbacks - 0
    [mdrop@deployment1-1 newDeploy]$ cat setup_gf.sh
    #!/bin/bash

    # Do not edit below , please supply variable in command line
    ACTION=$1
    COBRAND=$2
    GLASS_FISH=$3
    DOMAIN=domain1
    MASTERIP=$4
    ACTIVEMQ=$5
    INSTANCE_NO=$6
    JDBC_USER=$7
    JDBC_PASSWORD=$8
    JDBC_HOST=$9



    CLUSTER=ps-$COBRAND-cluster
    NODE=ps-$COBRAND-node-$INSTANCE_NO
    INSTANCE=ps-$COBRAND-instance-$INSTANCE_NO


    function common () {


    #those two command should be executed in master and slave machine
    cp mysql-connector-java-5.1.5-bin.jar $GLASS_FISH/lib
    cp obrealm.jar  $GLASS_FISH/lib
    cp -rf activeMQ_config/*  $ACTIVEMQ/

    if [ $ACTION = "master" ]; then
    $GLASS_FISH/bin/asadmin stop-domain $DOMAIN
    $GLASS_FISH/bin/asadmin start-domain $DOMAIN
    fi

    #run those following lines to stop cluster and node in the master machine
    if [ $ACTION = "master" ]; then
    $GLASS_FISH/bin/asadmin stop-cluster --user admin --host  $MASTERIP  --port 4848 $CLUSTER
    fi
    $GLASS_FISH/bin/asadmin stop-node-agent $NODE

    #run those following lines to delete node, cluster and instance in the master machine
    $GLASS_FISH/bin/asadmin delete-node-agent  $NODE
    if [ $ACTION = "master" ]; then
    $GLASS_FISH/bin/asadmin delete-cluster  $CLUSTER
    fi
    $GLASS_FISH/bin/asadmin delete-instance  $INSTANCE


    #run those following lines to create node, cluster and instance in the master machine
    $GLASS_FISH/bin/asadmin create-node-agent --host $MASTERIP --port 4848 $NODE
    if [ $ACTION = "master" ]; then
    $GLASS_FISH/bin/asadmin create-cluster --host $MASTERIP --port 4848 $CLUSTER
    fi
    $GLASS_FISH/bin/asadmin create-instance --host $MASTERIP --port 4848 --nodeagent $NODE --cluster $CLUSTER $INSTANCE



    #run those following lines to start node, cluster and instance in the master machine
    #bin/asadmin start-node-agent --syncinstances=true $NODE
    #bin/asadmin start-cluster --user admin --host $MASTERIP --port 4848 $CLUSTER
    #bin/asadmin start-instance --user admin --host $MASTERIP --port 4848 $INSTANCE

    }

    function master () {

    #cp -r classes/* $GLASS_FISH/domains/$DOMAIN/lib/classes/

    cp  activemq-rar-5.1.0.rar  $GLASS_FISH/

    #those two command should be executed in master and slave machine
    cp mysql-connector-java-5.1.5-bin.jar $GLASS_FISH/lib
    cp obrealm.jar  $GLASS_FISH/lib

    $GLASS_FISH/bin/asadmin stop-domain $DOMAIN
    $GLASS_FISH/bin/asadmin start-domain $DOMAIN



    $GLASS_FISH/bin/asadmin set $CLUSTER.java-config.classpath-suffix='${com.sun.aas.installRoot}/lib/mysql-connector-java-5.1.5-bin.jar'
    $GLASS_FISH/bin/asadmin set $CLUSTER.java-config.classpath-suffix='${com.sun.aas.installRoot}/lib/obrealm.jar'
    mkdir -p /usr/local/site/webroot/template/pointsystem/
    $GLASS_FISH/bin/asadmin set $CLUSTER.system-property.com_outblaze_config_cobrand='/usr/local/site/webroot/template/pointsystem/'
    $GLASS_FISH/bin/asadmin create-auth-realm --classname com.outblaze.glassfish.security.OBAppservRealm --property auth-type=obRealm:jaas-context=obRealm --target $CLUSTER obRealm

    echo "obRealm {com.outblaze.glassfish.security.OBPasswordLoginModule required;};" >> $GLASS_FISH/domains/$DOMAIN/config/login.conf

    $GLASS_FISH/bin/asadmin  set $CLUSTER.http-service.virtual-server.server.property.accessLoggingEnabled=true
    echo "finished setting the access log "

    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER mysqlPool
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/pointsystem_sd" --target $CLUSTER mysqlPool
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid mysqlPool --target $CLUSTER jndi/cobrandpsDS
    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER mysqlPoolOffline
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/pointsystem_off" --target $CLUSTER mysqlPoolOffline
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid mysqlPoolOffline --target $CLUSTER jndi/cobrandpsDS_of
    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER mysqlPoolLog
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/wslog_stats_db" --target $CLUSTER mysqlPoolLog
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid mysqlPoolLog --target $CLUSTER jndi/cobrandpsDS_log
    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER itemmallsqlPool
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/obcart" --target $CLUSTER itemmallsqlPool
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid itemmallsqlPool --target $CLUSTER jndi/itemmallDS

    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER mysqlPoolpsClusterTimer
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/glassfishtimer" --target $CLUSTER mysqlPoolpsClusterTimer
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid mysqlPoolpsClusterTimer --target $CLUSTER jndi/ps_cluster_timer

    $GLASS_FISH/bin/asadmin delete-jdbc-connection-pool --cascade=true --target $CLUSTER reportPool
    $GLASS_FISH/bin/asadmin create-jdbc-connection-pool --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --restype javax.sql.XADataSource --isolationlevel read-committed --isisolationguaranteed --property User=$JDBC_USER:Password=$JDBC_PASSWORD:URL="jdbc":mysql"://$JDBC_HOST/pointsystem_sd" --target $CLUSTER reportPool
    $GLASS_FISH/bin/asadmin create-jdbc-resource --connectionpoolid reportPool --target $CLUSTER jndi/reportDS

    $GLASS_FISH/bin/asadmin set $CLUSTER-config.ejb-container.ejb-timer-service.timer-datasource=jndi/ps_cluster_timer

    #$GLASS_FISH/bin/asadmin create-jvm-options --target $CLUSTER -Dcom.sun.enterprise.web.connector.enableJK=8012
    #$GLASS_FISH/bin/asadmin create-jvm-options --target $CLUSTER -DjvmRoute=glassfish1
    #$GLASS_FISH/bin/asadmin create-jvm-options --target $CLUSTER -DjvmRoute=glassfish2
    #$GLASS_FISH/bin/asadmin set $CLUSTER.java-config.classpath-prefix='${com.sun.aas.installRoot}/lib/patch.jar'
    #$GLASS_FISH/bin/asadmin set $CLUSTER.java-config.system-classpath='${com.sun.aas.installRoot}/lib/tomcat-ajp.jar,${com.sun.aas.installRoot}/lib/commons-modeler.jar,${com.sun.aas.installRoot}/lib/commons-logging.jar'


    }

    function setupmq () {


    echo "Prepare for MQ"
    echo "============================================================================="
    $GLASS_FISH/bin/asadmin delete-jmsdest  --desttype queue --target $CLUSTER ActiveMqQueue
    $GLASS_FISH/bin/asadmin delete-admin-object --target $CLUSTER jms/ActiveMqQueue
    $GLASS_FISH/bin/asadmin delete-connector-resource --target $CLUSTER jms/ActiveMQConnectionFactory
    $GLASS_FISH/bin/asadmin delete-connector-connection-pool --target $CLUSTER jms/ActiveMQpool
    $GLASS_FISH/bin/asadmin undeploy --target $CLUSTER activemq-rar-5.1.0
    echo "finished prepare for MQ"
    echo "============================================================================="


    echo "Start config for MQ"
    echo "--------------------------------------------------------------------------------"
    $GLASS_FISH/bin/asadmin deploy --target $CLUSTER activemq-rar-5.1.0.rar
    echo "finished deploying activemq-rar-5.1.0.rar"

    $GLASS_FISH/bin/asadmin create-admin-object --raname activemq-rar-5.1.0 --restype javax.jms.Queue --property DestinationJndiName=ActiveMqQueue --target $CLUSTER jms/ActiveMqQueue
    echo "finished create admin object jms/ActiveMqQueue"

    $GLASS_FISH/bin/asadmin create-jmsdest --desttype queue --target $CLUSTER ActiveMqQueue
    echo "finished create jmsdest ActiveMqQueue"

    $GLASS_FISH/bin/asadmin create-connector-connection-pool --raname activemq-rar-5.1.0 --connectiondefinition javax.jms.ConnectionFactory --transactionsupport  XATransaction --target $CLUSTER jms/ActiveMQpool
    echo "finished create connector connection pool jms/ActiveMQpool"

    $GLASS_FISH/bin/asadmin create-connector-resource --poolname jms/ActiveMQpool --target $CLUSTER jms/ActiveMQConnectionFactory
    echo "finished create connector resource jms/ActiveMQConnectionFactory"

    echo "MQ Setup complete"
    echo "--------------------------------------------------------------------------------"


    }

    if [ $# != 9 ]; then
            echo $"Usage: $prog {master|slave cobrand_name glassfish_path DAS_hostname ActiveMQ_path instance_no mysql_username mysql_password mysql_host}"
            exit 1
    fi

    case "$1" in
      master)
            common
            master
            setupmq
            ;;
      slave)
            common
            ;;
      *)
            echo $"Usage: $prog {master|slave cobrand_name glassfish_path DAS_hostname ActiveMQ_path instance_no mysql_username mysql_password mysql_host}"
            exit 1
    esac

    posted on 2009-07-31 11:53 Blog of JoJo 閱讀(606) 評論(0)  編輯  收藏 所屬分類: 每日一記My Script

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(6)

    隨筆檔案

    文章分類

    文章檔案

    新聞分類

    新聞檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 午夜视频免费在线观看| 无套内射无矿码免费看黄| 精品亚洲永久免费精品| 国产成人精品曰本亚洲79ren| 另类图片亚洲校园小说区| 亚洲人成高清在线播放| 免费A级毛片在线播放| 久久精品亚洲中文字幕无码麻豆| 中文字幕无线码中文字幕免费 | 亚洲综合熟女久久久30p| 免费高清A级毛片在线播放| 免费一区二区视频| 人妻仑乱A级毛片免费看| 亚洲一区精品无码| 97se亚洲国产综合自在线| 亚色九九九全国免费视频| 久久国产亚洲精品| 免费一区二区三区| 亚洲欧洲日产韩国在线| 黄瓜视频高清在线看免费下载 | 久久精品国产精品亚洲色婷婷| 三年片在线观看免费观看大全动漫| 久久久久久久亚洲Av无码| 免费大片黄在线观看yw| 日本亚洲高清乱码中文在线观看| 日本免费人成在线网站| 亚洲毛片αv无线播放一区| 国产亚洲免费的视频看| 亚洲va成无码人在线观看| 91在线视频免费观看| 97se亚洲综合在线| 成人免费视频软件网站| 青青青视频免费观看| 亚洲国产精品久久久久久| 久久久WWW成人免费精品| 四虎影视永久免费观看网址| 亚洲制服丝袜第一页| www.亚洲色图.com| 亚洲精品av无码喷奶水糖心| AV片在线观看免费| 亚洲阿v天堂在线2017免费 |