Support for WMS node and LB/WMS nodes combination.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 8 Jun 2010 14:50:39 +0000 (14:50 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 8 Jun 2010 14:50:39 +0000 (14:50 +0000)
org.glite.lb.doc/src/LBAG-Installation.tex
org.glite.lb.yaim/config/functions/config_glite_lb

index 86e4cd5..80afaed 100644 (file)
@@ -175,7 +175,7 @@ According to local retention policy you may want to use different purge timeouts
 \item \texttt{GLITE\_LB\_RTM\_DN} -- DNs using to get notifications from \LB server\\
 (default: \texttt{heppc24.hep.ph.ic.ac.uk} machine certificate)
 \item \texttt{GLITE\_LB\_SUPER\_USERS} -- additional super-users (default: empty)
-\item \texttt{GLITE\_LB\_TYPE} -- type of the \LB service: server, proxy, both (default: server)
+\item \texttt{GLITE\_LB\_TYPE} -- type of the \LB service: server, proxy, both (default: autodetect, \LB node only: 'server', WMS node only: proxy, \LB and WMS: 'both')
 \item \texttt{GLITE\_LB\_HARVESTER\_ENABLED} -- set to \texttt{true} for sending notification, used mainly for export to MSG publish system (default: \texttt{false})
 \item \texttt{GLITE\_LB\_HARVESTER\_MSG\_OPTIONS} -- additional options for MSG publish (default: \texttt{--wlcg})
 \item \texttt{GLITE\_LB\_INDEX\_OWNER} -- when specified, add (\texttt{true}) or drop (\texttt{false}) 'owner' index (default: 'owner' index not created or dropped)
index aa42b85..a534f61 100644 (file)
@@ -27,6 +27,48 @@ function config_glite_lb_setenv(){
   yaimgridenv_set GLITE_LB_HARVESTER_ENABLED ${GLITE_LB_HARVESTER_ENABLED:-false}
   yaimgridenv_set GLITE_LB_HARVESTER_MSG_OPTIONS "${GLITE_LB_HARVESTER_MSG_OPTIONS:---wlcg}"
 
+  #
+  # default L&B mode (proxy/server/both) according to the node list,
+  # admin can specify GLITE_LB_TYPE, the value is overrided as needed
+  #
+  # behaviour:
+  #   LB:       default 'server', no overriding
+  #   WMS:      default 'proxy', override to 'both' if needed
+  #   WMS & LB: default 'both', override to 'both' if needed
+  #
+  use_proxy=0
+  use_server=0
+  case "$NODE_TYPE_LIST" in
+    *WMS*) use_proxy=1 ;;
+  esac
+  case "$NODE_TYPE_LIST" in
+    *LB*) use_server=1 ;;
+  esac
+  if [ "x${GLITE_LB_TYPE}" = "x" ]; then
+    # default
+    if [ $use_server -eq 1 ]; then
+      if [ $use_proxy -eq 1 ]; then
+        GLITE_LB_TYPE=both
+      else
+        GLITE_LB_TYPE=server
+      fi
+    else
+      if [ $use_proxy -eq 1 ]; then
+        GLITE_LB_TYPE=proxy
+      fi
+    fi
+  else
+    # override if needed
+    if [ $use_proxy -eq 1 ]; then
+      case "$GLITE_LB_TYPE" in
+        *proxy*|*both*)
+          ;;
+        *)
+          yaimlog WARNING "Overriding L&B mode from '$GLITE_LB_TYPE' to 'both'"
+          GLITE_LB_TYPE=both
+      esac
+    fi
+  fi
   yaimgridenv_set GLITE_LB_TYPE ${GLITE_LB_TYPE:-server}
 
   cares_prefix=${INSTALL_ROOT:-/opt}/c-ares
@@ -121,6 +163,8 @@ function config_glite_lb() {
        
   HOSTNAME=`hostname -f`
 
+  yaimlog INFO "Configuring nodes [$NODE_TYPE_LIST], using L&B mode: $GLITE_LB_TYPE"
+
   # Redefine GLITE_HOME_DIR to make sure we retrieve the correct HOME directory of user glite
   GLITE_HOME_DIR=`getent passwd ${GLITE_USER} | cut -d: -f6`
   if [ "x${GLITE_HOME_DIR}" = "x" ]; then