blob: f6ce850b17592af4a3a0758f80d5b52de97a7e1c [file] [log] [blame]
#!/bin/sh +x
#
# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
GF_HOME=${S1AS_HOME}
# production systems will not take generation of multicastport and multicastaddress to chance,
# they will explicitly set these values. Recommend setting these values for our testing. (not necessarily to the values listed below)
# Valid multicastport is between 2048 and 32000
# Generated multicast address is 228.9.X.Y where X and Y are between 0 to 255.
$GF_HOME/bin/asadmin start-domain
echo "domain started"
GF_CLUSTER_NAME=`uname -n`-cluster
$GF_HOME/bin/asadmin create-cluster --multicastport 2231 --multicastaddress 228.9.1.3 ${GF_CLUSTER_NAME}
# how to turn on ShoalLogger to FINE logging using CLI. The names below are subject to change in future but what will work now.
#$GF_HOME/bin/asadmin set-log-level ShoalLogger=FINE:javax.org.glassfish.gms.org.glassfish.gms=FINE:
# need to set unique GMS_LISTENER_PORT when running multiple instances on same machine.
# no need to set GMS_LISTENER_PORT when running one instance on each machine (includes DAS running on its own machine)
GF_DAS_HOST=localhost
GF_DAS_PORT=4848
for GF_INSTANCE_ID in 1 2 3 4 5
do
$GF_HOME/bin/asadmin --host ${GF_DAS_HOST} --port ${GF_DAS_PORT} create-local-instance --cluster ${GF_CLUSTER_NAME} --systemproperties ASADMIN_LISTENER_PORT=${GF_INSTANCE_ID}4848:HTTP_LISTENER_PORT=${GF_INSTANCE_ID}8080:HTTP_SSL_LISTENER_PORT=${GF_INSTANCE_ID}8181:JMS_PROVIDER_PORT=${GF_INSTANCE_ID}7676:IIOP_LISTENER_PORT=${GF_INSTANCE_ID}3700:IIOP_SSL_LISTENER_PORT=${GF_INSTANCE_ID}3820:IIOP_SSL_MUTUALAUTH_PORT=${GF_INSTANCE_ID}3920:JMX_SYSTEM_CONNECTOR_PORT=${GF_INSTANCE_ID}8686:BIND_INTERFACE_ADDRESS=10.132.108.74:GMS_LISTENER_PORT-${GF_CLUSTER_NAME}=${GF_INSTANCE_ID}9490 inst${GF_INSTANCE_ID}
done
$GF_HOME/bin/asadmin start-cluster ${GF_CLUSTER_NAME}
echo Clustered created and started.
$GF_HOME/bin/asadmin list-instances