1 Star 0 Fork 0

凌云文档/alfresco-setup-7.2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
start.sh 4.55 KB
一键复制 编辑 原始数据 按行查看 历史
凌云文档 提交于 2022-09-19 16:06 . ini
#!/bin/bash
#Order of operation
## - Start AMQ
## - Start LocalTransformationService
## - Start DB
## - Start ACS
## - Start SOLR
printf "\n------------------------------ Starting services ------------------------- \n"
#User can pass ALF_HOME path. Defaults to "/opt/alfresco-community".
export ALF_HOME=${1:-"/opt/alfresco-community"}
#User can pass SOLR_HOME path. Defaults to "/usr/local/alfresco-search-services".
export SOLR_HOME=${2:-"/opt/alfresco-community/search-services"}
export CATALINA_HOME=$ALF_HOME/tomcat
export CATALINA_TMPDIR=$CATALINA_HOME/temp
export JRE_HOME=$JAVA_HOME
# Check if JRE_HOME is set in path variable or not, else set default path. It is mandatory for acs to start
if [ -z "$JRE_HOME" ]
then
echo "JRE_HOME could not be found, setting the default..."
export JRE_HOME="/usr/lib/jvm/java-11"
fi
#Export JRE_HOME to PATH
export PATH=$PATH:$JRE_HOME/bin
# Check if ALF_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
if [[ "$PATH" == *"$ALF_HOME"* ]]; then
echo "$ALF_HOME already set in PATH variable."
else
export PATH=$PATH:$ALF_HOME
fi
# Check if SOLR_HOME is set in path variable or not, we may need it for executing shell scripts as needed.
if [[ "$PATH" == *"$SOLR_HOME"* ]]; then
echo "$SOLR_HOME already set in PATH variable."
else
export PATH=$PATH:$SOLR_HOME
fi
#User need to pass this param on initial startup in order to create the cores. if core values are not passed then default 'alfresco and archive' will be used.
SOLR_CORES=${3:-"alfresco,archive"}
#Set the exiftool path in PATH variable.
export PATH=$PATH:$ALF_HOME/exiftool
JAVA_OPTS="-Xms3G -Xmx4G -Xss1024k"
JAVA_OPTS="${JAVA_OPTS} -XX:+UseG1GC -XX:+UseStringDeduplication"
JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom"
JAVA_OPTS="${JAVA_OPTS} -Djava.io.tmpdir=${CATALINA_TMPDIR}"
JAVA_OPTS="${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
JAVA_OPTS="${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote=true"
JAVA_OPTS="${JAVA_OPTS} -server"
echo "-------------------------------------------"
echo CATALINA_HOME: $CATALINA_HOME
echo CATALINA_TMPDIR: $CATALINA_TMPDIR
echo JRE_HOME: $JRE_HOME
echo JAVA_OPTS: $JAVA_OPTS
echo SOLR_HOME: $SOLR_HOME
echo ALF_HOME: $ALF_HOME
echo PATH: $PATH
echo "-------------------------------------------"
StartAMQ() {
printf "\nStarting ActiveMQ... \n"
systemctl start activemq
if [[ $? = 0 ]]
then
echo "activemq service started successfully."
else
echo "Failed to start activemq service!"
exit 1
fi
}
StartLocalTransformService() {
printf "\nInvoking local transformation service startup script... \n"
# Check for more info: https://docs.alfresco.com/transform-service/latest/install/#install-with-zip
$ALF_HOME/localTransformationService.sh start
if [[ $? = 0 ]]
then
echo "localTransformService script executed successfully."
else
echo "Failed to execute localTransformService script!"
exit 1
fi
}
StartDB() {
printf "\nStarting Postgresql... \n"
systemctl start postgresql-13.service
if [[ $? = 0 ]]
then
echo "postgresql-13.service started successfully."
else
echo "Failed to start postgresql-13.service!"
exit 1
fi
}
StartACS() {
printf "\nStarting Alfresco Tomcat... \n"
systemctl start tomcat
if [[ $? = 0 ]]
then
echo "tomcat service started successfully."
else
echo "Failed to start tomcat service!"
exit 1
fi
}
StartSOLR() {
#flag for creating the cores on first startup
INITIAL=false
#Setting the context to solrhome
cd $SOLR_HOME/solrhome
for CORE in ${SOLR_CORES//,/ }
do
echo "Checking availability of the core: $CORE"
if [ -d "$CORE" ]; then
echo "'$CORE' found.."
INITIAL=false
else
echo "Warning: '$CORE' NOT found."
INITIAL=true
fi
done
#Going back to original context
cd $ALF_HOME
if [[ $INITIAL == true ]]; then
printf "\nStarting solr6 with initial mode, core '$SOLR_CORES' will be created... \n"
sudo -u solr $SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
else
printf "\nStarting solr6... \n"
sudo systemctl start solr
if [[ $? = 0 ]]
then
echo "solr6 service started successfully."
else
echo "Failed to start solr6 service!"
exit 1
fi
fi
}
###################################
StartAMQ
StartLocalTransformService
StartDB
StartACS
StartSOLR
###################################
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xinyichv/alfresco-setup-7.2.git
git@gitee.com:xinyichv/alfresco-setup-7.2.git
xinyichv
alfresco-setup-7.2
alfresco-setup-7.2
master

搜索帮助