--- title: Nginx upgrade project tags: nginx description: Proxy 升級計畫介紹 slideOptions: spotlight: enabled: true progress: true --- # Nginx upgrade project [Slide link](https://hackmd.io/@bULAV3m2SmimwHsIRJ8smg/S1p8JZjdr) --- ## Outline - 新增 Supervisord - 新增 zabbix-agent - 新增 hping - 使用 firewalld 取代 iptables(待寫) --- ## Suppervisord - [Official Page](http://supervisord.org/) - 使用 python 開發的進程管理工具。 - 可用來監控進程狀態,自動重啟進程。 - Python3 version 3.4 or later and Python2 version 2.7 - Only on unix-like OS. ---- ### cont. - 利用 supervisord 監控 nginx, redis. - 服務死掉會進行重啟。 ---- ### 啟動 nginx 方法差異 ---- | | CentOS6 | | -------- | :-----------------------: | |System daemon| `/etc/init.d/nginx start` | |Supervisorctl| :x:我們沒裝 | |Nginx |`/path/to/sbin/nginx` | ---- | | CentOS7 | | ----------- | :--------------------------------------------------------------------------------------: | |System daemon| `systemctl start nginx` | |Supervisorctl| <span><!-- .element: class="fragment highlight-red" -->`supervisorctl start nginx`</span>| |Nginx |`/path/to/sbin/nginx` | ---- ### Caution ! - Proxy操作請改用以下方式。 - 使用 `supervisorctl start nginx` 進行啟動。 - 使用 `supervisorctl stop nginx` 進行關閉。 - 重新讀取設定用 `/usr/local/nginx/sbin/nginx -s reload`。 - redis 的服務,自行舉一反三。 ---- ### Demo - pkill - `/usr/local/nginx/sbin/nginx -s stop` --- ## Zabbix Agent - [Office Page](https://www.zabbix.com/documentation/4.0/zh/manual/concepts/agent) - 用 C 語言開發的監控工具。 - 蒐集本機的狀態,傳到 Zabbix Server(Like Nagios ft. Nrpe)。 - Active mode, _port 10051_。 - Passive mode, _port 10050_。 - **Auto registration** and **Discovery** ----  ---- ### Monitor [Grafana](http://10.11.100.200:3000/d/EISUnypWk/zabbix-servers-status-table?orgId=1&refresh=1m&from=now-5m&to=now&var-Group=CB%20General%20Nginx%20Group&var-Hosts=All) [Zabbix](http://10.11.100.241/zabbix) --- ## hping - 測試工具 - 可用來測 ICMP, TCP, UDP - SCAN port - ~~DOS 攻擊~~ ---- ### ICMP測試 `hping -1 127.0.0.1` ---- ### TCP測試 `hping -S -p 80 127.0.0.1` ---- ### 更多變化 [hping3使用](https://mochazz.github.io/2017/07/23/hping3/#ICMP%E6%B5%8B%E8%AF%95) --- ## firewalld - CentOS7 原生的防火牆 - [iptables](/0ZS4naOwR-iKVl2fc_1XYA) ---- ### 使用 ansible 進行調整 ----
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up