git clone https://github.com/armbrustlab/seaflowviz2.git
cd ~/seaflowviz2
curl -O http://nodejs.org/dist/v0.10.38/node-v0.10.38.pkg
sudo installer -pkg node-v0.10.38.pkg -target /
curl https://install.meteor.com/ | sh
curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-3.0.3.tgz
tar -zxvf mongodb-osx-x86_64-3.0.3.tgz
mkdir ~/seaflowviz2/mongodb
cp -R -n mongodb-osx-x86_64-3.0.3/ ~/seaflowviz2/mongodb
# add mongo bin to path in ~/.profile
# export PATH=$HOME/seaflowviz2/mongodb/bin:$PATH
mkdir -p ~/seaflowviz2/mongodb-data
./runMongoDB.sh
Create first admin user and make db and user for meteor. Not necessary if mongo has already been set up.
mongo
use admin
db.createUser({user: "admin", pwd: "...", roles: ["root"]})
use seaflowviz2
db.createUser({user: "meteor", pwd: "...", roles: [{"role": "dbOwner", "db": "seaflowviz2"}]})
Log out, then in again as new admin user. Next set up replication to enable Meteor oplog tailing
mongo -u admin -p --authenticationDatabase admin
rsconf = { _id: "rs0", members: [ {_id: 0, host: "127.0.0.1:27017"}]}
rs.initiate(rsconf)
use admin
db.createUser({user: "oplogger", pwd: "...", roles: [{role: "read", db: "local"}]})
If not already started during first time setup
./runMongoDB.sh
(cd seaflow-map && npm install)
./runTileserver.sh
If changes have been made to Meteor project source files, recreate the application bundle. Make sure Leaflet tile server URL in seaflow-web/client/client.js
is pointing to the correct IP for the tile server.
cd seaflow-web
meteor build build --directory
An application bundle directory will be created at seaflow-web/build/bundle/
First, take a look in runMeteor.sh
and update MongoDB user passwords, MongoDB URLs, and the Meteor server root URL. Then start the server.
(cd seaflow-web/bundle/programs/server && npm install)
./runMeteor.sh
Make sure to use the real path to sfl.csv
and stat.csv
. If lat and lon in these files is in GGA format use seaflow-push/gga_fix.py
to convert them to decimal degrees before upload. If MongoDB is not on localhost make sure to change host addresses in getToken.sh
, sflLoader.js
, and statLoader.js
.
cd seaflow-push
export METEOR_TOKEN=$(./getToken.sh)
# in some sort of timed loop or cron job every 1-3 minutes
while true; do
python gga_fix.py stat.csv stat-gga2dd.csv && \
python gga_fix.py sfl.csv sfl-gga2dd.csv && \
node sflLoader.js < sfl-gga2dd.csv && \
node statLoader.js < stat-gga2dd.csv
sleep 180
done