You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

StageR runs on top of NodeJS and uses a No-SQL database for storage. By default it uses MongoDB.

  1. Download and install NodeJS.
  2. Download and install MongoDB.
  3. Download StageR from here.
  4. Configure npm to connect to Search Technologies artifactory repository for local dependencies:

    1. Open cmd as Administrator 

      npm install npmrc -g
      npmrc -c local
      npm config set registry https://repository.searchtechnologies.com/artifactory/api/npm/npm-virtual


    2. Get Authentication token (using curl or Postman)

      curl -u<USERNAME>:<PASSWORD> https://repository.searchtechnologies.com/artifactory/api/npm/auth


    3. Append response to: C:\Users\<USERNAME>\.npmrcs\local

    4. Save file

  5. Install dependencies:

    npm install --production
  6. Start MongoDB.

    mongod
  7. Launch StageR.

    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 create the database and all necessary collections (contentstransactionssettingsforeignkeys, and reprocesses) automatically that are used by each Storage Unit.

Environment Configurations


The Staging Repository can hold the configuration for multiple environments. The config/env folder holds the different configuration files for all environments.  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:

'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.

'use strict';
module.exports = {
    port: 44300,
    authList :[
        'Aspire',
        'testuser'
    ],
    logging:{
        express: {
            request: [
                'connection.remoteAddress',
                'authorizedCN'
            ],
            response: [
            ]
        },
        transports:{
            console:{
                level: 'debug',
                enable: false
            },
            file:{
                level: 'info',
                enable: true
            }
        }
    },
    keyLocation: 'config/sslcerts/sr_server_key.pem',
    certLocation: 'config/sslcerts/sr_server_cert.crt',
    caLocation: 'config/sslcerts/cacert.crt',
    passphrase: '123456abC',
    clusterMode: true
};

To start the Staging Repository with a specific environment configuration:

  • 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.


  • No labels