heartbeat

Heartbeat实现HA

匿名 (未验证) 提交于 2019-12-02 23:38:02
Heartbeat3.0.4 HA即(high available)高可用,又被叫做双机热备,用于关键性业务。简单理解就是,有2台机器 A 和 B,正常是 A 提供服务,B 待命闲置,当 A 宕机或服务宕掉,会切换至B机器继续提供服务。常见的实现高可用的开源软件有 heartbeat 和 keepalived。 这样,一台 web 服务器一天24小时提供web服务,难免会存在 web 服务挂掉或服务器宕机宕机的情况,那么用户就访问不了服务了,这当然不是我们期望的。如果这样,有2台服务器,A对外提供 web 服务,B作为备用,如果A挂掉,那么B立刻替代A的位置去提供 web 服务,这样对用户来说是透明的。但是有个问题,服务器A的 ip 是 10.0.0.100,服务器B的 ip 是 10.0.0.101,显然向用户提供A或B的ip地址是不可行的,因为用户总不能去切换ip来访问的吧。这时heartbeat或keepalived可以提供一个虚拟IP:10.0.0.102,用户只需要访问 10.0.0.102,当A提供服务时,VIP 会设置在A服务器上,当B提供服务时,VIP会设置在B服务器上,这样就可以让用户通过访问 10.0.0.102 来获取web服务,即使A或B服务器切换也不影响用户的正常访问。 环境设置 服务器A : 主机名:master 操作系统:CentOS6.8 64位

Resource Agent:LSB和OCF

匿名 (未验证) 提交于 2019-12-02 21:59:42
本文目录: 1.简介 2.符合LSB规范的脚本 3.OCF资源代理 1.简介 heartbeat和pacemaker都支持三种资源代理:传统的haresources脚本(/etc/ha.d/resource.d)、符合LSB规范的脚本(/etc/init.d)以及OCF脚本(/usr/lib/ocf/resource.d/heartbeat)。其中传统的haresources脚本是基于LSB脚本的,和LSB只有少许区别。 传统的资源代理适合于没有启用pacemaker的heartbeat,也适合于设置了 class=heartbeat 的Pacemaker。pacemaker中,建议优先使用OCF类的资源代理,如果没有则应该使用LSB资源代理。 无论是heartbeat还是pacemaker,对于传统的资源代理脚本和LSB脚本都只会执行start/stop/status三个操作: 1.start操作 启动资源。在已启动的资源下再次启动时,不允许返回任何错误代码(非0)。只有当前机器会启动自身的资源,且只有在status显示未运行时才会启动。 2.stop操作 停止资源。必须要保证在已停止的资源上再次停止时不会出现错误,状态码也必须为0,否则集群会不断停止资源,最后重启操作系统。但是很多不符合LSB规范的脚本都会在已停止的状态下不允许再次停止。规范的LSB脚本是无所谓多次停止的

Make a CSS Heartbeat using an Infinite Animation Count----超级好看的心跳,粉色的

寵の児 提交于 2019-12-02 18:08:57
Here's one more continuous animation example with the animation-iteration-count property that uses the heart you designed in a previous challenge. The one-second long heartbeat animation consists of two animated pieces. The heart elements (including the :before and :after pieces) are animated to change size using the transform property, and the background div is animated to change its color using the background property. 练习题目: Keep the heart beating by adding the animation-iteration-count property for both the back class and the heart class and setting the value to infinite. The heart:before

heartbeat的双机互备

末鹿安然 提交于 2019-12-02 17:57:37
heartbeat快速部署: 高可用服务————将资源(IP及程序服务等资源)从一台已经故障的主机上快速转移到另一台正常运转的主机上继续提供服务 配置heartbeat软件的配置文件,指定哪一台heartbeat服务器作为主服务器,另一台作为热备服务器,在热备上配置heartbeat守护程序监听主服务器的心跳信息。(主备模式) 上面是主备模式,另外还可以做主主模式,即两台服务器互为主备,这时他们之间会相互发送报文来告诉对方自己当前的状态 如果在规定的时间内没有收到对方发送过来的心跳报文,就会认为对方挂了,此时就会启动程序接管运行在对方机器上的资源或服务。 heartbeat故障切换时间为5-20s 和keepalived一样。heartbeat也是服务器级别的,不是服务级别。 切换条件: 1、服务器宕机 2、heartbeat服务本身故障 3、心跳线故障 服务故障不会导致切换,但是可以通过服务故障,把heartbeat服务停掉,这样就符合切换条件了 heartbeat心跳连接: 1、串行线缆,即所谓的串口(缺点是两台主机之间不能距离太远) 2、以太网线两台主机上的网卡直连(推荐,但是需要在两台主机上各自做路由) 3、以太网电缆,通过交换机等网络设备连接(次选) 生产环境使用第二种或第一种,或是两种同时使用 脑裂: 两台高可用服务器对在指定的时间内

