| #!/bin/sh |
| # |
| # Copyright (c) 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 |
| # |
| |
| # This script creates and starts a domain called "sqe-domain" |
| # with a single server instance named "sqe-server". |
| |
| #--- Extract environment properties --- |
| |
| for x in `cat $APS_HOME/eeconfig/ee-config.properties` |
| do |
| varval=`echo $x |cut -d'=' -f1` |
| |
| if [ $varval = "admin.user" ]; |
| then |
| AS_ADMIN_USER=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "admin.port" ]; |
| then |
| AS_ADMIN_PORT=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "admin.password" ]; |
| then |
| PASSWORD=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "master.password" ]; |
| then |
| MASTERPASSWORD=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "admin.password.file" ]; |
| then |
| PASSWORD_FILE=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "admin.domain" ]; |
| then |
| AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2` |
| fi |
| if [ $varval = "nodeagent.name" ]; |
| then |
| AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "appserver.instance.name" ]; |
| then |
| AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2` |
| fi |
| if [ $varval = "orb.port" ]; |
| then |
| ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "http.port" ]; |
| then |
| HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2` |
| fi |
| |
| if [ $varval = "https.port" ]; |
| then |
| HTTP_LISTENER_2_PORT=`echo $x |cut -d'=' -f2` |
| fi |
| done |
| |
| if [ $PASSWORD_FILE = "\${env.APS_HOME}/config/adminpassword.txt" ]; |
| then |
| PASSWORD_FILE="$APS_HOME/config/adminpassword.txt" |
| fi |
| echo "password file: $PASSWORD_FILE" |
| |
| |
| SSL_PORT="1042" |
| SSL_MUTUALAUTH_PORT="1058" |
| JMX_SYSTEM_CONNECTOR_PORT="8687" |
| export AS_ADMIN_USER |
| export PASSWORD |
| export PASSWORD_FILE |
| export MASTERPASSWORD |
| export AS_ADMIN_PORT |
| export AS_ADMIN_DOMAIN |
| export AS_ADMIN_NODEAGENT |
| export AS_ADMIN_SERVER |
| |
| echo "AS_ADMIN_PASSWORD=$PASSWORD" > $PASSWORD_FILE |
| echo "AS_ADMIN_ADMINPASSWORD=$PASSWORD" >> $PASSWORD_FILE |
| echo "AS_ADMIN_MASTERPASSWORD=$MASTERPASSWORD" >> $PASSWORD_FILE |
| |
| #----Create domain: sqe-domain |
| ${S1AS_HOME}/bin/asadmin create-domain --adminport ${AS_ADMIN_PORT} --adminuser ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --echo=true --terse=true ${AS_ADMIN_DOMAIN} |
| |
| #----Start domain: sqe-domain |
| ${S1AS_HOME}/bin/asadmin start-domain --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --echo=true --terse=true ${AS_ADMIN_DOMAIN} |
| |
| #----Create node agent (sqe-agent) referencing sqe-domain. |
| ${S1AS_HOME}/bin/asadmin create-node-agent --host localhost --port ${AS_ADMIN_PORT} --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --savemasterpassword ${AS_ADMIN_NODEAGENT} |
| |
| |
| #----Create the server instance: sqe-server |
| ${S1AS_HOME}/bin/asadmin create-instance --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --host localhost --port ${AS_ADMIN_PORT} --nodeagent ${AS_ADMIN_NODEAGENT} --systemproperties HTTP_LISTENER_PORT=${HTTP_LISTENER_1_PORT}:HTTP_SSL_LISTENER_PORT=${HTTP_LISTENER_2_PORT}:IIOP_LISTENER_PORT=${ORB_LISTENER_1_PORT}:IIOP_SSL_LISTENER_PORT=${SSL_PORT}:IIOP_SSL_MUTUALAUTH_PORT=${SSL_MUTUALAUTH_PORT}:JMX_SYSTEM_CONNECTOR_PORT=${JMX_SYSTEM_CONNECTOR_PORT} ${AS_ADMIN_SERVER} |
| |
| #----Start the sqe-agent. |
| ${S1AS_HOME}/bin/asadmin start-node-agent --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --echo=true --terse=true --startinstances=true ${AS_ADMIN_NODEAGENT} |
| #Start the sqe-server |
| |
| echo "EE setup complete!" |
| # --------- Notes ------------ |
| |
| #NOTE: The domain should be up an running when the node agent is started. |
| |
| #NOTE: The stop-node-agent command currently does |
| # not function due to a bug so should you ever need to stop the node |
| # agent you must kill its process. In reality you should never need |
| # to stop the node agent once it is started. |
| |
| #NOTE: The ports by default will not conflict with those of the DAS. |
| #The http-listener port will default to 8079. |