111,222均部署keepalived,magent,memcached

keepalived 111为主机,222为备机

其中,111上magent以本地memcache为主,222为备用

222上magen以本地memcache为主,111为备用

安装memcached

安装:yum -y install memcached
查看配置:cat /etc/sysconfig/memcached, 通过ip+下图port可远程连接

  PORT="11211"
  USER="memcached"
  MAXCONN="1024"
  CACHESIZE="64"
  OPTIONS=""

启动: systemctl start memcached
停止: systemctl stop memcached
重启: systemctl restart memcached

连接memcached测试

cmd命令窗口:telnet 10.0.0.111 11211
(回车)

ERROR
add aaa 0 0 4
1111
STORED
get aaa
VALUE aaa 0 4
1111
END

安装libevent(略,下次装时补充)

安装magent

mkdir /opt/magent
cd magent
wget https://files.cnblogs.com/files/lurenjia1994/magent.tar.gz
tar xzvf magent.tar.gz
make进行安装

可能错误1:

magent.c: 在函数‘writev_list’中:
magent.c::: 错误:‘SSIZE_MAX’未声明(在此函数内第一次使用)
if (toSend > SSIZE_MAX ||
^
magent.c::: 附注:每个未声明的标识符在其出现的函数内只报告一次
make: *** [magent.o] 错误

解决方法:

vi ketama.h

在头部加入以下代码
#ifndef SSIZE_MAX
#define SSIZE_MAX 32767
#endif

可能错误2:

gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o magent.o magent.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -c -o ketama.o ketama.c
gcc -Wall -g -O2 -I/usr/local/include -m64 -o magent magent.o ketama.o /usr/lib64/libevent.a /usr/lib64/libm.a
gcc: 错误:/usr/lib64/libevent.a:没有那个文件或目录
gcc: 错误:/usr/lib64/libm.a:没有那个文件或目录
make: *** [magent] 错误

解决方法:

ln -s /usr/lib64/libm.so /usr/lib64/libm.a
ln -s /usr/lib64/libevent.so /usr/lib64/libevent.a

检查是否安装成功

[root@localhost magent]# cp magent /usr/bin/
[root@localhost magent]# magent
please provide -s "ip:port" argument memcached agent v0. Build-Date: Aug ::
Usage:
-h this message
-u uid
-g gid
-p port, default is . ( to disable tcp support)
-s ip:port, set memcached server ip and port
-b ip:port, set backup memcached server ip and port
-l ip, local bind ip address, default is 0.0.0.0
-n number, set max connections, default is
-D don't go to background
-k use ketama key allocation algorithm
-f file, unix socket path to listen on. default is off
-i number, set max keep alive connections for one memcached server, default is
-v verbose

启动magent

[root@centos7 magent]# magent -u root -n  -l 10.0.0.111 -p  -s 10.0.0.111: -b 10.0.0.222:
[root@centos7 magent]# ps -aux|grep magent
root 0.0 0.0 ? Ss : : magent -u root -n -l 10.0.0.111 -p -s 10.0.0.111: -b 10.0.0.222:
root 0.0 0.0 pts/ S+ : : grep --color=auto magent

测试magent

1.连接magent节点

现象:通过magent节点可以取到所有主节点的数据

telnet 10.0.0.111 

UNSUPPORTED COMMAND
get aaa 前面在测试memcache连接设置的aaa,这里取值成功
VALUE aaa END
set b STORED

2.连接主节点

现象:可以取到所有magent节点存入的数据

ERROR
get aaa
VALUE aaa END
get b
VALUE b END
set c
cccc
STORED

3.连接备份节点

现象:可以取到所有magent节点存入的数据

ERROR
get aaa
END
get b #只能取到在magent节点设置的值,其他取不到
VALUE b END
get c
END

4.关掉主节点的memcache进程

现象:通过magent节点可以取到所有备份节点的数据

[root@centos7 magent]# systemctl stop memcached
[root@centos7 magent]# ps -aux|grep memcached
root 0.0 0.0 pts/ S+ : : grep --color=auto memcached cmd连接magent节点
telnet 10.0.0.111 UNSUPPORTED COMMAND
get aaa
END
get b
VALUE b END
get c
END

5.再开启主节点memcached

现象:取不到前面设置的所有值,因为重启以后,主节点数据全部清空,虽然备份节点有数据,但是主节点在备份节点不会生效

UNSUPPORTED COMMAND
get a
END
get aaa
END
get b
END
get c
END

安装keepalived(当10.0.0.111上的magent挂掉时,自动切换到10.0.0.222的magent)

yum install keepalived

修改keepalived配置

本文配置为在这个基础上添加的配置,请忽略多余部分keepalive+nginx 热备跟负载均衡

keepalived配置

! Configuration File for keepalived

global_defs {
notification_email {
#acassen@firewall.loc
#failover@firewall.loc
#sysadmin@firewall.loc
}
#notification_email_from Alexandre.Cassen@firewall.loc
#smtp_server 192.168.200.1
#smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
#vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
} vrrp_script chk_nginx {
script "/etc/keepalived/chk_nginx.sh"
interval 2
} vrrp_script chk_magent {
script "/etc/keepalived/chk_magent.sh"
interval 2
} vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.233
}
notify_master "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!111成为主机! 报!111成为主机!"
notify_fault "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!111已挂! 10.0.0.111故障!请尽快修复!"
track_script {
chk_nginx
}
} vrrp_instance VI_2 {
state MASTER
interface ens192
virtual_router_id 52
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.234
}
track_script {
chk_magent
}
}

