Vitalsigns installation
Vitalsigns can be installed on a single server, or have its components distributed across multiple servers. In current running environments, the test and staging environments are single server, and the production environments user a back end server and front end server.
Prerequisites
Back end Server
- MongoDb 3.6 or greater
- Java 1.8 or greater
- Postgresql 9.3 or greater
- systemd package
- Access to RabbitMQ 3.6+, In production this is running on the front end server
Front end Server
- Access to RabbitMQ 3.6+, In production this is running on the front end server
- node js 8.x+
- redis 4.x+
- a node process manager, we have used both forever, and pm2
Installation
Both front and back end
- Create a vitalsigns account on the server and transfer the distribution tar.gz file created by the build to the home directory of that account.
- Extract the tar contents:
tar -xvf vitalsigns-<release>.tar.gzwhere <release> is the release number built.
Configure back end components
- create a vitalsigns postgres user and database:
sudo -u postgres psql
postgres=# create role vitalsigns with createdb login password 'yourpassword' superuser;
postgres=# create database vitalsigns owner vitalsigns;
- cd to vitalsigns-version/sql
- create the psotgres schema:
psql -h localhost -U vitalsigns -d vitalsigns -f baseTables_1.0.sql
psql -h localhost -U vitalsigns -d vitalsigns -f appTables_1.0.sql
psql -h localhost -U vitalsigns -d vitalsigns -f baseTableData_1.0.sql
psql -h localhost -U vitalsigns -d vitalsigns -f secTableData_1.0.sql
- cd ../setup
- edit the vs-dataserver.service file and verify the working directory, homedir parameter and confdir parameter point to the correct directories for your distribution
- copy the service file to the /etc/systemd/system directory:
sudo cp vs-dataserver.service /etc/systemd/system
Update configuration files
cd to vitalsigns-release/conf
Update the postgress.properties file for your environemnt. The default file is:
dataSourceClassName=org.postgresql.ds.PGSimpleDataSource
dataSource.user=vitalsigns
dataSource.password=yourpassword
dataSource.databaseName=vitalsigns
dataSource.serverName=localhost
update serverName if you are accessing a remote Postgresql database and set the password to the password of the vigtalsigns account created earlier.
Update the mongo.properties file. the default file is:
host=localhost
db=vitalsigns_
dbPerApp=true
maxDetailRows=200000
Update host if connecting to a remote mongodb. Add username and password if you have enabled logins on your mongodb installation.
Edit dataserver-logging.properties and find this line:
log4j.appender.F1.File=/home/vitalsigns/vitalsigns-1.0/logs/dataserver.log
Verify that the log file path is correct for your environment.
repeat that process with batchloader-logging.properties.
edit dataserver.properties the default file looks like:
sqldb=postgress
mongodb=mongo
cacheVersion=2
rabbit.host=localhost
rabbit.exchange=nd5.dataserverex
rabbit.queue=nd5.dataserverq
If Rabbit MQ is running on a different server set the server name in rabbit.host. If the rabbit installation requires a username and password, add rabbit.username and rabbit.password lines with the proper values.
If there are other vitalsigns installations using the same RabbitMq server, you will also want to change the rabbit.exchange and rabbit.queue values. Typically this is done by appending . and an identfier to the end. (ex: nd5.dataserveq.test).
Once this is complete start the vs-dataserver service:
reload the systemd daemon information:
sudo systemctl daemon-reload
Start the service:
sudo systemctl start vs-dataserver
Finally enable it restart at boot:
sudo systemctl enable vs-dataserver
That completes the backend set up.
Front end configuration.
cd vitalsigns-release/vsWeb directory
edit config.js. The default looks like:
var config = {};
config.rabbitURL=process.env.RABBITMQ_URL || 'localhost';
config.rabbitQueue=process.env.RABBITMQ_QUEUE ||'nd5.dataserverq';
config.rabbitTimeOut=process.env.RABBITMQ_TIMEOUT ||300000;
config.sessionTimeout=60; //minutes
module.exports = config;
Change the config.rabbitQueue entry so that it matches the queue configured on the back end above.
If RabbitMQ is running on a different node or requires username and password, modify the rabbit URL to point to the correct node. For a secured connection the URL would be username:password@host:port port is optional if using the default port.
By default the web application will run on port 3000, if a different port is desired, it can be passed as a parameter when starting the application. To start the web application using pm2 and the default port:
cd bin
pm2 start www
To start on a different port:
pm2 start www --
Once started enter the command:
pm2 startup
This will ensure it starts on reboot.
This completes the installation. to test:
http://server:port/logon
There is a single admin user created by default. Username: admin, password: vitalsigns.
It should be possible to log in with those credentials.