20170612_jeffrey - silenceuncrio/diary GitHub Wiki

0915

monkeyjj time

1300

上禮拜幫 morris 燒錄了兩片 M00 CPU Board - feature branch low-temperature-boot-up

目前只有一片參加挑戰

就稱為 降頻 旺宏 1 號

零下 20 度開機一次就成功

繼續降溫到 零下 30 度 待會三點再試試

1330

迷迷糊糊跟著 Chapter 8: Socialite - One Click Facebook Login 的腳步

目前的網站已經可以容許使用者直接用 facebook 帳號來做登入

不過很多細節我都跳過去了

1500

降頻 旺宏 1 號

零下 30 度開機 也是一次就成功

繼續降溫到 零下 40 度

下班前再試試

1535

回到主軸 VRRP

➜  M300 git:(feature/low-temperature-boot-up) git checkout feature/vrrp
Switched to branch 'feature/vrrp'
➜  M300 git:(feature/vrrp)
ll$                                                                                                                                                                                   [8/1626]
build@2f192722794e:/var/m300/build_small$
build@2f192722794e:/var/m300/build_small$ source bimage.sh
Loading cache: 100% |#############################################################################| ETA:  00:00:00
Loaded 2758 entries from dependency cache.
Parsing recipes: 100% |###########################################################################| Time: 00:00:00
Parsing of 2193 .bb files complete (2191 cached, 2 parsed). 2757 targets, 183 skipped, 5 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.28.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "m300"
DISTRO            = "proscend-m300"
DISTRO_VERSION    = "4.1.15-1.2.0"
TUNE_FEATURES     = "arm armv7a vfp neon callconvention-hard cortexa7"
TARGET_FPU        = "vfp-neon"
meta
meta-yocto        = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia   = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm      = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos    = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"
meta-bsp
meta-sdk          = "HEAD:dfbc90ee74624ce3be636c8bd2a47114fa2b71aa"
meta-browser      = "HEAD:b6d46d69a261fe6bd7c1e9811dc2a9bbd0b79aeb"
meta-qt5          = "HEAD:d5536e34ec985c82b621448ab4325e5cbba38560"
meta-networking
meta-python
meta-ruby
meta-filesystems
meta-gnome        = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-proscend     = "feature/vrrp:30d98fdd49da430506d4048f1fe2202a75ae3319"

NOTE: Preparing RunQueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
Loading cache: 100% |#############################################################################| ETA:  00:00:00
Loaded 2758 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.28.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "m300"
DISTRO            = "proscend-m300"
DISTRO_VERSION    = "4.1.15-1.2.0"
TUNE_FEATURES     = "arm armv7a vfp neon callconvention-hard cortexa7"
TARGET_FPU        = "vfp-neon"
meta
meta-yocto        = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia   = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm      = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos    = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"
meta-bsp
meta-sdk          = "HEAD:dfbc90ee74624ce3be636c8bd2a47114fa2b71aa"
meta-browser      = "HEAD:b6d46d69a261fe6bd7c1e9811dc2a9bbd0b79aeb"
meta-qt5          = "HEAD:d5536e34ec985c82b621448ab4325e5cbba38560"
meta-networking
meta-python
meta-ruby
meta-filesystems
meta-gnome        = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-proscend     = "feature/vrrp:30d98fdd49da430506d4048f1fe2202a75ae3319"

