-
Notifications
You must be signed in to change notification settings - Fork 8
BMEG Mongo Load
Kyle Ellrott edited this page Aug 31, 2018
·
11 revisions
Install Mongo
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Set mongo data dir to use local ephemeral disk (/mnt
on VM)
sudo mkdir /mnt/mongodb
sudo chown mongodb /mnt/mongodb
Edit /etc/mongod.conf
and set
# Where and how to store data.
storage:
dbPath: /mnt/mongodb
journal:
enabled: true
Start Mongo
sudo service mongod start
Install GO
curl -O https://dl.google.com/go/go1.10.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin
Install GRIP
mkdir -p $GOPATH/src/github.com/bmeg
cd $GOPATH/src/github.com/bmeg
git clone https://github.com/bmeg/grip.git
cd grip
make
Install swift-client
sudo apt-get install python-swiftclient
Download data (you will need openstack rc file)
. ~/CCC-openrc.sh
sudo mkdir /mnt/bmeg
sudo chown ubuntu /mnt/bmeg
cd /mnt/bmeg
swift download biostream -p protograph
Bulk Loader Script (bmeg_load.sh)
#!/bin/bash
DIR=$1
GRIP=$HOME/go/bin/grip
DB=bmeg
for a in `find $DIR -name "*.Vertex.json" `; do
echo $a
$grip mongoload $DB --vertex $a
done;
for a in `find $DIR -name "*.Edge.json" `; do
echo $a
$grip mongoload $DB --edge $a
done;
Load the database
grip create bmeg
./bmeg_load.sh /mnt/bmeg/protograph/
Start the server
grip server --mongo-url localhost