-
Notifications
You must be signed in to change notification settings - Fork 11
Set up the Data Broker
Developers: Arman Arkilic, Daron Chabot
.._local_mac: Local Installation: Mac OSX #
- Install mongodb 1::2.0.6-1.1
- sudo apt-get install mongodb
- Check to see if pymongo 2.7.1 is already installed with
conda list pymongo
orpip list pymongo
- Note that
mongoengine-0.8.7
requirespymongo>=2.5
- If you have at least this version, great! Otherwise, continue with this list
- Install pymongo 2.7.1 or use the direct link
cd ~/dev/other_src/
tar -xf ~/Downloads/pymongo-2.7.1.tar.gz
pip install ./pymongo-2.7.1/
- Note that
-
Install Mongoengine 0.8.7
- Download from the above link
- Note that if you're at the beamline computers you'll probably need to download mongoengine with a web browser and then use sftp to put it on the channel archiver.
cd ~/dev/other_src/
tar -xf ~/Downloads/mongoengine-0.8.7.tar.gz
pip install ./mongoengine-0.8.7
- Download from the above link
- Make the directory to house the database
mkdir /var/tmp/mongo_data
- Clone and install the metadatStore repository (the data broker)
cd ~/dev/other_src/
git clone https://github.com/arkilic/metadataStore.git
pip install ./metadataStore
- copy the dataBroker.conf file to your home directory:
cp metadataStore/dataBroker.conf ~/dataBroker.conf
- edit the dataBroker.conf file so that the host is
localhost
- Start the mongo database server in one terminal
sudo mongod --dbpath /var/tmp/mongo_data
- Go to usage
- Install mongodb
mongodb-win32-x86_64-2008plus-2.6.3-signed.msi
- Download from here
- Run the installer
- Configure mongodb
- Follow these instructions
- The rest is probably fairly similar to the Debian 7.5 Install, but I'm not sure as I haven't done the rest yet...
-
ssh to the channel archiver
ssh xf23id-ca
-
Install mongodb 1::2.0.6-1.1
- sudo apt-get install mongodb
-
Check to see if pymongo 2.7.1 is already installed with
conda list pymongo
orpip list pymongo
- Note 1:
mongoengine-0.8.7
requirespymongo>=2.5
- Note 2: You'll probably need to download pymongo with a web browser and then use sftp to put it on the channel archiver since
wget
andpip
don't seem to be working due to http proxy issues - If you have at least this version, great! Otherwise, continue with this list
- Install pymongo 2.7.1 or use the direct link
cd ~/dev/other_src/
tar -xf ~/Downloads/pymongo-2.7.1.tar.gz
pip install ./pymongo-2.7.1.tar.gz
- Note 1:
-
- Download from the above link
- Note that if you're at the beamline computers you'll probably need to download pymongo with a web browser and then use sftp to put it on the channel archiver.
cd ~/dev/other_src/
tar -xf ~/Downloads/mongoengine-0.8.7.tar.gz
pip install ./mongoengine-0.8.7
- Download from the above link
-
Make the directory to house the database
mkdir /DATA
mkdir /DATA/broker
-
Start the mongodb
-
sudo mongod --dbpath /DATA/broker
-
If you run into an error that looks like this:
edill@xf23id-ca:~/mongo_setup$ sudo mongod --dbpath /DATA/broker Fri Jul 11 09:29:26 [initandlisten] MongoDB starting : pid=3314 port=27017 dbpath=/DATA/broker 64-bit host=xf23id-ca Fri Jul 11 09:29:26 [initandlisten] Fri Jul 11 09:29:26 [initandlisten] ** WARNING: You are running on a NUMA machine. Fri Jul 11 09:29:26 [initandlisten] ** We suggest launching mongod like this to avoid performance problems: Fri Jul 11 09:29:26 [initandlisten] ** numactl --interleave=all mongod [other options] Fri Jul 11 09:29:26 [initandlisten] Fri Jul 11 09:29:26 [initandlisten] db version v2.0.6, pdfile version 4.5 Fri Jul 11 09:29:26 [initandlisten] git version: nogitversion Fri Jul 11 09:29:26 [initandlisten] build info: Linux z6 3.8-trunk-amd64 #1 SMP Debian 3.8.3-1~experimental.1 x86_64 BOOST_LIB_VERSION=1_49 Fri Jul 11 09:29:26 [initandlisten] options: { dbpath: "/DATA/broker" } Fri Jul 11 09:29:26 [initandlisten] journal dir=/DATA/broker/journal Fri Jul 11 09:29:26 [initandlisten] recover : no journal files present, no recovery needed Fri Jul 11 09:29:26 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017 Fri Jul 11 09:29:26 [initandlisten] ERROR: addr already in use Fri Jul 11 09:29:26 [websvr] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:28017 Fri Jul 11 09:29:26 [websvr] ERROR: addr already in use Fri Jul 11 09:29:26 [initandlisten] now exiting Fri Jul 11 09:29:26 dbexit: Fri Jul 11 09:29:26 [initandlisten] shutdown: going to close listening sockets... Fri Jul 11 09:29:26 [initandlisten] shutdown: going to flush diaglog... Fri Jul 11 09:29:26 [initandlisten] shutdown: going to close sockets... Fri Jul 11 09:29:26 [initandlisten] shutdown: waiting for fs preallocator... Fri Jul 11 09:29:26 [initandlisten] shutdown: lock for final commit... Fri Jul 11 09:29:26 [initandlisten] shutdown: final commit... Fri Jul 11 09:29:26 [initandlisten] shutdown: closing all files... Fri Jul 11 09:29:26 [initandlisten] closeAllFiles() finished Fri Jul 11 09:29:26 [initandlisten] journalCleanup... Fri Jul 11 09:29:26 [initandlisten] removeJournalFiles Fri Jul 11 09:29:26 [initandlisten] shutdown: removing fs lock... Fri Jul 11 09:29:26 dbexit: really exiting now
-
Find the pid of the currently running mongod:
edill@xf23id-ca:~/mongo_setup$ ps -e | grep mongo 300 ? 00:00:09 mongod
-
In this case, the pid is 300
- CHECK WITH THE BEAMLINE SCIENTIST FIRST TO MAKE SURE IT IS OK TO TERMINATE THIS DB INSTANCE!
- Then kill it with
kill -9 300
- Restart mongo
sudo mongod --dbpath /DATA/broker
-
-
Return to your local computer (i.e., not the ssh target)
-
Clone and install the metadatStore repository (the data broker)
-
cd ~/dev/other_src/
-
git clone https://github.com/arkilic/metadataStore.git
-
pip install ./metadataStore
-
copy the dataBroker.conf file to your home directory:
cp metadataStore/dataBroker.conf ~/dataBroker.conf
-
edit the dataBroker.conf file so that the host is
xf23id-ca
-
-
Go to usage to test the data broker
-
Copy
sampleCode.py
from ~/path_to_metadataStore_repository/sampleCode.py to some other folder so that it runs from the pip installed version, not the local repo- cp ~/dev/my_src/metadataStore/sampleCode.py ~/
-
Start an ipython session in another terminal
-
%run ~/sampleCode.py
-
You should see the database server terminal make some updates, something like:
Thu Jul 10 17:33:34 [initandlisten] connection accepted from 127.0.0.1:41132 #1 Thu Jul 10 17:33:34 [FileAllocator] allocating new datafile /var/tmp/mongo_data/metaDataStore.ns, filling with zeroes... Thu Jul 10 17:33:34 [FileAllocator] creating directory /var/tmp/mongo_data/_tmp Thu Jul 10 17:33:34 [FileAllocator] done allocating datafile /var/tmp/mongo_data/metaDataStore.ns, size: 16MB, took 0.016 secs Thu Jul 10 17:33:34 [FileAllocator] allocating new datafile /var/tmp/mongo_data/metaDataStore.0, filling with zeroes... Thu Jul 10 17:33:34 [FileAllocator] done allocating datafile /var/tmp/mongo_data/metaDataStore.0, size: 64MB, took 0.487 secs
-
-
Still within the ipython interpreter
-
Test the search functionality
-
from metadataStore.userapi.commands import search
-
search(owner='arkilic')
should result in something like the following:In [6]: search(owner='arkilic') None Out[6]: [{u'_id': 1903, u'beamline_id': u'csx', u'custom': {}, u'end_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 408000), u'owner': u'arkilic', u'start_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 408000), u'update_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 408000)}, {u'_id': 1905, u'beamline_id': u'csx', u'custom': {}, u'end_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 988000), u'owner': u'arkilic', u'start_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 988000), u'update_time': datetime.datetime(2014, 7, 10, 21, 33, 34, 988000)}]
-