keepalived+LVS 詳解(1) -- 編譯

先安裝依賴包

由於環境不同可能不一樣,也可以在後面的執行過程中,提示缺什麼,在安裝什麼。

apt-get install libssl-dev libpopt-dev libnl-3-dev libnl-genl-3-dev

 

下載最新的源碼,目前是2.0版本:

https://www.keepalived.org/download.html

 

解壓後進入目錄,執行,有興趣的可以研究下atuomake的執行

./configure --prefix=/usr/local/keepalived --enable-bfd --enable-mem-check --enable-mem-check-log --enable-timer-check --enable-debug --enable-track-process-debug --enable-parser-debug --enable-vrrp-fd-debug --disable-lvs

make && make install

 

啓動

keepalived/etc/keepalived/keepalived.conf   是配置文件的路徑,可以根據自己的路徑修改

配置文件的修改,後面章節在解析:

cd bin

./keepalived -f ../keepalived/etc/keepalived/keepalived.conf  --debug=TPEFOAC -D -g

 

具體的參數可以執行keepalived -h參看,unix的文本配置啊,全靠keepalived.conf 

keepalived -h

Usage: ./keepalived [OPTION...]

  -f, --use-file=FILE          Use the specified configuration file

  -B, --no_bfd                 Don't run BFD subsystem

      --all                    Force all child processes to run, even if have no configuration

  -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]

  -g, --log-file=FILE          Also log to FILE (default /tmp/keepalived.log)

      --flush-log-file         Flush log file on write

  -G, --no-syslog              Don't log via syslog

  -u, --umask=MASK             umask for file creation (in numeric form)

  -X, --release-vips           Drop VIP on transition from signal.

  -V, --dont-release-vrrp      Don't remove VRRP VIPs and VROUTEs 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

  -b, --bfd_pid=FILE           Use specified pidfile for BFD child process

  -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')

  -L, --mem-check-log          Log malloc/frees to syslog

  -i, --config-id id           Skip any configuration lines beginning '@' that don't match id

                                or any lines beginning @^ that do match.

                                The config-id defaults to the node name if option not used

      --signum=SIGFUNC         Return signal number for STOP, RELOAD, DATA, STATS, TDUMP

  -t, --config-test[=LOG_FILE] Check the configuration for obvious errors, output to

                                stderr by default

      --debug[=...]            Enable debug options. p, b, c, v specify parent, bfd, checker and vrrp processes

                                If no process(es) specified, the option will apply to all processes

                                   T - timer debug

                                   M - email alert debug

                                   H - smtp connect debug

                                   E - epoll debug

                                   D - epoll thread dump debug

                                   F - vrrp fd dump debug

                                   S - TSM debug

                                   N - netlink timer debug

                                   P - network timestamp debug

                                   U - checksum diagnostics

                                   O - track process debug

                                   A - track process debug with extra detail

                                   C - parser (config) debug

                                   Z - memory alloc/free error debug

                                   I - EINTR debugging

                                   K - dump keywords

                                 Example --debug=TpMEvcp

  -v, --version                Display the version number

  -h, --help                   Display this help message

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章