Linux/Unix 环境下启动WAS的疑问

yanchang 2003-12-22 09:14:31

startupServer.sh和adminserver.sh有什么不同

我运行了adminserver.sh也一样可以运行WAS服务,可以起控制台,和运行startupServer.sh有什么区别吗?
...全文
190 点赞 收藏 6
写回复
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanchang 2003-12-22
版本是WAS AE4
回复
iceleighton 2003-12-22
自己把两个脚本比较一下就好了,
adminserver.sh里面有一些和平台相关的条件语句,
根据系统的种类进行一些设置。
回复
yanchang 2003-12-22
# adminserver.sh
#!/bin/sh
# 5630-A23, 5630-A22, (C) Copyright IBM Corporation, 1997, 2002
# All rights reserved. Licensed Materials Property of IBM
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

binDir=`dirname $0`
. $binDir/setupCmdLine.sh

JAVA_EXE=$JAVA_HOME/jre/bin/java

OS=`uname`

# Set proper database CLASSPATH settings.
if [ "$DB_TYPE" = "DB2" ]
then
DB_ENV=$DB_INSTANCE_HOME/sqllib/db2profile
. ${DB_ENV?}
# Update for JDBC 2 (usejdb2)
DB_CLASSPATH=$DB_INSTANCE_HOME/sqllib/java12/db2java.zip

PATH=`/bin/echo ${PATH} | /bin/sed \
-e "s/\([^:]*sqllib\)\/bin/\1\/java12:\1\/bin/"`

if [ $OS = "AIX" ]
then
LIBPATH=`/bin/echo ${LIBPATH} | /bin/sed \
-e "s/\([^:]*sqllib\)\/lib/\1\/java12:\1\/lib/"`
export LIBPATH
EXTSHM=ON
export EXTSHM
elif [ $OS = "HP-UX" ]
then
SHLIB_PATH=`/bin/echo ${SHLIB_PATH} | /bin/sed \
-e "s/\([^:]*sqllib\)\/lib/\1\/java12:\1\/lib/"`
export SHLIB_PATH
else
LD_LIBRARY_PATH=`/bin/echo ${LD_LIBRARY_PATH} | /bin/sed \
-e "s/\([^:]*sqllib\)\/lib/\1\/java12:\1\/lib/"`
export LD_LIBRARY_PATH
fi
elif [ "$DB_TYPE" = "Oracle" ]
then
DB_CLASSPATH=$DB_INSTANCE_HOME/jdbc/lib/classes12.zip:$DB_INSTANCE_HOME/jdbc/lib/nls_charset12.zip
if [ $OS = "AIX" ]
then
LIBPATH=$DB_INSTANCE_HOME/jdbc/lib:$LIBPATH
export LIBPATH
elif [ $OS = "HP-UX" ]
then
SHLIB_PATH=$DB_INSTANCE_HOME/jdbc/lib:$SHLIB_PATH
export SHLIB_PATH
else
LD_LIBRARY_PATH=$DB_INSTANCE_HOME/jdbc/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
fi
elif [ "$DB_TYPE" = "Sybase" ]
then
DB_CLASSPATH=$DB_INSTANCE_HOME/jConnect-5_2/classes/jconn2.jar
elif [ "$DB_TYPE" = "Informix" ]
then
DB_CLASSPATH=$DB_INSTANCE_HOME/lib/ifxjdbc.jar:$DB_INSTANCE_HOME/lib/ifxjdbcx.jar
fi

# Set the ulimit
LIMIT=`ulimit -n`
if [ "${LIMIT}" != "unlimited" ]
then
if [ $LIMIT -lt 1024 ]
then
ulimit -n 1024
fi
fi

