-
-
Save KunitoishiTomii/a337a19d9824fdb69f53 to your computer and use it in GitHub Desktop.
OpenDolphin setup shell script files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE_FORMAT=`date +%Y%m%d` | |
# log、dump ファイルの場所を指定する | |
BACKUP_LOG="/home/ubuntu/backup_dolphin.log" | |
BACKUP_DUMP="/home/ubuntu/dolphin${DATE_FORMAT}.dump" | |
#BACKUP_SERVER_PATH="ubuntu@192.168.2.100:" | |
# 日付をログに出力し、pg_dump でデータベースのバックアップを行う | |
echo "データをバックアップ中です。しばらくお待ちください。" | |
date | tee -a $BACKUP_LOG | |
sudo -u dolphin pg_dump -Fc dolphin > $BACKUP_DUMP 2>> $BACKUP_LOG | |
# 別サーバ(scp,port2222) | |
# echo $BACKUP_SERVER"に転送しています" | |
# scp -P 2222 $BACKUP_DUMP $BACKUP_SERVER_PATH | |
# pg_dump がエラー/成功の場合の処理 | |
if [ $? -ne 0 ]; then | |
echo "Backup ERROR!" | tee -a $BACKUP_LOG | |
# メール通知/メッセージ表示等を行うコードを以下に書く | |
# echo "pg_dump ERROR occured!" | mail -s "OpenDolphin Backup ERROR" メールアドレス | |
else | |
echo "Backup SUCCESS!" | tee -a $BACKUP_LOG | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
apt-get update | |
apt-get install -y openjdk-7-jdk maven git | |
sudo -u ubuntu git clone https://github.com/MasudaNaika/OpenDolphin-2.3m_WF8 | |
# Set local repository | |
cd ./OpenDolphin-2.3m_WF8 | |
sudo -u ubuntu mvn install:install-file -Dfile=./ext_lib/AppleJavaExtensions.jar -DgroupId=com.apple -DartifactId=AppleJavaExtensions -Dversion=1.6 -Dpackaging=jar | |
sudo -u ubuntu mvn install:install-file -Dfile=./ext_lib/quaqua-9.0.0.7.jar -DgroupId=ch.randelshofer -DartifactId=quaqua -Dversion=9.0.0.7 -Dpackaging=jar | |
sudo -u ubuntu mvn install:install-file -Dfile=./ext_lib/iTextAsian.jar -DgroupId=com.lowagie -DartifactId=iTextAsian -Dversion=1.0 -Dpackaging=jar | |
# mvn clean | |
sudo -u ubuntu mvn package | |
# scp -r ./dist user@server:/path/to/setdir | |
# exec sudo ./setpg.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CLI script for DolphinDS | |
connect | |
batch | |
# Add a non-XA datasource | |
data-source add \ | |
--name=DolphinDS \ | |
--driver-name=postgresql-9.3-1102.jdbc41.jar \ | |
--connection-url=jdbc:postgresql://localhost:5432/dolphin \ | |
--jndi-name=java:jboss/datasources/DolphinDS \ | |
--user-name=dolphin \ | |
--password=dolphin \ | |
--jta=true \ | |
--use-ccm=false \ | |
--transaction-isolation=TRANSACTION_READ_COMMITTED \ | |
# --max-pool-size=25 \ | |
# --blocking-timeout-wait-millis=5000 \ | |
# --new-connection-sql="set datestyle = ISO, European;" | |
data-source enable --name=DolphinDS | |
# Execute and reload | |
run-batch | |
:reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO_HOME=/home/ubuntu/.m2/repository | |
WFLY_HOME=/usr/local/wildfly | |
WFLY_ST_MOD=${WFLY_HOME}/standalone/modules | |
JSON_VER=2.4.4 | |
R_JSON_ANN_JAR=${REPO_HOME}/com/fasterxml/jackson/core/jackson-annotations/${JSON_VER}/jackson-annotations-${JSON_VER}.jar | |
R_JSON_CORE_JAR=${REPO_HOME}/com/fasterxml/jackson/core/jackson-core/${JSON_VER}/jackson-core-${JSON_VER}.jar | |
R_JSON_DATA_JAR=${REPO_HOME}/com/fasterxml/jackson/core/jackson-databind/${JSON_VER}/jackson-databind-${JSON_VER}.jar | |
JSON_ANN_PATH=${WFLY_HOME}/modules/system/layers/base/com/fasterxml/jackson/core/jackson-annotations/main | |
JSON_CORE_PATH=${WFLY_HOME}/modules/system/layers/base/com/fasterxml/jackson/core/jackson-core/main | |
JSON_DATA_PATH=${WFLY_HOME}/modules/system/layers/base/com/fasterxml/jackson/core/jackson-databind/main | |
sudo -u wildfly cp ${R_JSON_ANN_JAR} ${JSON_ANN_PATH} | |
sudo -u wildfly cp ${R_JSON_CORE_JAR} ${JSON_CORE_PATH} | |
sudo -u wildfly cp ${R_JSON_DATA_JAR} ${JSON_DATA_PATH} | |
sudo -u wildfly sed -i "s/2.4.1/${JSON_VER}/" ${JSON_ANN_PATH}/module.xml | |
sudo -u wildfly sed -i "s/2.4.1/${JSON_VER}/" ${JSON_CORE_PATH}/module.xml | |
sudo -u wildfly sed -i "s/2.4.1/${JSON_VER}/" ${JSON_DATA_PATH}/module.xml | |
echo "next:setwar.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMDNAME=`basename $0` | |
if [ $# -ne 1 ]; then | |
echo "Usage: $CMDNAME dolphin201409xx.dump" 1>&2 | |
exit 1 | |
fi | |
RESTORE_DUMP=$1 | |
# Stop OpenDolphin | |
echo "Stop OpenDolphin" | |
sudo service wildfly.sh stop | |
# Drop dolphin database | |
sudo -u dolphin dropdb dolphin | |
# Create dolphin database | |
sudo -u dolphin createdb -lC -Ttemplate0 -EUTF-8 dolphin | |
echo "データをリストア中です。しばらくお待ちください。" | |
sudo -u dolphin pg_restore -j2 -O -d dolphin $RESTORE_DUMP | |
if [ $? -eq 0 ]; then | |
echo "Restore $RESTORE_DUMP SUCCEED" | |
else | |
echo "Restore $RESTORE_DUMP ERROR!" | |
fi | |
# Start OpenDolphin | |
echo "Start OpenDolphin" | |
sudo service wildfly.sh start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WFLY_HOME=/usr/local/wildfly | |
DS_CLI=dolphin-ds.cli | |
if [ ! -f $DS_CLI ]; then | |
echo "Please SETUP $DS_CLI file to this directory." 1>&2 | |
exit 0 | |
fi | |
# Start wildfly | |
echo "Start wildfly" | |
sudo -u wildfly ${WFLY_HOME}/bin/standalone.sh & | |
sleep 10 | |
# Setting DataSource | |
sudo -u wildfly ${WFLY_HOME}/bin/jboss-cli.sh --file=./${DS_CLI} | |
sleep 5 | |
# Test connection | |
sudo -u wildfly ${WFLY_HOME}/bin/jboss-cli.sh --connect /subsystem=datasources/data-source=DolphinDS:test-connection-in-pool | |
sleep 5 | |
# Stop wildfly | |
echo "Stop Wildfly" | |
sudo ${WFLY_HOME}/bin/jboss-cli.sh --connect command=:shutdown | |
sleep 5 | |
echo "next:json.sh" | |
# exec sudo ./setwar.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
apt-get install -y postgresql ntp | |
# Set of PostgreSQL Database | |
useradd dolphin -d /home/dolphin | |
getent passwd | grep dolphin | |
sudo -u postgres psql -c "create user dolphin with password 'dolphin';" | |
sudo -u postgres psql -c 'ALTER ROLE dolphin WITH SUPERUSER CREATEDB CREATEROLE REPLICATION;' | |
sudo -u postgres psql -c 'select rolname from pg_roles;' | |
sudo -u dolphin createdb -lC -Ttemplate0 -EUTF-8 dolphin | |
sudo -u dolphin psql -l | |
echo "next:setwfly.sh" | |
# exec sudo ./setwfly.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo cp wildfly.sh /etc/init.d/wildfly.sh | |
sudo update-rc.d wildfly.sh defaults | |
sudo update-rc.d wildfly.sh enable | |
echo "SETUP Finished!" | |
echo "Check host address /etc/hosts" | |
getent hosts ${HOSTNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WFLY_HOME=/usr/local/wildfly | |
OD_DIST_PATH=./OpenDolphin-2.3m_WF8/dist/ | |
OD_EXTLIB_PATH=./OpenDolphin-2.3m_WF8/ext_lib/ | |
OD_CLI_PATH=/home/ubuntu/OpenDolphinClient/ | |
OD_SERVER_WAR=OpenDolphin-server-2.3m_WF8.war | |
OD_CLI_JAR=OpenDolphin-2.3m_WF8.jar | |
FILESERV_PROP=fileservlet.properties | |
KEYSTORE=oreore.keystore | |
ST_XML=standalone.xml | |
ST_CFG=${WFLY_HOME}/standalone/configuration/ | |
ST_DEP=${WFLY_HOME}/standalone/deployments/ | |
if [ ! -f ${OD_DIST_PATH}${OD_SERVER_WAR} -o ! -f ${OD_EXTLIB_PATH}${ST_XML} -o ! -f ${OD_EXTLIB_PATH}${KEYSTORE} ]; then | |
echo "Please prepare ${OD_DIST_PATH}${OD_SERVER_WAR}, ${OD_EXTLIB_PATH}${ST_XML}, ${OD_EXTLIB_PATH}${KEYSTORE} files." 1>&2 | |
exit 0 | |
fi | |
# Client | |
sudo -u ubuntu mkdir ${OD_CLI_PATH} | |
sudo -u ubuntu cp ${OD_DIST_PATH}${OD_CLI_JAR} ${OD_CLI_PATH} | |
sudo -u ubuntu cp ${OD_DIST_PATH}DolphinLauncher.jar ${OD_CLI_PATH} | |
sudo -u ubuntu cp ${OD_EXTLIB_PATH}OpenDolphin-m.ico ${OD_CLI_PATH} | |
sudo -u ubuntu cp -r ${OD_DIST_PATH}lib ${OD_CLI_PATH} | |
sudo -u ubuntu sed -i 's/C:/\/home\/ubuntu/g' ${OD_EXTLIB_PATH}${FILESERV_PROP} | |
sudo -u wildfly cp ${OD_EXTLIB_PATH}${FILESERV_PROP} ${ST_CFG}${FILESERV_PROP} | |
# Deploy war & xml & keystore | |
if [ -f ${ST_CFG}/standalone.xml ]; then | |
sudo -u wildfly mv ${ST_CFG}${ST_XML} ${ST_CFG}${ST_XML}.org 1>&2 | |
fi | |
sudo -u wildfly cp ${OD_EXTLIB_PATH}${ST_XML} ${ST_CFG}${ST_XML} | |
if [ ! -f ${ST_CFG}${KEYSTORE} ]; then | |
sudo -u wildfly cp ${OD_EXTLIB_PATH}${KEYSTORE} ${ST_CFG} 1>&2 | |
fi | |
# ls -al ${ST_DEP} | |
# ls -al ${ST_CFG} | |
echo "Start Opendolphin" | |
sudo -u wildfly ${WFLY_HOME}/bin/standalone.sh & | |
sleep 10 | |
#if [ ! -f ${ST_DEP}${OD_SERVER_WAR} ]; then | |
sudo -u wildfly cp ${OD_DIST_PATH}${OD_SERVER_WAR} ${ST_DEP} 1>&2 | |
#fi | |
sleep 20 | |
# Stop wildfly | |
echo "Stop Wildfly" | |
sudo ${WFLY_HOME}/bin/jboss-cli.sh --connect command=:shutdown | |
sleep 5 | |
echo "next:setrcd.sh" | |
# exec sudo ./setrcd.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WFLY_HOME=/usr/local/wildfly | |
WFLY_VER=wildfly-8.2.0.Final | |
JDBC_JAR=postgresql-9.3-1102.jdbc41.jar | |
sudo apt-get update | |
sudo apt-get install -y default-jre wget | |
# User for Wildfly | |
sudo groupadd -r wildfly | |
sudo useradd -r -g wildfly -s /bin/false -d /nonexistent wildfly | |
if [ ! -f ${WFLY_VER}.tar.gz ]; then | |
wget http://download.jboss.org/wildfly/8.2.0.Final/${WFLY_VER}.tar.gz 1>&2 | |
fi | |
tar xvf ${WFLY_VER}.tar.gz | |
# Deploy wildfly | |
sudo mv ./${WFLY_VER} $WFLY_HOME | |
sudo chown -R wildfly:wildfly $WFLY_HOME | |
# Add admin | |
sudo ${WFLY_HOME}/bin/add-user.sh dolphin dolphin --silent | |
# Deploy jdbc driver | |
if [ ! -f $JDBC_JAR ]; then | |
wget http://jdbc.postgresql.org/download/$JDBC_JAR 1>&2 | |
fi | |
sudo -u wildfly cp $JDBC_JAR $WFLY_HOME/standalone/deployments/ | |
echo "next:setdolphinDS.sh" | |
# exec sudo ./setdolphinDS.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo sh -c "echo 'net.ipv6.conf.all.disable_ipv6=1' >> /etc/sysctl.conf" | |
sudo sh -c "echo 'net.ipv6.conf.default.disable_ipv6=1' >> /etc/sysctl.conf" | |
# sudo sed -i 's/archive.ubuntu.com/ftp.jaist.ac.jp/' /etc/apt/sources.list | |
# sudo sed -i 's/security.ubuntu.com/ftp.jaist.ac.jp/' /etc/apt/sources.list | |
sudo /sbin/sysctl -p | |
echo "next:buildopendolphin.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
case "$1" in | |
start|"") | |
sudo /usr/local/wildfly/bin/standalone.sh -b 0.0.0.0 > /dev/null & | |
;; | |
stop) | |
sudo /usr/local/wildfly/bin/jboss-cli.sh --connect --command=:shutdown | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment