Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuilding OTP from git source code #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gtfs-manager
OTP
data
data_tmp
logs
lucene
modeify
OpenTripPlanner
.idea
*.iml
8 changes: 8 additions & 0 deletions monitor_log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
while inotifywait -e modify /var/log/supervisor/vta_otp.log; do
if (tail -n1 /var/log/supervisor/vta_otp.log | grep java.lang.OutOfMemoryError;) ||
(tail -n1 /var/log/supervisor/vta_otp.log | grep org.opentripplanner.routing.error.GraphNotFoundException;)
then
/usr/local/bin/supervisorctl restart vta:vta_otp
fi
done
101 changes: 101 additions & 0 deletions pjman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash
#
# @author Gordon Hackett
# @date 2017-10-27
# @package Ubuntu_MongoDB_Apache_NodeJS_Python_Java - ManPJ
############################
#
cd ~
sudo add-apt-repository ppa:webupd8team/java
#
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get update
#
sudo apt-get install \
build-essential \
openssl \
libreadline6 \
libreadline6-dev \
zlib1g \
zlib1g-dev \
libssl-dev \
libpcre3-dev \
autoconf \
libc6-dev \
ncurses-dev \
libreadline-dev \
automake \
libtool \
bison \
apache2 \
apache2-utils \
apache2-dev \
libapache2-mod-wsgi \
libpcre3-dev \
mongodb \
mongodb-clients \
mongodb-server \
python-markdown \
python-markdown-doc \
libxml2-dev \
libxslt1-dev \
xml-core \
xml-security-c-utils \
xml2 \
xmldiff \
xmlformat-doc \
xmlrpc-api-utils \
python-software-properties \
perl \
perl-base \
perl-debug \
perl-depends \
perl-doc \
perl-doc-html \
perl-modules \
liburi-perl \
libuuid-perl \
libwww-perl \
libwww-robotrules-perl \
geoip-bin \
geoip-database \
libapache2-mod-security2 \
oracle-java8-installer \
oracle-java8-set-default \
oracle-java8-unlimited-jce-policy \
tcpdump \
chkrootkit \
rkhunter \
nodejs
#
sudo apt-get install supervisor fail2ban maven python-pip
sudo pip install --upgrade pip
sudo pip install transitfeed==1.2.15-blah
sudo apt-get autoclean
sudo apt-get autoremove
sudo update
#
sudo update-grub
sudo updatedb
#
sudo update-rc.d supervisor enable
sudo update-rc.d fail2ban enable
sudo update-rc.d mongodb enable
sudo update-rc.d apache2 enable
#
sudo swapon -s
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
cat /proc/sys/vm/swappiness
#
free -m
df -h
#
sudo printf "/swapfile\tnone\tswap\tsw\t0\t0\n" >> /etc/fstab
printf "Please confirm /etc/fstab is correct and reboot for changes to take effect\n"
printf "sudo vim /etc/fstab"
printf "sudo mount -a"
#
14 changes: 14 additions & 0 deletions restart-otp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
#
# Restart OTP Grizzly server on port 8888
MAILTO=""
sudo kill -9 `sudo ps ax | grep java | grep vta | grep 8888 | awk '{print $1}' | tr '\n' ' '`
sleep 10
java -Xmx6G -Xverify:none -jar /srv/vta.amigocloud.com/OTP/target/otp-1.0.0-shaded.jar --basePath /srv/vta.amigocloud.com/data/ --router default --server --port 8888 --cache /srv/vta.amigocloud.com/ned --autoReload --autoScan | tee /srv/vta.amigocloud.com/logs/grizzly-`date +%F`.log &
res=$?
if test "$res" = "0" ; then
echo "Restart successful and logging to `pwd`/logs/grizzy-`date +%F`.log"
else
echo "Restart failed with exit code: $res"
fi
exit