WAS_LIBPATH=$WAS_HOME/bin
case $OS in
AIX)
LIBPATH=$WAS_LIBPATH:$LIBPATH
export LIBPATH ;;
HP-UX)
BOOTSTRAP_CLASSPATH=-Xbootclasspath/a:$JAVA_HOME/jre/lib/ext/ibmorb.jar
SHLIB_PATH=$WAS_LIBPATH:$SHLIB_PATH
export SHLIB_PATH ;;
SunOS)
BOOTSTRAP_CLASSPATH=-Xbootclasspath/a:$JAVA_HOME/jre/lib/ext/ibmorb.jar
LD_LIBRARY_PATH=$WAS_LIBPATH:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

# The value of the TCP wait interval can significantly impact performance of
# the WebSphere Application Server. The recommended initial interval value
# is 60000ms.
#
# The TCP wait interval can be set in this script(see the following block of
# code) or it can be set by the System Administrator. Root access is
# neccessary to execute ndd and the TCP wait interval is a machine wide
# parameter.
#
# To query what the current TCP wait interval is, issue the following command:
# For Solaris 2.6:
# /usr/sbin/ndd -get /dev/tcp tcp_close_wait_interval
#
# For Solaris 2.7 & 2.8:
# /usr/sbin/ndd -get /dev/tcp tcp_time_wait_interval
#

if [ `/usr/ucb/whoami` = "root" ]
then
case `uname -r` in
5.6) /usr/sbin/ndd -set /dev/tcp tcp_close_wait_interval 60000 ;;
5.7 | 5.8) /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000 ;;
esac
else
echo "WARNING: Admin Server executing as non-root - unable to set TCP wait interval"
echo "WARNING: This could impact WebSphere Application Server performance"
echo "WARNING: Please see comments inside this script regarding TCP wait interval"
echo
fi
;;
*)
LD_LIBRARY_PATH=$WAS_LIBPATH:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH ;;
esac


RESTART=-nodeRestart
RETRY=0
while [ $RETRY -lt 3 ]
do
${JAVA_EXE?} \
-Xms17M \
$BOOTSTRAP_CLASSPATH \
-classpath $WAS_CLASSPATH \
-Dws.ext.dirs=$WAS_EXT_DIRS \
-Djavax.rmi.CORBA.UtilClass=com.ibm.CORBA.iiop.Util \
-Dcom.ibm.CORBA.iiop.noLocalCopies=true \
-DDER_DRIVER_PATH=$DER_DRIVER_PATH \
com.ibm.ws.bootstrap.WSLauncher \
com.ibm.ejs.sm.server.AdminServer -bootFile $WAS_HOME/bin/admin.config $RESTART "$@"
rc=$?
unset RESTART

# Increment retry count on Fatal Error
if [ $rc -eq 255 ]
then RETRY=`expr $RETRY + 1`
else RETRY=0
fi

case $rc in
174) break ;;
87) RESTART=-nodeRestart ;;
0) break ;;
esac
done

exit 0
回复
yanchang 2003-12-22
#!/bin/sh
#starupServer.sh

binDir=`dirname $0`
. $binDir/setupCmdLine.sh

WAS_HOME=/usr/WebSphere/AppServer/
export WAS_HOME

JAVA_HOME=/usr/WebSphere/AppServer/java
export JAVA_HOME

DB_CLASSPATH=
if [ "${DB_TYPE}" = "InstantDB" ]
then
{
# Do nothing
DB_CLASSPATH=$WAS_HOME/lib/idb.jar
}
elif [ "${DB_TYPE}" = "DB2" ]
then
{
DB_ENV=$DB_INSTANCE_HOME/sqllib/db2profile
. ${DB_ENV?}
DB_CLASSPATH=$DB_INSTANCE_HOME/sqllib/java12/db2java.zip
}
elif [ "${DB_TYPE}" = "Oracle" ]
then
{
DB_CLASSPATH=$DB_INSTANCE_HOME/jdbc/lib/classes12.zip
}
elif [ "${DB_TYPE}" = "Sybase" ]
then
{
DB_CLASSPATH=$DB_INSTANCE_HOME/jConnect-5_2/classes/jconn2.jar
}
elif [ "${DB_TYPE}" = "Informix" ]
then
{
DB_CLASSPATH=$DB_INSTANCE_HOME/lib/ifxjdbc.jar:$DB_INSTANCE_HOME/lib/ifxjdbcx.jar
}
fi
export DB_CLASSPATH

