The master node serves configuration to the vStore framework's clients. This includes
- Global decision rules
- A list of storage nodes
- A global key/value lookup service, which replies to requests of file identifiers with a json array of storage node identifiers, on which the file is stored (based on the in-memory database lmdb).
Please refer to the framework's main repository and Wiki for further documentation about its use.
We assume that nodejs and npm are installed.
To install the master node, please follow these steps:
- Clone the repository using
git clone https://github.com/Telecooperation/vstore-master
cd vstore-master
npm install
to install the necessary packages
Now modify the configuration as it suits your desired setup.
Configure port and lmdb in the file env_config.js
.
For rules and storage nodes, go to the directory vstore-master/global_config/modules
and modify the configuration files.
- The file
rules.json
must only contain a json array which defines global storage rules. - The file
nodes.json
must only contain a json array which defines the storage nodes.
For the layout of the JSON files, see the vstore-framework wiki.
Important: Upon the first start of the master node, the node file will be parsed and the storage node information is put into a MongoDB backend. After this, the file is renamed to nodes.json.done
.
The rules are currently not stored in a database. Instead, they are served from the json file.
To access the MongoDB database more easily and graphically, we use mongo-express. You can easily add and remove storage node information.
This can be called by visiting http://<address_of_master>:<port>/admin
. The login credentials can be configured in the file mongo_express_config.js by changing the variables mongoexpressUser
and mongoexpressPass
.
- Open
http://<address_of_master>:<port>/admin
and login - Click
View
for the databasevstore_master
. - Click
View
for the collectionnodeinfos
. - To add a node object, click the button
New Document
.
To run the master node server in foreground:
node server.js
To run the master node in the background:
- Install screen if it is not installed yet:
sudo apt-get install screen
Start new screen: screen -dmS <screen name>
screen -S <screen name> -X stuff 'node server.js\n'
Attach to screen:
screen -r <screen name>
Detach from screen:
- While in screen, press
Ctrl
+A
, and thenD
.
Kill screen:
screen -S <screen name> -X quit