How to restart only nginx instance in API Node

kpk_devops
Level 1
How to restart only nginx instance in API Node

I have update nginx.conf file in API Node and need to restart only nginx instance without restarting other services, please suggest.

 

If I restart dss , by default the nginx will also restart.

 

Regards,

PK

0 Kudos
3 Replies
GCase
Dataiker

If you have a regular setup with Linux this should work

sudo service nginx restart

This command restarts nginx 

0 Kudos
sergeyd
Dataiker

Hi @kpk_devops 

Nginx server is maintained by supervisor one. So you cannot just restart nginx process only. You will need to restart DSS via dss binary.

Having said this, you can force nginx server (including worker) to stop by kill command and supervisor will spawn the new process: 

 

[dataiku@702api data_dir_api]$ ps -ef | grep nginx
dataiku   1847  1843  0 04:24 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /home/dataiku/data_dir_api/install-support/nginx.conf
dataiku   1901  1847  0 04:24 ?        00:00:00 nginx: worker process
dataiku   1944  1585  0 04:25 pts/0    00:00:00 grep --color=auto nginx
[dataiku@702api data_dir_api]$ kill -9 1901 1847
[dataiku@702api data_dir_api]$ ./bin/dss status
apimain                          RUNNING   pid 1846, uptime 0:01:19
nginx                            STARTING  
[dataiku@702api data_dir_api]$ ./bin/dss status
apimain                          RUNNING   pid 1846, uptime 0:01:26
nginx                            RUNNING   pid 1945, uptime 0:00:11

 

As you can see, the new PID was generated for nginx server. Please give it a try and check if this works for you. 

UPD: You can also simply use
./dss restart nginx

0 Kudos
kpk_devops
Level 1
Author

Thank you very much

0 Kudos

Labels

?
Labels (1)
A banner prompting to get Dataiku