其中/etc/keepalived目录下的chk_magent.sh

#!/bin/bash
run=`ps -C magent --no-header | wc -l`
if [ $run -eq 0 ]; then
magent -u root -n 51200 -l 10.0.0.234 -p 12000 -s 10.0.0.111:11211 -b 10.0.0.222:11211
sleep 3
if [ `ps -C magent --no-header | wc -l` -eq 0 ]; then
systemctl stop keepalived
fi
fi

遇到问题1

绑定不了虚拟vip排查,没有发现虚拟ip 10.0.0.234

只有vrid 51的组播,没有52的组播

[root@centos7 keepalived]# tcpdump -nn -c  -i any host 224.0.0.18
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size bytes
::43.008689 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::44.009046 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::45.009174 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::46.009534 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::47.009703 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::48.010830 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::49.010960 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::50.012050 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::51.012178 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::52.012727 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::53.012828 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::54.013334 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::55.013481 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::56.013858 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::57.014023 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::58.014457 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::59.014604 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::00.015002 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::01.015815 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
::02.016914 IP 10.0.0.111 > 224.0.0.18: VRRPv2, Advertisement, vrid , prio , authtype simple, intvl 1s, length
packets captured
packets received by filter
packets dropped by kernel

查看日志:cat /var/log/message

似乎是因为脚本导致vip2启动失败

Aug  :: centos7 Keepalived_vrrp[]: Sending gratuitous ARP on ens192 for 10.0.0.233
Aug :: centos7 Keepalived_vrrp[]: Sending gratuitous ARP on ens192 for 10.0.0.233
Aug :: centos7 Keepalived_vrrp[]: Sending gratuitous ARP on ens192 for 10.0.0.233
Aug :: centos7 Keepalived_vrrp[]: Sending gratuitous ARP on ens192 for 10.0.0.233
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal
Aug :: centos7 Keepalived_vrrp[]: /etc/keepalived/chk_magent.sh exited due to signal

难道他是先运行脚本,再开启vip2?

于是把脚本中的10.0.0.234改成10.0.0.111,再重启keepalived,再查看ip,发现已经有10.0.0.234了

[root@centos7 keepalived]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:c8:03:3f brd ff:ff:ff:ff:ff:ff
inet 10.0.0.111/24 brd 10.0.0.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet 10.0.0.233/32 scope global ens192
valid_lft forever preferred_lft forever
inet 10.0.0.234/32 scope global ens192
valid_lft forever preferred_lft forever
inet6 fe80::7e90:403b:465:db6c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:70:99:88 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:70:99:88 brd ff:ff:ff:ff:ff:ff