NOTE: Preparing RunQueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
Loading cache: 100% |#############################################################################| ETA:  00:00:00
Loaded 2758 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.28.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "m300"
DISTRO            = "proscend-m300"
DISTRO_VERSION    = "4.1.15-1.2.0"
TUNE_FEATURES     = "arm armv7a vfp neon callconvention-hard cortexa7"
TARGET_FPU        = "vfp-neon"
meta
meta-yocto        = "HEAD:dd0ba9ea4a11ab15348d4fe3574e4b28784db82f"
meta-oe
meta-multimedia   = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-fsl-arm      = "HEAD:35b8b9bd9863de208ab60e33b55f10ee43e2619b"
meta-fsl-arm-extra = "HEAD:e200df91b70da254461c59082ddd5db0a3c415a2"
meta-fsl-demos    = "HEAD:2231e946e7a94d096394f2b2477e8184c9bbde7b"
meta-bsp
meta-sdk          = "HEAD:dfbc90ee74624ce3be636c8bd2a47114fa2b71aa"
meta-browser      = "HEAD:b6d46d69a261fe6bd7c1e9811dc2a9bbd0b79aeb"
meta-qt5          = "HEAD:d5536e34ec985c82b621448ab4325e5cbba38560"
meta-networking
meta-python
meta-ruby
meta-filesystems
meta-gnome        = "HEAD:ad6133a2e95f4b83b6b3ea413598e2cd5fb3fd90"
meta-proscend     = "feature/vrrp:30d98fdd49da430506d4048f1fe2202a75ae3319"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: prosrc: compiling from external source tree /var/m300/proscend
WARNING: File 'usr/lib/libicos.so' from prosrc was already stripped, this will prevent future debugging!
WARNING: File 'usr/lib/libcgi.so' from prosrc was already stripped, this will prevent future debugging!
WARNING: QA Issue: prosrc: /prosrc/usr/sbin/chronyd is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
WARNING: QA Issue: /www/cgi-bin/ipfilter.cgi_prosrc contained in package prosrc requires libcgi.so, but no providers found in its RDEPENDS [file-rdeps]
NOTE: Tasks Summary: Attempted 2612 tasks of which 2599 didn't need to be rerun and all succeeded.

Summary: There were 4 WARNING messages shown.

這次就沒出現啥 QA Issue 的問題

ERROR: QA Issue: File '/usr/sbin/keepalived' from keepalived was already stripped, this will prevent future debugging! [already-stripped]

這個 issue 先 bypass

先做 firmware upgrade

確定我們有 keepalived 可以用

root@Mobile Router:~# keepalived -h
Usage: keepalived [OPTION...]
  -f, --use-file=FILE          Use the specified configuration file
  -P, --vrrp                   Only run with VRRP subsystem
  -C, --check                  Only run with Health-checker subsystem
  -l, --log-console            Log messages to local console
  -D, --log-detail             Detailed log messages
  -S, --log-facility=[0-7]     Set syslog facility to LOG_LOCAL[0-7]
  -X, --release-vips           Drop VIP on transition from signal.
  -V, --dont-release-vrrp      Don't remove VRRP VIPs and VROUTEs on daemon stop
  -I, --dont-release-ipvs      Don't remove IPVS topology on daemon stop
  -R, --dont-respawn           Don't respawn child processes
  -n, --dont-fork              Don't fork the daemon process
  -d, --dump-conf              Dump the configuration data
  -p, --pid=FILE               Use specified pidfile for parent process
  -r, --vrrp_pid=FILE          Use specified pidfile for VRRP child process
  -c, --checkers_pid=FILE      Use specified pidfile for checkers child process
  -a, --address-monitoring     Report all address additions/deletions notified via netlink
  -s, --namespace=NAME         Run in network namespace NAME (overrides config)
  -m, --core-dump              Produce core dump if terminate abnormally
  -M, --core-dump-pattern=PATN Also set /proc/sys/kernel/core_pattern to PATN (default 'core')
  -i, --config_id id           Skip any configuration lines beginning '@' that don't match id
  -v, --version                Display the version number
  -h, --help                   Display this help message
root@Mobile Router:~#

看來是可以來 google 一下怎麼玩 keepalived

1550

參考官網的 Documentation

先看一下 Software Design 的部分

1625

目前還不知道怎麼來啟動 keepalived

1655

從網路上抄一支 keepalived/doc/samples/keepalived.conf.vrrp.localcheck

root@Mobile Router:/etc# cat /etc/keepalived/keepalived.conf


