Install NodeRED for Plant Applications Releases Earlier than SP1
About this task
Use this procedure to install NodeRed when you are using Plant Applications versions earlier than SP1.
Procedure
- Update the gateway-service-prod.properties file in the following location: {{installation path }}/PlantApplicationsDocker/plantapps-web-docker/mnt/configfiles/gateway-service/prod/{{version}}/.
-
Verify that the NodeRED path already exists. If the NodeRED path is not
available, then update the path by adding the following:
-
spring.cloud.gateway.routes[57].id=nodered spring.cloud.gateway.routes[57].uri=http://node-red:1880/nodered spring.cloud.gateway.routes[57].predicates[0]=Path=/nodered/** spring.cloud.gateway.routes[57].filters[0]=RewritePath=/nodered/(?<segment>.*), /nodered/${segment} spring.cloud.gateway.routes[57].filters[1]=DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin spring.cloud.gateway.routes[57].filters[2].name=Retry spring.cloud.gateway.routes[57].filters[2].args.retries=3 spring.cloud.gateway.routes[57].filters[2].args.statuses=${retryable_statuses} spring.cloud.gateway.routes[57].filters[2].args.methods=GET,POST spring.cloud.gateway.routes[57].filters[2].args.backoff.firstBackoff=10ms spring.cloud.gateway.routes[57].filters[2].args.backoff.maxBackoff=50ms
-
spring.cloud.gateway.routes[61].id=pa-nodered-app-2 spring.cloud.gateway.routes[61].uri=http://panoderedapp:9003 spring.cloud.gateway.routes[61].predicates[0]=Path=/pa-nodered-app/properties/** spring.cloud.gateway.routes[61].filters[0]=RewritePath=/pa-nodered-app/(?<segment>.*),/node-red/${segment}
-
spring.cloud.gateway.routes[62].id=pa-nodered-app spring.cloud.gateway.routes[62].uri=http://panoderedapp:9003 spring.cloud.gateway.routes[62].predicates[0]=Path=/confighub_plugin/pa-nodered-app/{segment}, /pa-nodered-app/{segment} spring.cloud.gateway.routes[62].filters[0]=SetPath=/node-red/{segment} spring.cloud.gateway.routes[62].filters[1]=DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin spring.cloud.gateway.routes[62].filters[2].name=Retry spring.cloud.gateway.routes[62].filters[2].args.retries=3 spring.cloud.gateway.routes[62].filters[2].args.statuses=${retryable_statuses} spring.cloud.gateway.routes[62].filters[2].args.methods=GET,POST spring.cloud.gateway.routes[62].filters[2].args.backoff.firstBackoff=10ms spring.cloud.gateway.routes[62].filters[2].args.backoff.maxBackoff=50ms
-
-
Restart Gateway service by typing the following commands:
docker service scale PAGatewayService_gateway-service=0
docker service scale PAGatewayService_gateway-service=1
- Update the haproxy.cfg file in the following location: {{installation path }}/PlantApplicationsDocker/plantapps-web-docker/mnt/paweb/config/.
-
Add the following configuration:
use_backend gatewayServiceBackend if { path -i -m reg -i ^[^\.]*-nodered-app }
-
Restart the Haproxy service by typing the following commands:
docker service scale PAHaproxy_haproxy=0
docker service scale PAHaproxy_haproxy=1