Page History
Excerpt | ||
---|---|---|
| ||
Staging Repo in 20 min |
The Staging Repository runs on top of NodeJS and uses a No-SQL database for storage. By default it uses MongoDB.
1, Install NodeJS.
2. Install MongoDB.
3. Install Git.
...
4. Check out the project with git or download it from here.
Code Block | ||||
---|---|---|---|---|
| ||||
git fetch && git checkout develop |
5. Configure npm to connect to Search Technologies artifactory repository for local dependencies:
- Open cmd as Administrator.
Code Block | ||||
---|---|---|---|---|
| ||||
npm install npmrc npmrc -c local npm config set registry https://repository.searchtechnologies.com/artifactory/api/npm/npm-virtual |
6. Get the Authentication token.
Code Block | ||||
---|---|---|---|---|
| ||||
curl -u<USERNAME>:<PASSWORD> https://repository.searchtechnologies.com/artifactory/api/npm/auth |
7. Append response to: C:\Users\<USERNAME>\.npmrcs\local
8. Save the file.
9. Install dependencies:
Code Block | ||||
---|---|---|---|---|
| ||||
npm install |
10. Start MongoDB.
Code Block | ||||
---|---|---|---|---|
| ||||
mongod |
11. Launch the Staging Repository.
Code Block | ||||
---|---|---|---|---|
| ||||
node server.js |
Storage
...
The Staging Repository data is stored in a No-SQL database. By default, the Staging Repository uses MongoDB as its storage option. Custom plugins can be developed for other No-SQL databases.
The Staging Repository will automatically create the database and all needed necessary collections (contents, transactions, settings, foreignkeys, and reprocesses) automatically that are used by each Storage Unit.
...
The Staging Repository can hold the configuration for multiple environments. The config/env
folder holds the different configuration files for all environments. An An environment configuration will inherit the configuration present in the config/env/all.js
file and can overwrite any configuration field by redefining it on the environments file. New configuration fields can be added to the environment file.
All configuration example:
Code Block | ||||
---|---|---|---|---|
| ||||
'use strict'; module.exports = { app: { title: 'Staging Repository', description: 'Staging Repository', keywords: 'MongoDB, Express, Node.js' }, port: process.env.PORT || 3000, templateEngine: 'swig', dbConn: { type: 'mongo', hbase:{ server: 'hadoop-thrift-server', port: 9090 }, mongo:{ server:'localhost', port: 27017, sharding: false } }, keyManager:{ type:'filebased', keysNumber: 1000, filebased:{ masterKeyLocation: 'config/MasterKey.txt' } }, reqBodySize: '1gb', reprocessQueue:{ batchSize: 20, querySize: 40, timeout: 3000 }, clusterMode: false }; |
Environment specific configuration (secure.js)
. In this example, the port and clusterMode parameter will be overridden. authList, logging, keyLocation, certLocation, caLocation, and passphrase will be added to the applications configuration.
...
To start the Staging Repository with an a specific environment configuration, set :
- Set the environment configuration name to the NODE_ENV environment variable.
- If the variable is not set, the application will start with the development configuration by default.