Step 4: Create application instances

a) Application on server APP1

  1. Navigate to Applications service

  2. Click Add new Node App

  3. Select Server APP1

  4. Set Number of instances as 2

  5. Set Starting port as 8000

  6. Click Save application

You can increase the number of instances to increase resource utilization. For example setting Number of instances as 5 and Starting port as 8000 will result in creating 5 NodeJS processes each receiving a different port number as an environment variable:

  • Instance #1: PORT=8000

  • Instance #2: PORT=8001

  • Instance #3: PORT=8002

  • Instance #4: PORT=8003

  • Instance #5: PORT=8004

b) Application on server APP2

  1. Click Add new Node App again

  2. Select Server APP2

  3. Set Number of instances as 2

  4. Set Starting port as 9000

  5. Click Save application

Once the applications are created ClusterWare will try to sync their status. Once the sync is complete you'll see an "No such file or directory" error message - which is expected as we haven't imported the application source code to the server yet. We'll do that in the next step...

Last updated