于是在vip1中设置两个虚拟ip:10.0.0.233,10.0.0.234,vip2中不设置虚拟ip,检测脚本启动magent时绑定10.0.0.234,经测试10.0.0.111上部署成功

遇到问题2

10.0.0.222启动keepalived时,magent似乎启动失败

排查:

1.关掉10.0.0.111上的keepalived

2.给111上的keepalived.conf跟chk_magent.sh覆盖掉222对应文件

3.启动

systemctl start keepalived

4.检查地址

[root@localhost keepalived]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:59:17:90 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.222/24 brd 10.0.0.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet 10.0.0.233/32 scope global ens192
valid_lft forever preferred_lft forever
inet 10.0.0.234/32 scope global ens192
valid_lft forever preferred_lft forever
inet6 fe80::5e69:554d:d28e:dbb5/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:59:38:b4 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:59:38:b4 brd ff:ff:ff:ff:ff:ff

5.检查magent服务

[root@localhost keepalived]# ps -aux|grep magent
root 23443 0.0 0.0 115296 1476 ? S 15:21 0:00 /bin/bash /etc/keepalived/chk_magent.sh
root 23457 0.0 0.0 112720 968 pts/0 S+ 15:21 0:00 grep --color=auto magent 通过./chk_magent.sh可以正确启动
正确启动应该是这样
[root@localhost keepalived]# ./chk_magent.sh
[root@localhost keepalived]# ps -aux|grep magent
root 24142 0.0 0.0 11948 612 ? Ss 15:22 0:00 magent -u root -n 51200 -l 10.0.0.234 -p 12000 -s 10.0.0.111:11211 -b 10.0.0.222:11211
root 24185 0.0 0.0 112720 972 pts/0 S+ 15:22 0:00 grep --color=auto magent

6.检查系统日志

Aug 23 15:22:19 localhost Keepalived_vrrp[22337]: /etc/keepalived/chk_magent.sh exited due to signal 15
Aug 23 15:22:19 localhost setroubleshoot: failed to retrieve rpm info for /usr/bin/magent
Aug 23 15:22:19 localhost setroubleshoot: SELinux is preventing /usr/bin/magent from name_bind access on the tcp_socket port 12000. For complete SELinux messages run: sealert -l 7a3a5f2e-5328-4dd4-88d6-bdefea289425
Aug 23 15:22:19 localhost python: SELinux is preventing /usr/bin/magent from name_bind access on the tcp_socket port 12000.#012#012***** Plugin bind_ports (92.2 confidence) suggests ************************#012 脚本启动失败了,似乎是防火墙

7.关掉SELinux

[root@localhost keepalived]# setenforce 0
[root@localhost keepalived]# getenforce
Permissive

8.重启keepalived

[root@localhost keepalived]# systemctl stop keepalived
[root@localhost keepalived]# pkill magent
[root@localhost keepalived]# ps -aux|grep magent
root 27598 0.0 0.0 112720 972 pts/0 S+ 15:32 0:00 grep --color=auto magent
[root@localhost keepalived]# systemctl start keepalived
[root@localhost keepalived]# ps -aux|grep magent
root 27647 0.0 0.0 11948 616 ? Ss 15:32 0:00 magent -u root -n 51200 -l 10.0.0.234 -p 12000 -s 10.0.0.111:11211 -b 10.0.0.222:11211
root 27699 0.0 0.0 112720 972 pts/0 S+ 15:32 0:00 grep --color=auto magent 果然是防火墙!

9.SELinux放出magent

比较复杂,以后再补

最终配置

10.0.0.111上的keepalived.conf

! Configuration File for keepalived

