1.3.30 • Published 4 years ago

scada-dataworker v1.3.30

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

EI-PaaS-SCADA/scada-dataworker


Enviroment

npm node


Develop Environment

1 Build Setup

Install dependencies
$ npm install
Edit Database config on setting.dev.js

Modify the setting of MongoDB, PostgreSQL, and AMQP

#MongoDB setting
MongoDB: {
  host: "${MongoDB IP}",
  port: ${MongoDB Port},
  username: "${MongoDB username}",
  password: "${MongoDB Password}",
  database: "${MongoDB DB Name}"
}

#postgresSQL setting
PostgreSQL: {
  host: "${PostgreSQL IP}",
  port: ${PostgreSQL Port},
  username: "${PostgreSQL username}",
  password: "${PostgreSQL Password}",
  database: "${PostgreSQL DB Name}"
}

#AMQP setting
AMQP: {
  uri: "amqp://${AMQP username}:${AMQP Password}@${AMQP IP}:${AMQP Port}"
}

2 Run scada-dataworker

Lunch scada-dataworker via command
$ npm run debug

Cloud Foundry

0 Prerequisites

  • Check rabbitmq service instance are in cf services. If not, please follow the document made by III to generate them.
  • Check g_scada role exists in postgreSQL. If not, please follow the document made by III to generate it.
  • Check the buildpack nodejs_buildpack_1607 exists in cf buildpacks list.
  • If need to use InfluxDB to record data, Check InfluxDB-SCADA service instance (User Provided Service) are in cf services. If not please create a new one. The command as follow:
$ cf-services\influxdb-scada.bat

1 Push Application to PCF

Generate manifest.yml and uglify source code via command
$ npm install
$ npm run stage

2 Push Application to PCF

$ cf push -f manifest.yml -u process --no-start
$ cf bind-service scada-dataworker postgresql -c config.json
$ cf start scada-dataworker

3 Switch MongoDB and InfluxDB for history data

$ cf bind-service InfluxDB-SCADA