! Configuration File for keepalived

vrrp_script chk_sshd {
       script "killall -0 sshd"        # cheaper than pidof
       interval 2                      # check every 2 seconds
       weight -4                       # default prio: -4 if KO
       fall 2                          # require 2 failures for KO
       rise 2                          # require 2 successes for OK
}

vrrp_script chk_haproxy {
       script "killall -0 haproxy"     # cheaper than pidof
       interval 2                      # check every 2 seconds
}

vrrp_script chk_http_port {
       script "</dev/tcp/127.0.0.1/80" # connects and exits
       interval 1                      # check every second
       weight -2                       # default prio: -2 if connect fails
}

vrrp_script chk_https_port {
       script "</dev/tcp/127.0.0.1/443"
       interval 1
       weight -2
}

vrrp_script chk_smtp_port {
       script "</dev/tcp/127.0.0.1/25"
       interval 1
       weight -2
}

vrrp_instance VI_1 {
    interface eth0
    state MASTER
    virtual_router_id 51
    priority 100
    virtual_ipaddress {
        192.168.200.18/25
    }
    track_interface {
       eth1 weight 2   # prio = +2 if UP
       eth2 weight -2  # prio = -2 if DOWN
       eth3            # no weight, fault if down
    }
    track_script {
       chk_sshd                # use default weight from the script
       chk_haproxy weight 2    # +2 if process is present
       chk_http_port
       chk_https_port
       chk_smtp_port
    }
}

vrrp_instance VI_2 {
    interface eth1
    state MASTER
    virtual_router_id 52
    priority 100
    virtual_ipaddress {
        192.168.201.18/26
    }
    track_interface {
       eth0 weight 2   # prio = +2 if UP
       eth2 weight -2  # prio = -2 if DOWN
       eth3            # no weight, fault if down
    }
    track_script {
       chk_haproxy weight 2
       chk_http_port
       chk_https_port
       chk_smtp_port
    }
}

vrrp_instance VI_3 {
    interface eth0
    virtual_router_id 53
    priority 100
    virtual_ipaddress {
        192.168.200.19/27
    }
}

vrrp_instance VI_4 {
    interface eth1
    virtual_router_id 54
    priority 100
    virtual_ipaddress {
        192.168.201.19/28
    }
}

vrrp_instance VI_5 {
    state MASTER
    interface eth0
    virtual_router_id 55
    priority 100
    virtual_ipaddress {
        192.168.200.20/27
    }
}


vrrp_instance VI_6 {
    state MASTER
    interface eth0
    virtual_router_id 56
    priority 100
    virtual_ipaddress {
        192.168.200.21/27
    }
}

vrrp_instance VI_7 {
    state MASTER
    interface eth0
    virtual_router_id 57
    priority 100
    virtual_ipaddress {
        192.168.200.22/27
    }
}

vrrp_instance VI_8 {
    state MASTER
    interface eth0
    virtual_router_id 58
    priority 100
    virtual_ipaddress {
        192.168.200.23/27
    }
}

vrrp_instance VI_9 {
    state MASTER
    interface eth0
    virtual_router_id 59
    priority 100
    virtual_ipaddress {
        192.168.200.24/27
    }
}

看起來是有在跑才對

root@Mobile Router:/etc# keepalived -l -f /etc/keepalived/keepalived.conf
Starting Keepalived v1.3.5 (03/19,2017)
Unable to resolve default script username 'keepalived_script' - ignoring
Opening file '/etc/keepalived/keepalived.conf'.
root@Mobile Router:/etc#

參考 v1.3.5 segmentation fault

我的打印完 Opening file '/etc/keepalived/keepalived.conf'. 就沒了

看來是需要研究一下怎麼來寫 keepalived.conf

1700

monkeyjj time

1750

降頻 旺宏 1 號

零下 40 度開機 試了五次沒一次成功

升溫到 零下 30 度

放到明天上班再試試