global_defs {
notification_email {
#acassen@firewall.loc
#failover@firewall.loc
#sysadmin@firewall.loc
}
#notification_email_from Alexandre.Cassen@firewall.loc
#smtp_server 192.168.200.1
#smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
#vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
} vrrp_script chk_nginx {
script "/etc/keepalived/chk_nginx.sh"
interval 2
} vrrp_script chk_magent {
script "/etc/keepalived/chk_magent.sh"
interval 2
} vrrp_instance VI_1 {
state MASTER
interface ens192
virtual_router_id 51
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.233
10.0.0.234
}
notify_master "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!111成为主机! 报!111成为主机!"
notify_fault "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!111已挂! 10.0.0.111故障!请尽快修复!"
track_script {
chk_nginx
}
} vrrp_instance VI_2 {
state MASTER
interface ens192
virtual_router_id 52
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
# 10.0.0.234
}
track_script {
chk_magent
}
}

10.0.0.111上的chk_magent.sh

#!/bin/bash
run=`ps -C magent --no-header | wc -l`
if [ $run -eq 0 ]; then
magent -u root -n 51200 -l 10.0.0.234 -p 12000 -s 10.0.0.111:11211 -b 10.0.0.222:11211
sleep 3
if [ `ps -C magent --no-header | wc -l` -eq 0 ]; then
systemctl stop keepalived
fi
fi

10.0.0.222上的keepalived.conf

! Configuration File for keepalived

global_defs {
notification_email {
#acassen@firewall.loc
#failover@firewall.loc
#sysadmin@firewall.loc
}
#notification_email_from Alexandre.Cassen@firewall.loc
#smtp_server 192.168.200.1
#smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
#vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
} vrrp_script chk_nginx {
script "/etc/keepalived/chk_nginx.sh"
interval 2
} vrrp_script chk_magent {
script "/etc/keepalived/chk_magent.sh"
interval 2
} vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 51
priority 30
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.0.0.233
10.0.0.234
}
notify_master "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!222成为主机! 报!222成为主机!"
notify_fault "/usr/bin/python2.7 /etc/keepalived/send.py 1499418300@qq.com 报!222已挂! 10.0.0.222故障!请尽快修复!"
track_script {
chk_nginx
}
} vrrp_instance VI_2 {
state BACKUP
interface ens192
virtual_router_id 52
priority 30
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
# 10.0.0.234
}
track_script {
chk_magent
}
}

10.0.0.222上的chk_magent.sh

#!/bin/bash
run=`ps -C magent --no-header | wc -l`
if [ $run -eq 0 ]; then
magent -u root -n 51200 -l 10.0.0.234 -p 12000 -s 10.0.0.222:11211 -b 10.0.0.111:11211
sleep 3
if [ `ps -C magent --no-header | wc -l` -eq 0 ]; then
systemctl stop keepalived
fi
fi

参考文档

memcached+magent+keepalived实现高可用群集

Memcached之代理服务magent(8)

