Commit 6029a3e2 authored by iSergio's avatar iSergio
Browse files

Fix

parent ce3ea952
Loading
Loading
Loading
Loading
+34 −32
Original line number Diff line number Diff line
@@ -179,7 +179,6 @@ cp -rf modules/* ${JBOSS_HOME}/modules/system/layers/base/
chown as7 ${JBOSS_HOME} -R

# Turn on domain mode for as7
chkconfig as7-standalone off
service as7-standalone stop
chkconfig as7-domain on
service as7-domain restart
@@ -191,7 +190,8 @@ result=`jboss-cli.sh --connect --commands="batch,
/server-group=main-server-group:remove(),
/server-group=other-server-group:remove(),
run-batch"` &>/dev/null
align_echo $? $result $result
align_echo $? "$result" "$result"

# Remove full-sockets, ha-sockets, standard-sockets
#/socket-binding-group=standard-sockets:remove(),
align_left "$DOTSTRING" "Remove full and ha sockets"
@@ -199,12 +199,14 @@ result=`jboss-cli.sh --connect --commands="batch,
/socket-binding-group=full-sockets:remove(),
/socket-binding-group=ha-sockets:remove(),
run-batch"` &>/dev/null
align_echo $? $result $result
align_echo $? "$result" "$result"

# First create standalone server group. Use it for non clustered application. Only one instace will be worked.
# If failover event, on standalone server must start on standby
align_left "$DOTSTRING" "Create standalone-server-group"
result=`jboss-cli.sh --connect --commands="/server-group=standalone-server-group:add(profile=default, socket-binding-group=standard-sockets)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Configure main-server-group jvm options
align_left "$DOTSTRING" "Configure standalone-server-group"
result=`jboss-cli.sh --connect --commands="batch,
@@ -221,12 +223,12 @@ result=`jboss-cli.sh --connect --commands="batch,
/server-group=standalone-server-group/jvm=default:add-jvm-option(jvm-option=\"-Dplanning.cfg=/etc/irz/planning\"),
/server-group=standalone-server-group/jvm=default:add-jvm-option(jvm-option=\"-Dfile.encoding=UTF-8\"),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Create correct main-server-group
align_left "$DOTSTRING" "Create cluster-server-group"
result=`jboss-cli.sh --connect --commands="/server-group=cluster-server-group:add(profile=full-ha, socket-binding-group=full-ha-sockets)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
# Configure main-server-group jvm options
align_left "$DOTSTRING" "Configure cluster-server-group"
reuslt=`jboss-cli.sh --connect --commands="batch,
@@ -243,7 +245,7 @@ reuslt=`jboss-cli.sh --connect --commands="batch,
/server-group=cluster-server-group/jvm=default:add-jvm-option(jvm-option=\"-Dplanning.cfg=/etc/irz/planning\"),
/server-group=cluster-server-group/jvm=default:add-jvm-option(jvm-option=\"-Dfile.encoding=UTF-8\"),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Remove default profile
function remove_default_profile {
@@ -354,26 +356,26 @@ function remove_full_profile {
# Third party configs
align_left "$DOTSTRING" "Configure thirdparty settings for defalt profile"
result=`jboss-cli.sh --connect --commands="/profile=default/subsystem=naming/binding=java\:global\/journal_settings:add(binding-type=object-factory,module=org.otdel414.commons,class=org.otdel414.journal.JournalSettings\$Factory,environment=[szi=\"enable:true\", out=\"enable:true,params:false,only_error:true\"])"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
align_left "$DOTSTRING" "Configure thirdparty settings for full-ha profile"
result=`jboss-cli.sh --connect --commands="/profile=full-ha/subsystem=naming/binding=java\:global\/journal_settings:add(binding-type=object-factory,module=org.otdel414.commons,class=org.otdel414.journal.JournalSettings\$Factory,environment=[szi=\"enable:true\", out=\"enable:true,params:false,only_error:true\"])"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Set max post size request
align_left "$DOTSTRING" "Configure max-post-size for default profile"
result=`jboss-cli.sh --connect --commands="/profile=default/subsystem=web/connector=http:write-attribute(name=max-post-size,value=0)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
align_left "$DOTSTRING" "Configure max-post-size for full-ha profile"
result=`jboss-cli.sh --connect --commands="/profile=full-ha/subsystem=web/connector=http:write-attribute(name=max-post-size,value=0)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Set transcations tumeout
align_left "$DOTSTRING" "Configure default-timeout for default profile"
result=`jboss-cli.sh --connect --commands="/profile=default/subsystem=transactions:write-attribute(name=default-timeout,value=300000)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
align_left "$DOTSTRING" "Configure default-timeout for default profile"
result=`jboss-cli.sh --connect --commands="/profile=full-ha/subsystem=transactions:write-attribute(name=default-timeout,value=300000)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Set user and password for HornetQ server
align_left "$DOTSTRING" "Configure HornetQ server"
@@ -381,17 +383,17 @@ result=`jboss-cli.sh --connect --commands="batch,
/profile=full-ha/subsystem=messaging/hornetq-server=default:write-attribute(name=cluster-user, value=jms-user),
/profile=full-ha/subsystem=messaging/hornetq-server=default:write-attribute(name=cluster-password, value=jms-pass),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Set instance-id for domain:web
align_left "$DOTSTRING" "Configure instance-id HornetQ server"
reuslt=`jboss-cli.sh --connect --commands='/profile=full-ha/subsystem=web:write-attribute(name=instance-id, value=\"${jboss.node.name}\")'` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Rename master -> primary
align_left "$DOTSTRING" "Rename server master -> primary"
result=`jboss-cli.sh --connect --commands="/host=master:write-attribute(name=name, value=$TYPE)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Configure interfaces
align_left "$DOTSTRING" "Configure interfaces"
@@ -400,17 +402,17 @@ result=`jboss-cli.sh --connect --commands="batch,
/host=master/interface=public:write-attribute(name=inet-address, value=0.0.0.0),
/host=master/interface=unsecure:write-attribute(name=inet-address, value=0.0.0.0),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

if [[ "$TYPE" == "standby" ]]; then
    # Disable local domain controller, attach to primary
    align_left "$DOTSTRING" "Disable local domanin controller"
    result=`jboss-cli.sh --connect --commands="/host=master:write-remote-domain-controller(host=$JBOSS_PRIMARY_HOST, port=9999, security-realm=ManagementRealm)"` &>/dev/null
    align_echo $? $result
    align_echo $? "$result"
    # Set secret value for standby user
    align_left "$DOTSTRING" "Configure ManagementRealm"
    result=`jboss-cli.sh --connect --commands="/host=master/core-service=management/security-realm=ManagementRealm/server-identity=secret:add(value=\"$STANDBY_BASE64\")"` &>/dev/null
    align_echo $? $result
    align_echo $? "$result"
fi

# Create standalone server
@@ -422,32 +424,32 @@ else
fi
align_left "$DOTSTRING" "Create server-standalone $TYPE"
result=`jboss-cli.sh --connect --commands="/host=master/server-config=server-standalone:add(group=standalone-server-group, auto-start=$auto_start)"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Recreate server-one
align_left "$DOTSTRING" "Stop server-one"
result=`jboss-cli.sh --connect --commands="/host=master/server-config=server-one:stop()"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
align_left "$DOTSTRING" "Recreate server-one"
result=`jboss-cli.sh --connect --commands="batch,
/host=master/server-config=server-one:remove(),
/host=master/server-config=server-one:add(group=cluster-server-group, socket-binding-port-offset=150, auto-start=true),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
# Recreate server two
align_left "$DOTSTRING" "Stop server-two"
result=`jboss-cli.sh --connect --commands="/host=master/server-config=server-two:stop()"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
align_left "$DOTSTRING" "Recreate server-two"
result=`jboss-cli.sh --connect --commands="batch,
/host=master/server-config=server-two:remove(),
/host=master/server-config=server-two:add(group=cluster-server-group, socket-binding-port-offset=300, auto-start=true),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
# Remove server-three
align_left "$DOTSTRING" "Remove server-three"
result=`jboss-cli.sh --connect --commands="/host=master/server-config=server-three:remove()"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Set controllers memory usage
align_left "$DOTSTRING" "Reconfigure controllers"
@@ -456,7 +458,7 @@ result=`jboss-cli.sh --connect --commands="batch,
/host=master/jvm=default:add(heap-size=$HOST_HEAP_SIZE, max-heap-size=$HOST_MAX_HEAP_SIZE, permgen-size=$HOST_PERMGEN_SIZE, max-permgen-size=$HOST_MAX_PERMGEN_SIZE),
/host=master/jvm=default:add-jvm-option(jvm-option="\""-server"\""),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"
#jboss-cli.sh --connect --commands="/host=master/jvm=default:add-jvm-option(jvm-option="\""-Djgroups.bind_addr=$HOST"\"")"

# Configure system properties for servers
@@ -467,7 +469,7 @@ result=`jboss-cli.sh --connect --commands="batch,
/host=master/server-config=server-one/system-property=GEOSERVER_DATA_DIR:add(value=/data/geoserver-data/server-one),
/host=master/server-config=server-two/system-property=GEOSERVER_DATA_DIR:add(value=/data/geoserver-data/server-two),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Configure admin password and standby password
add-user.sh -u admin -p admin\!12345 -s &>/dev/null
@@ -479,7 +481,7 @@ result=`jboss-cli.sh --connect --commands="batch,
/profile=default/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql, driver-module-name=org.postgresql, driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource),
/profile=full-ha/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql, driver-module-name=org.postgresql, driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

# Remove ExampleDS datasource
align_left "$DOTSTRING" "Remove ExampleDS datasource"
@@ -487,7 +489,7 @@ result=`jboss-cli.sh --connect --commands="batch,
/profile=default/subsystem=datasources/data-source=ExampleDS:remove(),
/profile=full-ha/subsystem=datasources/data-source=ExampleDS:remove(),
run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

echo "Begin configure encrypted password's"
for ((i = 0; i < ${#DS_POOL_NAMES[@]}; i++)); do
@@ -504,7 +506,7 @@ for ((i = 0; i < ${#DS_POOL_NAMES[@]}; i++)); do
        /profile=full-ha/subsystem=security/security-domain=encrypted_pass_$i/authentication=classic:add(),
        /profile=full-ha/subsystem=security/security-domain=encrypted_pass_$i/authentication=classic/login-module=postgres_login_module:add(code=SecureIdentity, flag=required,module-options=[username="${DS_USERS[$i]}", password="$encrypted"]),
        run-batch"` &>/dev/null
    align_echo $? $result
    align_echo $? "$result"
done

echo "Begin configure DataSource's"
@@ -551,7 +553,7 @@ for ((i = 0; i < ${#DS_POOL_NAMES[@]}; i++)); do
        background-validation=true
        ),
    run-batch"` &>/dev/null
    align_echo $? $result
    align_echo $? "$result"
done

# Set properties for load-demo application, use for debug
@@ -566,7 +568,7 @@ result=`jboss-cli.sh --connect --commands="batch,
    /system-property=org.otd414.security.dont_create_views:add(value=false),
    /system-property=org.otd414.servername:add(value=jboss.7.2),
    run-batch"` &>/dev/null
align_echo $? $result
align_echo $? "$result"

service as7-domain restart