1. 程式人生 > >nginx停止,平滑重啟命令

nginx停止,平滑重啟命令

TERM, INT 快速關閉;

QUIT 從容關閉;

HUP 平滑重啟,重新載入配置檔案;

USR1 重新開啟日誌檔案,在切割日誌時用途較大;

USR2 平滑升級可執行程式;

WINCH 從容關閉工作程序;

【荔枝】

[[email protected] nginx]# nginx -c conf/nginx.conf
[[email protected] nginx]# 
[[email protected] nginx]# ps -ef | grep nginx
root      2138     1  0 06:30 ?        00:00:00 nginx: master process nginx -c conf/nginx.conf
nobody    2139  2138  0 06:30 ?        00:00:00 nginx: worker process   
nobody    2140  2138  0 06:30 ?        00:00:00 nginx: worker process   
nobody    2141  2138  0 06:30 ?        00:00:00 nginx: worker process   
root      2143  2083  1 06:30 pts/0    00:00:00 grep nginx
[
[email protected]
nginx]# [[email protected] nginx]# ps -ef | grep nginx root 2138 1 0 06:30 ? 00:00:00 nginx: master process nginx -c conf/nginx.conf nobody 2139 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2140 2138 0 06:30 ? 00:00:00 nginx: worker process nobody 2141 2138 0 06:30 ? 00:00:00 nginx: worker process root 2147 2083 3 06:32 pts/0 00:00:00 grep nginx [
[email protected]
nginx]# [[email protected] nginx]# kill -QUIT 2138 [[email protected] nginx]# [[email protected] nginx]# ps -ef | grep nginx root 2149 2083 2 06:32 pts/0 00:00:00 grep nginx

【nginx.conf 檔案如下】: 第2行的 woker_processes 3; 表示nginx主程序 帶有3個工作程序;

# this config is from 3-6
worker_processes 3; 
events {
	worker_connections 1024;  
}
http
{
    # first virtual host 第一個虛擬主機
    server
    {
        # ip and port monitored 監聽的ip和埠
        listen          192.168.186.100:80;
        # host name 主機名稱
        server_name    192.168.186.100;
        # the dir access_log saved 訪問日誌檔案存放路徑
        access_log      logs/server1.access.log combined;
        location /
        {
	    # default index file, priority reduction from left to right
		# 預設首頁檔案,順序從左到右,
            index index.html index.htm;
            # the dir html file saved, html網頁檔案存放目錄
            root  /data0/htdocs/server1;
        }
    }
    # second virtual host
    server
    {
        listen          192.168.186.101:80;
        server_name    192.168.186.101;
        access_log      logs/server2.access.log combined;
       location /
        {
            index index.html index.htm;
            root  /data0/htdocs/server2;
        }
    }
    # third virtual host
    server 
    {
        listen          192.168.186.102:80;
        server_name    192.168.186.102;
        access_log      logs/server3.access.log combined;
        location /
        {
            index index.html index.htm;
            root  /data0/htdocs/server3.com;
        }
    }
}


相關推薦

nginx停止平滑命令

TERM, INT 快速關閉; QUIT 從容關閉; HUP 平滑重啟,重新載入配置檔案; USR1 重新開啟日誌檔案,在切割日誌時用途較大; USR2 平滑升級可執行程式; WINCH 從容關閉工作

Nginx啟用, 停止, 平滑命令

啟動操作 nginx -c /usr/local/nginx/conf/nginx.conf -c引數指定了要載入的nginx配置檔案路徑 停止操作停止操作是通過向nginx程序傳送訊號(什麼是訊號請參閱linux文 章)來進行的步驟1:查詢nginx主程序號ps

php平滑nginx徹底清除WordPress的靜態快取

每一次分享技術文章,都是基於自己的痛點,基於自己的需求。這次也一樣,所以分享具體方法之前,我先說一下我這次的需求與痛點: 一、需求痛點 在部落格集成了程式碼版快取功能之後,為了方便在前臺清理頁面快取,我特意寫了ajax 清理快取的功能(相關文章)。這個功能寫好之後確實可以正常工作。 但是,為了讓

【學習筆記】啟動Nginx、檢視nginx程序、檢視nginx服務主程序的方式、Nginx服務可接受的訊號、nginx幫助命令Nginx平滑Nginx伺服器的升級