CLASSPATH=$DB_CLASSPATH:$WAS_HOME/properties

export CLASSPATH

PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export PATH

JAVA_EXE=$JAVA_HOME/bin/java

##############
# Check to see if we should use new behavior
##############
grep '^com.ibm.ejs.sm.adminServer.forceReconnect=true' $WAS_HOME/bin/admin.config
if [ "$?" = "0" ] # Do not modify
then # Do not modify
. $WAS_HOME/bin/jlookup.ksh # Do not modify
fi # Do not modify
#####################################
if [ "${DB_TYPE}" != "DB2" ]
then
{
LD_LIBRARY_PATH=$WAS_HOME/bin:$WAS_HOME/lib:$DB_INSTANCE_HOME/lib:$LD_LIBRARY_PATH
LIBPATH=$WAS_HOME/bin:$WAS_HOME/lib:$DB_INSTANCE_HOME/lib:$LIBPATH
export LD_LIBRARY_PATH LIBPATH

${JAVA_EXE?} \
-classpath $WAS_HOME/lib/bootstrap.jar:$CLASSPATH \
-Dws.ext.dirs=$WAS_EXT_DIRS \
-Djavax.rmi.CORBA.UtilClass=com.ibm.CORBA.iiop.Util \
-Dcom.ibm.CORBA.iiop.noLocalCopies=true \
-DDER_DRIVER_PATH=$DER_DRIVER_PATH \
com.ibm.ws.bootstrap.WSLauncher \
com.ibm.ejs.sm.util.process.Nanny $WAS_HOME/bin/admin.config
}
else
{
LD_LIBRARY_PATH=$WAS_HOME/lib/odbc/lib:$DB_INSTANCE_HOME/sqllib/java12:$DB_INSTANCE_HOME/sqllib/lib:$WAS_HOME/bin:$WAS_HOME/lib:$LD_LIBRARY_PATH
LIBPATH=$WAS_HOME/lib/odbc/lib:$DB_INSTANCE_HOME/sqllib/java12:$DB_INSTANCE_HOME/sqllib/lib:$WAS_HOME/bin:$WAS_HOME/lib:$LIBPATH
EXTSHM=ON
export LD_LIBRARY_PATH LIBPATH EXTSHM

${JAVA_EXE?} \
-classpath $WAS_HOME/lib/bootstrap.jar:$CLASSPATH \
-Dws.ext.dirs=$WAS_EXT_DIRS \
-Djavax.rmi.CORBA.UtilClass=com.ibm.CORBA.iiop.Util \
-Dcom.ibm.CORBA.iiop.noLocalCopies=true \
-DDER_DRIVER_PATH=$DER_DRIVER_PATH \
com.ibm.ws.bootstrap.WSLauncher \
com.ibm.ejs.sm.util.process.Nanny $WAS_HOME/bin/admin.config
}
fi
exit 0
回复
yanchang 2003-12-22
恳请冰雪大叔再给分析一下他们的不同

# pwd
/usr/WebSphere/AppServer/bin
# ls adminserver.sh
adminserver.sh
# ls startupServer.sh
startupServer.sh
#

回复
iceleighton 2003-12-22
老大你确认有adminserver.sh?
我查了4.0的手册,没有adminserver.sh只有adminserver.bat(在Windows平台)
同样只有startupServer.sh,没有startupServer.bat(在Unix平台),
所以两者是在不同平台上功能相同的两个命令。
回复
发动态
发帖子
WebSphere
创建于2007-08-27

2600

社区成员

WebSphere 是 IBM 的软件平台。它包含了编写、运行和监视全天候的工业强度的随需应变 Web 应用程序和跨平台、跨产品解决方案所需要的整个中间件基础设施,如服务器、服务和工具。
申请成为版主
社区公告
暂无公告