keepalived主从切换试验:
1、先搭建192.168.1.20与192.168.1.21的主主架构     192.168.1.76为VIP
2、在2机都安装keepalived
  1.  tar -zxvf keepalived-1.2.13.tar.gz 
  2.  cd keepalived-1.2.13
  3.  ./configure -prefix=/usr/local/keepalived
  4.  make
  5. make install
  6.  [root@likun keepalived-1.2.13]# cat /opt/mysql/mysql.sh 
  7. #!/bin/sh
  8. pkill keepalived
  9. [root@likun keepalived-1.2.13]# chmod +x /opt/mysql/mysql.sh
3、配置20机器的keepalived配置文件
  1. [root@likun keepalived-1.2.13]# cat /usr/local/keepalived/etc/keepalived.conf
  2. !ConfigurationFilefor keepalived 
  3.  
  4. global_defs { 
  5.    notification_email { 
  6.      likun@163.com 
  7.    } 
  8.    router_id mysql-ha 
  9.  
  10. vrrp_instance VI_20 { 
  11.     state BACKUP
  12.     interface eth0 
  13.     virtual_router_id 20
  14.     priority 90
  15.     advert_int 1 
  16.     nopreempt        
  17.     authentication { 
  18.         auth_type PASS 
  19.         auth_pass 1111  
  20.     } 
  21.     virtual_ipaddress {   
  22.         192.168.1.76
  23.     } 
  24.  
  25. virtual_server 192.168.1.763306{ 
  26.     delay_loop 2 
  27.     lb_algo wrr 
  28.     lb_kind DR 
  29.     persistence_timeout 60 
  30.     protocol TCP 
  31.  
  32.     real_server 192.168.1.203306{
  33.         weight 3 
  34.         notify_down /opt/mysql/mysql.sh 
  35.             TCP_CHECK { 
  36.             connect_timeout 10 
  37.             nb_get_retry 3 
  38.             delay_before_retry 3 
  39.             connect_port 3306
  40.         } 
  41.     } 
4、配置21机器的keepalived配置文件
  1. !ConfigurationFilefor keepalived 
  2.  
  3. global_defs { 
  4.    notification_email { 
  5.      likun@163.com 
  6.    } 
  7.    router_id mysql-ha 
  8.  
  9. vrrp_instance VI_21 { 
  10.     state BACKUP
  11.     interface eth0 
  12.     virtual_router_id 20        --注意2边要一致
  13.     priority 100
  14.     advert_int 1 
  15.     nopreempt        
  16.     authentication { 
  17.         auth_type PASS 
  18.         auth_pass 1111  
  19.     } 
  20.     virtual_ipaddress {   
  21.         192.168.1.76
  22.     } 
  23.  
  24. virtual_server 192.168.1.763306{ 
  25.     delay_loop 2 
  26.     lb_algo wrr 
  27.     lb_kind DR 
  28.     persistence_timeout 60 
  29.     protocol TCP 
  30.  
  31.     real_server 192.168.1.213306{
  32.         weight 3 
  33.         notify_down /opt/mysql/mysql.sh 
  34.             TCP_CHECK { 
  35.             connect_timeout 10 
  36.             nb_get_retry 3 
  37.             delay_before_retry 3 
  38.             connect_port 3306
  39.         } 
  40.     } 
5、测试
  • 在20机器测试,mysql没有启动的情况下,keepalived启动会被自动杀掉,证明keepalived配置正确
service mysql stop 
/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D
ps -ef|grep keepalived        看到没有keepalived进程
 
  • 在2边启动mysql并启动keepalived,测试用vip登陆数据库
  1. [root@likun1 keepalived-1.2.13]# mysql -h192.168.1.76-P3306 -uroot -proot
  2. Welcome to the MySQL monitor.  Commands end with ; or \g.
  3. YourMySQL connection id is 682
  4. Server version:5.5.30-log Source distribution
  5. Copyright(c)2000,2013,Oracle and/or its affiliates.All rights reserved.
  6. Oracle is a registered trademark of OracleCorporation and/or its
  7. affiliates.Other names may be trademarks of their respective
  8. owners.
  9. Type'help;' or '\h'for help.Type'\c' to clear the current input statement.
  10. mysql> 
 
21机器查看IP:
  1. [root@likun1 keepalived-1.2.13]# ip addr show
  2. 1: lo:<LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.     inet6 ::1/128 scope host 
  6.        valid_lft forever preferred_lft forever
  7. 2: eth0:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  8.     link/ether 08:00:27:5d:ef:c3 brd ff:ff:ff:ff:ff:ff
  9.     inet 192.168.1.21/24 brd 192.168.1.255 scope global eth0
  10.     inet 192.168.1.76/32 scope global eth0
  11.     inet6 fe80::a00:27ff:fe5d:efc3/64 scope link 
  12.        valid_lft forever preferred_lft forever
 
20机器查看IP:
  1. [root@likun keepalived-1.2.13]# ip addr show
  2. 1: lo:<LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.     inet6 ::1/128 scope host 
  6.        valid_lft forever preferred_lft forever
  7. 2: eth0:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  8.     link/ether 08:00:27:00:58:57 brd ff:ff:ff:ff:ff:ff
  9.     inet 192.168.1.20/24 brd 192.168.1.255 scope global eth0
  10.     inet6 fe80::a00:27ff:fe00:5857/64 scope link 
  11.        valid_lft forever preferred_lft forever
关闭20节点的mysql,发现VIP漂移到21上,并且20上的keepalived被kill
 
  • 杀掉master的keepalived,vip会飘到slave上,slave的日志:
  1. Jul2020:03:31 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Transition to MASTER STATE
  2. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Entering MASTER STATE
  3. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20) setting protocol VIPs.
  4. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76
  5. Jul2020:03:32 likun Keepalived_healthcheckers[8546]:Netlink reflector reports IP 192.168.1.76 added
  • 再启动master的keepalived,不会抢vip,变为backup state,master的日志:
  1. Jul2020:03:49 likun1 Keepalived[7416]:StartingKeepalived v1.2.13(07/20,2014)
  2. Jul2020:03:49 likun1 Keepalived[7417]:StartingHealthcheck child process, pid=7418
  3. Jul2020:03:49 likun1 Keepalived[7417]:Starting VRRP child process, pid=7419
  4. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Netlink reflector reports IP 192.168.1.21 added
  5. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Netlink reflector reports IP 192.168.1.21 added
  6. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  7. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:RegisteringKernel netlink reflector
  8. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:RegisteringKernel netlink command channel
  9. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  10. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:RegisteringKernel netlink reflector
  11. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:RegisteringKernel netlink command channel
  12. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Registering gratuitous ARP shared channel
  13. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  14. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Configuration is using:62953Bytes
  15. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:UsingLinkWatch kernel netlink reflector...
  16. Jul2020:03:49 likun1 Keepalived_vrrp[7419]: VRRP_Instance(VI_21)Entering BACKUP STATE
  17. Jul2020:03:49 likun1 Keepalived_vrrp[7419]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  18. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  19. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Configuration is using:11555Bytes
  20. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:UsingLinkWatch kernel netlink reflector...
  21. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Activating healthchecker for service [192.168.1.21]:3306
 
 
切换时不会kill keepalived的方式
20、21先配置主主架构
2边数据库做授权:
root@localhost 19:30:38 [db3]> GRANT REPLICATION CLIENT ON *.* TO 'monitor'@'%' IDENTIFIED BY 'm0n1tor'; 
Query OK, 0 rows affected (0.00 sec)
flush privileges
 
2边系统拷贝检测脚本并+x
chmod +x /usr/local/keepalived/checkMySQL.py        (脚本在附件,要检查一下脚本变量值)
 
两边配置文件做成如下:
20:
  1. [root@likun ~]# cat /usr/local/keepalived/etc/keepalived.conf 
  2. vrrp_script vs_mysql_20 {
  3.     script "/usr/local/keepalived/checkMySQL.py -h 192.168.1.20 -P 3306"
  4.     interval 60 
  5. }
  6. vrrp_instance VI_20 {
  7.     state BACKUP
  8.     nopreempt
  9.     interface eth0
  10.     virtual_router_id 21
  11.     priority 100
  12.     advert_int 5
  13.     authentication {
  14.         auth_type PASS
  15.         auth_pass 1111
  16.     }
  17.     track_script {
  18.        vs_mysql_20
  19.     }
  20.     virtual_ipaddress {
  21.         192.168.1.76
  22.     }
21:
  1. [root@likun1 ~]# cat /usr/local/keepalived/etc/keepalived.conf 
  2. vrrp_script vs_mysql_21 {
  3.     script "/usr/local/keepalived/checkMySQL.py -h 192.168.1.21 -P 3306"
  4.     interval 60 
  5. }
  6. vrrp_instance VI_21 {
  7.     state BACKUP
  8.     nopreempt
  9.     interface eth0
  10.     virtual_router_id 21
  11.     priority 90
  12.     advert_int 5
  13.     authentication {
  14.         auth_type PASS
  15.         auth_pass 1111
  16.     }
  17.     track_script {
  18.        vs_mysql_21
  19.     }
  20.     virtual_ipaddress {
  21.         192.168.1.76
  22.     }
启动20的keepalived,并查看日志,发现启动为master状态,vip绑定:
  1. [root@likun ~]#/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D
  2. [root@likun ~]# tail -f /var/log/messages
  3. Aug  820:58:41 likun Keepalived[8023]:StoppingKeepalived v1.2.13(07/20,2014)
  4. Aug  820:59:04 likun Keepalived[8064]:StartingKeepalived v1.2.13(07/20,2014)
  5. Aug  820:59:04 likun Keepalived[8065]:StartingHealthcheck child process, pid=8066
  6. Aug  820:59:04 likun Keepalived[8065]:Starting VRRP child process, pid=8067
  7. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP 192.168.1.20 added
  8. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP 10.0.3.15 added
  9. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP fe80::a00:27ff:fe00:5857 added
  10. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.20 added
  11. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP fe80::a00:27ff:fe5d:683a added
  12. Aug  820:59:04 likun Keepalived_vrrp[8067]:RegisteringKernel netlink reflector
  13. Aug  820:59:04 likun Keepalived_vrrp[8067]:RegisteringKernel netlink command channel
  14. Aug  820:59:04 likun Keepalived_vrrp[8067]:Registering gratuitous ARP shared channel
  15. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 10.0.3.15 added
  16. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP fe80::a00:27ff:fe00:5857 added
  17. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP fe80::a00:27ff:fe5d:683a added
  18. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:RegisteringKernel netlink reflector
  19. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:RegisteringKernel netlink command channel
  20. Aug  820:59:05 likun Keepalived_vrrp[8067]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  21. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  22. Aug  820:59:05 likun Keepalived_vrrp[8067]:Configuration is using:62993Bytes
  23. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:Configuration is using:5287Bytes
  24. Aug  820:59:05 likun Keepalived_vrrp[8067]:UsingLinkWatch kernel netlink reflector...
  25. Aug  820:59:05 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering BACKUP STATE
  26. Aug  820:59:05 likun Keepalived_vrrp[8067]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  27. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:UsingLinkWatch kernel netlink reflector...
  28. Aug  820:59:07 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) succeeded
  29. Aug  820:59:20 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Transition to MASTER STATE
  30. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering MASTER STATE
  31. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20) setting protocol VIPs.
  32. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76
  33. Aug  820:59:25 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.76 added
  34. Aug  820:59:30 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76
启动21的keepalived,并查看日志,启动为backup状态:
  1. [root@likun1 ~]#/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D
  2. [root@likun1 ~]# tail -f /var/log/messages
  3. Aug  918:11:27 likun1 Keepalived[3355]:StartingKeepalived v1.2.13(07/20,2014)
  4. Aug  918:11:27 likun1 Keepalived[3356]:StartingHealthcheck child process, pid=3357
  5. Aug  918:11:27 likun1 Keepalived[3356]:Starting VRRP child process, pid=3358
  6. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP 192.168.1.21 added
  7. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 192.168.1.21 added
  8. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 10.0.3.15 added
  9. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  10. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP 10.0.3.15 added
  11. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP fe80::a00:27ff:fe97:754a added
  12. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:RegisteringKernel netlink reflector
  13. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:RegisteringKernel netlink command channel
  14. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  15. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP fe80::a00:27ff:fe97:754a added
  16. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:RegisteringKernel netlink reflector
  17. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:RegisteringKernel netlink command channel
  18. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Registering gratuitous ARP shared channel
  19. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  20. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:Opening file '/usr/local/keepalived/etc/keepalived.conf'.
  21. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:Configuration is using:63001Bytes
  22. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:Configuration is using:5295Bytes
  23. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:UsingLinkWatch kernel netlink reflector...
  24. Aug  918:11:30 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Entering BACKUP STATE
  25. Aug  918:11:30 likun1 Keepalived_vrrp[3358]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  26. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:UsingLinkWatch kernel netlink reflector...
  27. Aug  918:11:31 likun1 Keepalived_vrrp[3358]: VRRP_Script(vs_mysql_21) succeeded
20机器关闭mysql,看到20 keepalived切换为fault状态,21机器切换为master状态并绑定vip
  1. 20日志:
  2. Aug  823:09:05 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) failed
  3. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering FAULT STATE
  4. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20) removing protocol VIPs.
  5. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Now in FAULT state
  6. Aug  823:09:08 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.76 removed
  1. 21日志:
  2. Aug  920:21:00 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Transition to MASTER STATE
  3. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Entering MASTER STATE
  4. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21) setting protocol VIPs.
  5. Aug  920:21:05 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 192.168.1.76 added
  6. Aug  920:21:05 likun1 avahi-daemon[1320]:Registeringnew address record for192.168.1.76 on eth0.IPv4.
  7. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Sending gratuitous ARPs on eth0 for192.168.1.76
  8. Aug  920:21:10 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Sending gratuitous ARPs on eth0 for192.168.1.76
20机器再次启动mysql,keepalived会切换为backup状态,但不会抢vip
  1. Aug  823:49:05 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) succeeded
  2. Aug  823:49:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering BACKUP STATE
 
 
 
keepalived双主带一从的配置方式
20 <-->21(双主)
 |
22(从库)
 
 

14、高可用keepalived搭建及切换的更多相关文章

  1. 高可用Keepalived+LVS搭建流程

    本流程搭建1个master,1个backup节点的Keepalived,使用lvs轮询2个节点的服务. 一.使用版本 CentOS 7.7 Keepalived 1.3.5 ipvsadm 1.27( ...

  2. 美团点评基于MGR的CMDB高可用架构搭建之路【转】

    王志朋 美团点评DBA 曾在京东金融担任DBA,目前就职于美团点评,主要负责金融业务线数据库及基础组件数据库的运维. MySQL Group Replication(以下简称MGR),于5.7.17版 ...

  3. 解决nginx负载均衡高可用keepalived只针对物理机的问题

    在高可用keepalived软件,在默认的情况下仅仅在对方机器宕机或keepalived停掉的时候才会接管业务. 但是在实际工作过程中,例如在nginx负载均衡工作实例中,nginx服务已停止,而ke ...

  4. haproxy + rabbitmq + keepalived的高可用环境搭建

    一.rabbitmq的搭建:参考rabbimq的安装及集群设置 二.安装和配置haproxy 1.安装haproxyyum install haproxy 2.安装rsysloga. 检查rsyslo ...

  5. Redis + keepalived 高可用群集搭建

    本次实验环境介绍: 操作系统: Centos 7.3 IP : 192.168.10.10 Centos 7.3 IP : 192.168.10.20  VIP    地址   : 192.168.1 ...

  6. mamcached+(magent+keepalived高可用)搭建及理论概述

    目录 一.理论概述 工作流程 二.部署 环境 环境概述 部署 三.测试 四.总结 一.理论概述 Memcached服务器端与PHP-Memcache客户端安装配置_服务器应用_Linux公社-Linu ...

  7. nginx1.14.0版本高可用——keepalived双机热备

    nginx不支持主从,所以我们需要使用keepalive支持高可用. keepalived重要知识点 在局域网内,每个主机上各安装一个keepalived,注意关闭防火墙firewalld,然后设定一 ...

  8. HA高可用的搭建

    HA 即 (high available)高可用,又被叫做双机热备,用于关键性业务. 简单理解就是,有两台机器A和B,正常是A提供服务,B待命闲置,当A宕机或服务宕掉,会切换至B机器继续提供服务.常用 ...

  9. linux下mysql5.7的MHA高可用架构搭建

    一.MHA简介 MHA(Master High Availability)目前在mysql高可用方面比较成熟.是一套优秀的作为 mysql高可用性环境下故障切换和主从提升的高可用软件.在MySQL故障 ...

随机推荐

  1. 如何打开小米,oppo,华为等手机的系统应用的指定页面

    如题,拿Oppo 手机做个示例,小米 华为也是如此. 在编写Android应用的时候,我们经常会有这样的需求,我们想直接打开系统应用的某个页面.比如在Oppo R9 手机上我们想打开某个应用的通知管理 ...

  2. bzoj 2748 DP

    比较裸的背包,w[i][j]代表到第I个操作的时候音量j能不能达到,然后转移就行了. /******************************************************** ...

  3. bzoj 1297 矩阵乘法变形

    首先对于矩阵乘法的功能有很多,记得有篇论文叫矩阵乘法在信息学竞赛中的应用,里面详细介绍了矩阵的 作用 其中一个就是求图的固定时间方案数,也就是给定一张图,每两个点之间由一条边长为1的边相连, 求任意两 ...

  4. JSP页面中格式化日期为指顶格式

    有时候在页面中显示直接从数据库获取的日期时候会出现英文的日期格式.比如:

  5. [转]在树莓派上搭建LAMP服务

    之前介绍过树莓派上LNMP环境的搭建方法,本文将详细介绍如何在树莓派上配置LAMP服务. 为LAMP,是最流行的服务器配置之一,LAMP的含义是: Linux - 操作系统 Apache - 网络服务 ...

  6. eclipse导入java和android sdk源码,帮助文档

    eclipse导入java和android sdk源码,帮助文档 http://blog.csdn.net/ashelyhss/article/details/37993261 JavaDoc集成到E ...

  7. HDU1045(二分图经典建模)

    Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  8. 分享三个USB抓包软件---Bus Hound,USBlyzer 和-USBTrace【转】

    转自:http://bbs.armfly.com/read.php?tid=15377 Bus Hound官方下载地址:http://perisoft.net/bushound/ Bus Hound ...

  9. Linux nc (netcat) 详解

    Linux nc (netcat) 详解 http://blog.csdn.net/michael493439861/article/details/7445454

  10. Linux指令详解useradd groupadd passwd chpasswd chage 密码修改

    Linux指令详解useradd groupadd passwd chpasswd chage 密码修改 http://speediness.blog.51cto.com/760841/1783661 ...