centos7 memcached+magent+keepalived集群的更多相关文章

  1. memcached+magent的集群部署详细过程

    问题描述 Memcached在实现分布集群部署时, Memcached服务端的之间是没有通讯的,服务端是伪分布式,实现分布式是由客户端实现的,客户端实现了分布式算法把数据保存到不同的Memcached ...

  2. Centos7+nginx+keepalived集群及双主架构案例

    目录简介 一.简介 二.部署nginx+keepalived 集群 三.部署nginx+keepalived双主架构 四.高可用之调用辅助脚本进行资源监控,并根据监控的结果状态实现动态调整 一.简介 ...

  3. Nginx+Tomcat+Memcached负载均衡集群服务搭建

    操作系统:CentOS6.5  本文档主要讲解,如何在CentOS6.5下搭建Nginx+Tomcat+Memcached负载均衡集群服务器,Nginx负责负载均衡,Tomcat负责实际服务,Memc ...

  4. centos7搭建ELK Cluster集群日志分析平台(四):Fliebeat-简单测试

    续之前安装好的ELK集群 各主机:es-1 ~ es-3 :192.168.1.21/22/23 logstash: 192.168.1.24 kibana: 192.168.1.25 测试机:cli ...

  5. centos7搭建ELK Cluster集群日志分析平台(三):Kibana

    续  centos7搭建ELK Cluster集群日志分析平台(一) 续  centos7搭建ELK Cluster集群日志分析平台(二) 已经安装好elasticsearch 5.4集群和logst ...

  6. centos7搭建ELK Cluster集群日志分析平台(二):Logstash

    续  centos7搭建ELK Cluster集群日志分析平台(一) 已经安装完Elasticsearch 5.4 集群. 安装Logstash步骤 . 安装Java 8 官方说明:需要安装Java ...

  7. centos7搭建ELK Cluster集群日志分析平台(一):Elasticsearch

    应用场景: ELK实际上是三个工具的集合,ElasticSearch + Logstash + Kibana,这三个工具组合形成了一套实用.易用的监控架构, 很多公司利用它来搭建可视化的海量日志分析平 ...

  8. Keepalived详解(五):Keepalived集群中MASTER和BACKUP角色选举策略【转】

    一.Keepalived集群中MASTER和BACKUP角色选举策略 在keepalived集群中,其实并没有严格意义上的主.备节点,虽然可以在keepalived配置文件中设置state选项为MAS ...

  9. Centos7环境下etcd集群的搭建

    Centos7环境下etcd集群的搭建 一.简介 "A highly-available key value store for shared configuration and servi ...

随机推荐

  1. 深入理解nodejs的next函数。koa的使用 app.params的使用

    next就是一个递归函数 const Koa = require('koa'); const app = new Koa(); app.use(ctx => { ctx.body = 'Hell ...

  2. C++拷贝构造函数的调用时机

    一.拷贝构造函数调用的时机 ​ 当以拷贝的方式初始化对象时会调用拷贝构造函数,这里需要注意两个关键点,分别是以拷贝的方式和初始化对象 1. 初始化对象 初始化对象是指,为对象分配内存后第一次向内存中填 ...

  3. RAID 磁盘阵列说明

    Copy From wiki RAID档次 最少硬盘 最大容错 可用容量 读取性能 写入性能 安全性 目的 应用产业 单一硬盘 (引用) 0 1 1 1 无     JBOD 1 0 n 1 1 无( ...

  4. 设计模式之抽象工厂模式(附带类似反射功能的实现/c++)

    问题描述 假设我们要开发一款游戏, 当然为了吸引更多的人玩, 游戏难度不能太大(让大家都没有信心了,估计游戏也就没有前途了),但是也不能太简单(没有挑战性也不符合玩家的心理).于是我们就可以采用这样一 ...

  5. Delphi 导出数据至Excel的7种方法【转】

    一; delphi 快速导出excel   uses ComObj,clipbrd;   function ToExcel(sfilename:string; ADOQuery:TADOQuery): ...

  6. Lodop如何设置预览后导出带背景的图,打印不带背景图

    Lodop中的ADD_PRINT_SETUP_BKIMG,可以加载上背景图,该背景图在预览的时候可以显示也可以不显示,打印可以打印出来也可以不打印出来.一般套打,都是不打印背景图的,比如一些快递的快递 ...

  7. 训练题(代码未检验)(序列前k大和问题)

    大厦 Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Total Submission ...

  8. mysql关于binlog日志的操作

    查看binlog日志选项和存储位置: mysql> show variables like 'log_%'; 1.查看所有binlog日志列表 mysql> show master log ...

  9. BZOJ1775[USACO 2009 Dec Gold 3.Video Game Troubles]——DP

    题目描述 输入 * 第1行: 两个由空格隔开的整数: N和V * 第2到第N+1行: 第i+1行表示第i种游戏平台的价格和可以在这种游戏平台上面运行的游 戏.包含: P_i, G_i还有G_i对由空格 ...

  10. bzoj 3295 动态逆序对 (三维偏序,CDQ+树状数组)

    链接:https://www.lydsy.com/JudgeOnline/problem.php?id=3295 思路: 可以将这道题看成倒着插入,这样就可以转化成求逆序对数,用CDQ分治降维,正反用 ...