原创 Ansible_Inventory
Ansible_InventoryAnsible_Inventory1.定義主機和組2. 多個Inventory列表3. 動態Inventory4.Inventory參數列表管理被控端主機表;默認讀取/etc/ansible/hosts;可
原创 一致性哈希算法(consistent hashing)
一致性哈希算法在1997年由麻省理工學院提出的一種分佈式哈希(DHT)實現算法,設計目標是爲了解決因特網中的熱點(Hot spot)問題,初衷和CARP十分類似。一致性哈希修正了CARP使用的簡 單哈希算法帶來的問題,使得分佈式哈希(DHT
原创 More information on github
please browse github: github.com/duanyifei1937
原创 Ngx_http_gzip_module
Module ngx_http_gzip_moduleExample ConfigurationDirectives [gzip] [gzip_buffers] [gzip_comp_level] [gzip_disable] [
原创 Ngx_http-headers_module
Ngx_http_headers_module該模塊添加‘Expires’ & 'cache-control' 響應頭或其他任意響應頭;Example Configurationexpires 24h; expires modi
原创 Wget vs Curl
curl vs WgetWhat both commands doboth are command line tools that can download contents from FTP, HTTP and HTTPSboth can
原创 Ngx_http_proxy_module
proxy_passproxy_pass後的url加不加/的區別# 在nginx中配置proxy_pass時,當在後面的url加上了/,相當於是絕對根路徑,則nginx不會把location中匹配的路徑部分代理走;# 如果沒有/,則會把匹配
原创 shell m3u8-->ts
shell:m3u8-->ts需求:已知批量 m3u8 uri,求完整 ts文件 uri#由於sed不支持文本替換,生成臨時文件test_file #curl -s 忽略默認如下輸出 # % Total % Received % X
原创 Ansible_變量定義與引用
Ansible_變量定義與引用Ansible_變量定義與引用inventory定義主機及主機組(自定義變量)通過/etc/ansible/ 定義文件表示變量使用ansible-playbook命令行傳入:playbook中寫入:playbo
原创 shell 注意事項
shell注意事項記錄日誌shell執行加鎖(針對不能同時執行)加選項(禁止直接執行)備註#記錄日誌 #!/bin/bash shell_log="./shell_log" #Write log shell_log(){
原创 Nginx_upstream
Nginx_upstream 負載均衡&高可用負載均衡調度算法:upstream duanserver { server 192.168.4.41:80 weight=1 max_fails=3 fail_timeout=10s;
原创 ansible_vault
Ansible-vault ansible加密模塊,將pwd/token等敏感信息加密; 此處給出最簡單的使用方式,加密保存ssh-pwd,獲取remote_host_hostname; 1. # Iventory,並未做ssh-cop
原创 查看物理cpu & 核數 & 邏輯cpu個數
# 查看物理CPU個數cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l# 查看每個物理CPU中core的個數(即核數)cat /proc/cpuinfo| grep "cpu