ZooKeeper alternatives? (cluster coordination service) [closed]

我怕爱的太早我们不能终老 提交于 2019-12-02 13:52:33
ZooKeeper is a highly available coordination service for data centers. It originated in the Hadoop project. One can implement locking, fail over, leader election, group membership and other coordination issues on top of it. Are there any alternatives to ZooKeeper? (free software of course) I've looked extensively at Zookeeper/ Curator , Eureka , etcd , and consul. Zookeeper/Curator and Eureka are in many ways the most polished and easiest to integrate if you are in the Java world. Etcd is pretty cool and very flexible, but It is really just a HA key store so you would have to write a lot of

netty5心跳与业务消息分发实例

馋奶兔 提交于 2019-12-02 13:10:45
  继续基于我们之前的demo(参见 netty5自定义私有协议实例 ),这次我们加上连接校验和心跳机制:      只要校验通过,客户端发送心跳和业务消息是两个不同的事件发送的,彼此互不干扰。针对以上流程,我们需要增加4个handler:客户端请求handler、心跳handler ,服务端校验handler、心跳处理handler。当然,引导类也得添加上面对应的handler。上代码:   新增客户端首次连接handler: package com.wlf.netty.nettyclient.handler; import com.wlf.netty.nettyapi.javabean.Header; import com.wlf.netty.nettyapi.javabean.NettyMessage; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import lombok.extern.slf4j.Slf4j; @Slf4j public class ControlClientHandler extends ChannelHandlerAdapter { @Override public void channelActive

High availability computing: How to deal with a non-returning system call, without risking false positives?

余生长醉 提交于 2019-12-02 10:33:17
问题 I have a process that's running on a Linux computer as part of a high-availability system. The process has a main thread that receives requests from the other computers on the network and responds to them. There is also a heartbeat thread that sends out multicast heartbeat packets periodically, to let the other processes on the network know that this process is still alive and available -- if they don't heart any heartbeat packets from it for a while, one of them will assume this process has

crossDomain heartbeat cant parse jsonp data with jquery

馋奶兔 提交于 2019-12-02 06:47:48
I embbeding my module, an asp.net project, in a "portal", the portal generate an iframe to my url, i know its a shit but i dont made it. To avoid session in main "portal" end while user iterating with my web project the portal owner told me to start an heartbeat by javascript from my application to portal. Everyone know keep session in this way is insecure but 'portal' there is then i havent nothing to do. The real problem is that i cant do cross-domain requests from my application to portal because same origin policy lock it, i found a solution using jquery but it require [heartbeat listener]

High availability computing: How to deal with a non-returning system call, without risking false positives?

女生的网名这么多〃 提交于 2019-12-02 04:31:25
I have a process that's running on a Linux computer as part of a high-availability system. The process has a main thread that receives requests from the other computers on the network and responds to them. There is also a heartbeat thread that sends out multicast heartbeat packets periodically, to let the other processes on the network know that this process is still alive and available -- if they don't heart any heartbeat packets from it for a while, one of them will assume this process has died and will take over its duties, so that the system as a whole can continue to work. This all works

【原创】使用 rabbitmq 中 heartbeat 功能可能会遇到的问题

和自甴很熟 提交于 2019-12-02 02:24:17
【问题场景】 客户端以 consumer 身份订阅到 rabbitmq server 上的 queue 上,客户端侧在 AMQP 协议的 Connection.Tune-Ok 信令中,设置 heartbeat 为 0,即要求服务器侧不启用 heartbeat 功能。服务器由于异常断电原因停止服务,结果客户端在短时间内无法感知到服务器端已经异常。 刚刚出现这个问题时,就有测试人员和业务人员找到我这边说:经过改造的 rabbitmq-c 库可能存在重大 bug,服务器都关闭了,客户端怎么还那像什么都没发生一样继续工作着呢?听到这种疑问,我只问了两个问题就想到了答案: 业务中是不是仅仅作为 consumer 运行的? 服务器能否确认是因为异常断电导致停止服务? 服务器和业务程序之间是否还有中间路由设备? 业务人员告诉我上述问题的答案分别是:是的、是的、没有。呵呵~~所以答案就已经确定了,你想到了么? 【问题分析】 这个问题可以从以下两个层面进行分析: 1. TCP 协议层面 在此层面上讲,上述问题属于典型的 TCP 协议中的“ 半打开 ”问题,典型描述如下: 如果一方已经关闭或异常终止连接而另一方却还不知道,我们将这样的 TCP 连接称为半打开(Half-Open)的。任何一端的主机异常都可能导致发生这种情况。只要不打算在半打开连接上传输数据