How to restart only nginx instance in API Node

kpk_devops
kpk_devops Registered Posts: 7 ✭✭✭

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

Tagged:

Answers

  • GCase
    GCase Dataiker, PartnerAdmin, Registered Posts: 27 Dataiker

    If you have a regular setup with Linux this should work

    sudo service nginx restart

    This command restarts nginx

  • Sergey
    Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
    edited July 17

    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

  • kpk_devops
    kpk_devops Registered Posts: 7 ✭✭✭

    Thank you very much

Setup Info
    Tags
      Help me…