20170619_jeffrey - silenceuncrio/diary GitHub Wiki
0935
週報上禮拜五下班前就交了
ariel 上禮拜請假一個禮拜
待會十點我們 M300 小組會再開個會 review 一下
0945
morris 表示 CPU 降頻的版本雖然沒辦法讓 M300 在零下 40 度開機
不過感覺零下 25 度開機的穩定性好很多
待會開會時我來提一下
看是不是在下一次的 release 也套用 CPU 降頻的修改
1035
週會得到的八卦
- 公司裁員 13 位
- 36 號 6 位
- 38 號 6 位
- 一位 未知
- 公司之後會分成兩個事業部門
- M300
- 舊產品
周會到一半因為老闆們有業務會議要開所以被打斷了
ariel 希望知道 CPU 降頻的開機速度會比之前慢多少
然後才來討論是不是要把該修改套到下次的 release 去
先量一下上次 release 的開機速度
- 38 秒
再量一下 CPU 降頻後的開機速度
- 56 秒
- 60 秒
- 62 秒
先這樣吧
1100
回到 VRRP
熟悉一下 Keepalived User Guide
的 Keepalived configuration synopsis
1130
M300 週會 繼續
ariel 聽到 CPU 降頻後的開機速度從大約 40 秒變成 60 秒之後就放棄了
1315
更新一下上禮拜解決的兩個 issue
- 0000431: [https] PC in WAN side, PC using https link to M300 fail
- 0000433: [DMZ] DMZ no effect
1400
剛剛去 DQA 那邊搞清楚 0000439: [SNMP for Trap] configure Trap enable and apply, no effect 是怎麼回事
目前已經從 UI 的角度順利的解決該 issue
commit 8d69390ff360262b0817c68e9a763b9f1b40a296
Author: jeffrey <[email protected]>
Date: Mon Jun 19 14:02:07 2017 +0800
Solve issue - 0000439: [SNMP for Trap] configure Trap enable and apply, no effect
- the 'destination' field should not be empty and should be a valid IPv4 address while trap mode is enable
1415
依據 Keepalived configuration synopsis 來解析 keepalived/doc/samples/keepalived.conf.vrrp
! Configuration File for keepalived
!
開頭應該是註解
先看 Global Definitions
global_defs {
notification_email {
acassen
}
notification_email_from [email protected]
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
- notification_email
- email accounts that will receive the notification mail
- Type: List
- value:
{ acassen }
- notification_email_from
- email to use when processing "MAIL FROM:" SMTP command
- Type: List
- value:
[email protected]
- smtp_server
- server to use for sending mail notifications
- Type: alphanum
- value:
192.168.200.1
- smtp_connect_timeout
- specify a timeout for SMTP stream processing
- Type: numerical
- value:
30
- router_id
- 在 Keepalived configuration synopsis 並沒有該欄位
1515
在不提供 /etc/keepalived/keepalived.conf
的情況之下
M300 的 keepalived
執行結果如下
root@Mobile Router:~# keepalived -l
Starting Keepalived v1.3.5 (03/19,2017)
Unable to resolve default script username 'keepalived_script' - ignoring
Unable to find configuration file /etc/keepalived/keepalived.conf (glob returned 3)
Stopped Keepalived v1.3.5 (03/19,2017)
給個空的 global_defs
的 keepalived.conf
root@Mobile Router:/etc/keepalived# cat keepalived.conf
global_defs {
}
執行結果
root@Mobile Router:/etc/keepalived# keepalived -l
Starting Keepalived v1.3.5 (03/19,2017)
Unable to resolve default script username 'keepalived_script' - ignoring
Opening file '/etc/keepalived/keepalived.conf'.
看一下有啥 proscess 跑起來了
root@Mobile Router:/etc/keepalived# ps aux | grep keep
root 28209 0.0 0.0 2668 360 ttymxc0 S+ 07:16 0:00 grep keep
root 30303 7.5 0.1 4284 928 ? Ss 07:12 0:18 keepalived -l
root 30307 0.0 0.3 4612 1560 ? S 07:12 0:00 keepalived -l
1525
繼續研究 vrrp_instance
的部分
keepalived/doc/samples/keepalived.conf.vrrp 計有 4 個 vrrp_instance
vrrp_instance VI_1 {
...
}
vrrp_instance VI_2 {
...
}
vrrp_instance VI_3 {
...
}
vrrp_instance VI_4 {
...
}
先看 vrrp_instance VI_1
vrrp_instance VI_1 {
state MASTER
interface eth0
garp_master_delay 10
smtp_alert
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.200.16
192.168.200.17
192.168.200.18
# optional label. should be of the form "realdev:sometext" for
# compatibility with ifconfig.
192.168.200.18 label eth0:1
}
}
vrrp_instance VI_1
- identify a VRRP instance definition block
- value:
VI_1
state MASTER
- specify the instance state in standard use
- 可容許值
MASTER|BACKUP
- value:
MASTER
interface eth0
- specify the network interface for the instance to run on
- value:
eth0
garp_master_delay 10
- 文件沒提到
smtp_alert
- Activate the SMTP notification for MASTER state transition
- 有寫就是
Activate
priority 100
- specify the instance priority in the VRRP router
- value:
100
advert_int 1
- specify the advertisement interval in seconds (set to 1)
- value:
1
authentication { ... }
- identify a VRRP authentication definition block
auth_type PASS
- specify which kind of authentication to use (PASS|AH)
- value:
PASS
auth_pass 1111
- specify the password string to use
- value:
1111
- virtual_ipaddress { ... }
- identify a VRRP VIP definition block
1550
目前搭配以下的 configuration
root@Mobile Router:/etc/keepalived# cat keepalived.conf
global_defs {
}
vrrp_instance test_1 {
state MASTER
interface lan
virtual_router_id 100
priority 100
advert_int 1
virtual_ipaddress {
192.168.1.101
192.168.1.102
}
}
跑起來的訊息看到
root@Mobile Router:/etc/keepalived# keepalived -l
Starting Keepalived v1.3.5 (03/19,2017)
Unable to resolve default script username 'keepalived_script' - ignoring
Opening file '/etc/keepalived/keepalived.conf'.
一樣是看到 2 個 process
root@Mobile Router:/etc/keepalived# ps aux | grep keep
root 1077 0.0 0.0 2668 360 ttymxc0 S+ 07:47 0:00 grep keep
root 30725 7.5 0.2 4284 1028 ? Ss 07:46 0:01 keepalived -l
root 30727 0.0 0.3 4612 1656 ? S 07:46 0:00 keepalived -l
不過不知道怎麼觀察 keepalived 的執行狀況為何
1615
google 到了 Keepalived User Guide Release 1.2.15
這應該會比我在日記 20170613_jeffrey 整裡的 index 更適合閱讀
另外可以找時間參考下面的文章照表操課一下
1720
找到了 [meta-networking,1/3] keepalived: add new recipe
明天來試試這個 keepalived recipe
1730
monkeyjj time