-
Recent Posts
Recent Comments
Categories
Links
Monthly Archives: March 2019
rabbitmq recovery fail處理
rabbitmq啟動失敗時,可查看log (/var/log/rabbitmq)或是使用command line方式啟動rabbitmq-server 可以看出 /var/lib/rabbitmq/mnesia/$HOST 下的 recovery.dets 可能損毀 檢查一下 ls -l recovery.dets 發現檔案大小是0 代表可能當時開啟檔案後寫入失敗 這在當硬碟空間不足時可能發生,rabbitmq預設小於50MB時會停止服務(一般是每10秒檢查一次 disk alarm on時 等待consumer消耗掉messages,但也有可能是其他process影響到磁碟空間) When free disk space drops below a configured limit (50MB by default), an alarm will be triggered and all producers will … Continue reading
Posted in System Administration
Leave a comment
nmap
nmap -sP 192.168.2.0/24 用來偵測開機的ip mac,適合當不知道guest vm的ip時,先查除vm的網卡mac,再找出對應的ip
Posted in System Administration
Leave a comment
同一個port同時支援http/https
在nodejs下 httpolyglot套件可以讓server在同一個port同時支援http/https 其原理是透過偵測第一個byte 的差異來決定這條連線要走http or https TLS的一開頭 record header 第一個byte是0x16,在HTTP裡的第一個byte不會出現此數值。 參考: https://tls.ulfheim.net/ https://github.com/mscdex/httpolyglot
Posted in nodejs
Leave a comment
jq
這邊主要是介紹一個不錯的command line util: jq jq主要是command line JSON filter,適合用在bash script處理json,特別是要取得特定的field,和處理formatting bash script一般處理文字常用sed, awk,但是遇到json,單純的字串處理很難應付複雜的結構。 參考: https://stedolan.github.io/jq/manual/
Posted in System Administration
Leave a comment