1.啟動nginx的方式:cd /usr/local/nginxls./nginx -c nginx.conf2.檢視nginx的程序方式:[[email protected] nginx

Openrestry 平滑(無reloadnginx

在分散式服務下,我們會用nginx做負載均衡, 業務站點訪問某服務站點的時候, 統一走nginx, 然後nginx根據一定的輪詢策略,將請求路由到後端一臺指定的伺服器上。 這樣的架構是沒有問題的, 但是我們這裡考慮幾個問題: 1) 業務頻繁上下線問題:

linux系統下nginx/mysql/php啟動、停止命令

/usr/local/nginx/sbin/nginx /etc/init.d/mysql start /usr/local/php/sbin/php-fpm start #nginx命令  start:  /usr/local/nginx/sbin/nginx  s

Openresty nginx 服務的啟動 停止 命令

ps 我的安裝在/opt/openresty/nginx 目錄 --啟動 /opt/openresty/nginx/sbin/nginx --停止 /opt/openresty/nginx/sbin/n

Nginx、php-fpm 和過載配置(平滑

Nginx Nginx程序分為master主程序和worker工作程序。master程序通過訊號通知worker程序執行工作。 命令 sudo nginx -s reload 過載配置(平滑重啟) sudo service nginx resta

深入剖析nginx平滑

本文適合對nginx實現原理比較感興趣的同學閱讀,需要具備一定的服務端程式設計知識。 一、背景 在伺服器開發過程中,難免需要重啟服務載入新的程式碼或配置,如果能夠保證server重啟的過程中服務不間斷,那重啟對於業務的影響可以降為0。最近調研了一下nginx平滑重啟,覺得

Android root環境下的一些可用操作(關機命令系統時間命令)

 近期正在做一些需要root許可權的功能,比如關機,重啟等,下面總結一下用過的root嚇得linux命令使用  1.重啟操作 Runtime.getRuntime().exec("su -c rebo

nginx平滑過程中提示[alert] kill(2942, 1) failed (No such process)問題分析及解決方案

場景 當nginx伺服器的配置加入新的模組後,若需要nginx伺服器使用新的配置,就必須平滑重啟nginx伺服器。 平滑重啟過程如下:nginx伺服器接收到重啟訊號時,首先讀取新的配置檔案,如果不存在語法問題,則啟動新的nginx服務,然後平緩的關閉原先的n

MAC Apache 啟動 停止 命令

最近自己配置Python的時候用到Apache的重啟 以前查過 但是現在還是每次用都得查詢 這次自己記下來好好看 停止服務:sudo /usr/sbin/apachectl stop 開啟服務:sudo /usr/sbin/apachectl start 重啟服務:s

WDCP各種停止命令

service wdapache start|stop|restart    wdcp後臺 啟動|停止|重起service nginxd start|stop|restart        nginx服務 啟動|停止|重起service httpd start|stop|restart          ht

linux 的Centos作業系統下 apache啟動、停止命令

若安裝路徑為:apahce安裝目錄為/usr/local/apache2,這些方法適合任何情況 apahce啟動命令: 推薦/usr/local/apache2/bin/apachectl start apaceh啟動 apache停止命令 /usr/local/apache2/bin/apachectl s

Nginx平滑

什麼是Nginx的平滑重啟? Nginx 執行新的工作程序並從容關閉舊的工作程序,通知工作程序關閉監聽套接字,但是繼續為當前連線的客戶提供服務。所有的客戶端的服務完成後,舊的工作程序被關閉。如果新的配置檔案應用失敗,Nginx 將繼續使用舊的配置檔案進行工作。

Linux 開機 關機命令整理

重啟命令: 1、sudo reboot 2、sudo shutdown -r now 立刻重啟 3、sudo shutdown -r 10 過10分鐘自動重啟 4、sudo shutdown -r 20:35 在時間為20:35時候重啟 關機命令: 1、sudo halt 立刻關機 2、sudo power

linux系統下apache服務的啟動、停止命令

本文假設你的apahce安裝目錄為/usr/local/apache2,這些方法適合任何情況 apahce啟動命令: 推薦/usr/local/apache2/bin/apachectl start apaceh啟動 apache停止命令 /usr/local/apa

記錄一次MySQL進程崩潰無法故障排查

not pool function 解決 variables fail data class 緩沖 最近程序在跑著沒幾天,突然訪問不了,查看應用進程都還在。只有數據庫的進程down掉了。於是找到日誌文件看到如下錯誤 2017-07-24 01:58:53 19934 [N

linux 關機命令

halt linu nbsp 取消 命令 linux 關機 power 關機 選項 shutdown命令 shutdown [選項] 時間 -c : 取消前一個關機命令 -h : 關機 -r : 重啟  halt 命令     poweroff命令      i

Linux關機命令命令

style spa eboot 屏幕 將在 syn ins size shu sync 將數據由內存同步到硬盤中。 shutdown 關機指令,你可以man shutdown 來看一下幫助文檔。例如你可以運行如下命令關機: shutdown –h 10 ‘This se