Build multiple nodes of one service


#1

From @jackytu256 on Fri Jan 12 2018 07:24:26 GMT+0000 (UTC)

HI All,

I am looking for a way to run multiple nodes of one service. I know there is a parameter called “max_workers” in cofig file, having more workers to deal with requests; however, this is not a way I can utilize at least two nodes of one service.

BR
Jacky Tu

Copied from original issue: https://github.com/nameko/nameko/issues/502


#2

From @mattbennett on Fri Jan 12 2018 07:45:34 GMT+0000 (UTC)

You just need to start multiple processes.

$ nameko run module:Service &
[1] 96201
starting services: service
Connected to amqp://guest:**@127.0.0.1:5672//

$ nameko run module:Service &
[2] 96215
starting services: service
Connected to amqp://guest:**@127.0.0.1:5672//

$ ps aux | grep nameko
mattbennett      96235   0.0  0.0  2424600    368 s004  R+    7:39am   0:00.00 grep nameko
mattbennett      96215   0.0  0.2  2439900  28724 s004  S     7:39am   0:00.60 /Users/mattbennett/.virtualenvs/nameko/bin/python3.5 /Users/mattbennett/.virtualenvs/nameko/bin/nameko run module:Service
mattbennett      96201   0.0  0.2  2439900  28576 s004  S     7:39am   0:00.90 /Users/mattbennett/.virtualenvs/nameko/bin/python3.5 /Users/mattbennett/.virtualenvs/nameko/bin/nameko run module:Service