1. The need for TCP keepalive1) Many firewalls are automatically closed for idle sockets2) for non-normal disconnection, the server is not able to detect. In order to reclaim resources, a detection mechanism must be provided.2. Factors that cause TCP disconnectionIf the network is working properly, the socket is gracefully closed with close operation, so everything is perfect. However, there are many situations, such as a network cable failure, a sudden power outage on the client side or a cras
The environment is as follows:
[root@master ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga)[root@master ~]# uname -aLinux master 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux[root@master ~]#
Install Heartbeat-2.1.3 with the following error:
logd is already runningStarting High-Availability services: 2013/07/15_16:31:45 INFO: Resource is stopped2013/07/15_16:31:45 INFO: Resourc
This experiment uses Heartbeat2.0, that is, the old version. The old version of HA is a whole project, and the new version (after 3.0) has changed a lot. It is to split the HA project into several relatively scattered projects, it is developed and maintained by different project teams. Heartbeat2.0 integrated modules: 1. heartbeat
This experiment uses Heartbeat2.0, that is, the old version. The old version of HA is a whole project, and the new version
/mysqlChown-r Mysql.mysql/data/mysql# #编辑Mysql的配置文件/ETC/MY.CNF[Email protected] ~]# sed-n "/^[^#]/p"/etc/my.cnf[Mysqld]Server-id=1 # #保证全局唯一Log-bin=mysql-bin# #开启记录二进制日志的功能Relay-log=mysql-relay-bindatadir=/data/mysql/Socket=/data/mysql/mysql.sockUser=mysqlSymbolic-links=0[Mysqld_safe]Log-error=/var/log/mysqld.logPid-file=/var/run/mysqld/mysqld.pidTo manage MySQL boot to heartbeat, create a soft link to the MySQL startup script in the
The configuration of HA is divided into two parts, configured heartbeat and pacemaker, corresponds to the heartbeat version, and the configuration file has two versions, that is heartbeat1.x 1.x 2.1.x style version after style version and heartbeat2.1.x version
We can convert the 1.x style cluster resource profile into a 2.x style format, and use CRM to manage the entire cluster after the heartbeat2.1.x ve
issues that may occur with TCP long connections
1. Many firewall routers and so on for the free socket auto-shutdown
2. For non-normal disconnection, the server is not able to detect. In order to reclaim resources, a detection mechanism must be provided.
So, there is the heartbeat (HeartBeat) mechanism.
two implementation schemes of heartbeat mechanism
For now,
Simple RPC framework-heartbeat and reconnection mechanism, rpc framework heartbeatHeartbeat
It is to tell others that they are still alive. In the simple RPC framework, TCP persistent connections are used. To ensure a valid persistent connection, a notification mechanism between the client and the server is required to inform the other party of the survival status.How to Implement
The client sends a heartbeat
Heartbeat does not respond after startup, and heartbeat starts a response.
After applying heartbeat to the production environment, start service heartbeat start and no response will be made after discovery. Check the tail-f/var/log/ha-log as follows:
Heartbeat [30680]: 2015/
Heartbeat pack ...");
try {Out.write (hello);catch (IOException e) {System.out.println ("Send heartbeat packet failed.");return false;}
System.out.println ("Wait for server Heartbeat pack ...");
while (true) {TMP = GetData (in, 5);if (tmp[0] = = 0) {SYSTEM.OUT.PRINTLN ("The server did not return the heartbeat pa
Many application-layer protocols have a heartbeat mechanism, usually the client sends a packet to the server every other time, notifying the server that it is still online and transmitting some data that may be necessary. Typical protocols for using heartbeat packets are IM, such as qq/msn/fetion.Students who have learned TCP/IP should know that the two main protocols of the transport layer are UDP and TCP,
How to Implement Socket heartbeat packets and socket heartbeat packets
A client has been created recently, but a disconnection detection function is required. Let's take a look at using the custom HeartBeat method to check the client connection.
How to Implement heartbeat packets:
After the client is connected to the s
HeartBeat Heartbeat The necessity of heartbeat detection1. Cluster heartbeat detection to avoid network interruption2. Data synchronization: Master node write log, pull master node log from node every time.The significance of heartbeat detection:the client and the server hav
MySQL Master/Slave latency monitoring script (pt-heartbeat), mysqlpt-heartbeat
We can use percona's powerful weapon pt-heartbeat to monitor the master-slave replication latency of MySQL databases. Pt-heartbeat updates a specific table in the master database by using a timestamp. Then, it reads the updated timestamp fro
Transferred from:http://blog.csdn.net/keda8997110/article/details/8349049Heartbeat Heartbeat Technology Principle:Heartbeat (Linux-ha) Working principle: Heartbeat core consists of two parts, heartbeat monitoring part and the resource taking over part, heartbeat monitoring can be carried out through the network link an
One way to view the rac heartbeat ip address is to view the rac heartbeat ip address.
A Method for viewing heartbeat IP addresses
Source: GI Fails to Start as no Private Network Interface is Available (Doc ID 1481176.1)
From ocssd. log:
16:28:07. 224: [CSSD] [3316] clssnmReadNodeInfo: NM endp for node 2 (racnode2)-gipc: // racnode2: my-cluster #192.168.0.2 #49921
Heartbeat vibration Vibrator Used, heartbeat vibration vibrator
The device vibrator can be used to set the vibration frequency to simulate the heartbeat vibration.
There are two ways to obtain the device vibrator:
Vibrator = (Vibrator) getSystemService (VIBRATOR_SERVICE );
Vibrator = (Vibrator) getApplicationContext (). getSystemService (Service. VIBRATOR_SERVICE
use Alarmmanager to implement the heartbeat feature to make it truly long-connected. on the server side of the implementation:on the server side, can be implemented in many languages, such as C/c++,java,erlang and so on, such as our domestic relatively good aurora push (C development), OpenFire (Java development) and so on. recently I saw the introduction and principle of the Aurora push, so I'll talk about what kind of problems they are having, and
The development process often encounters timing-triggered requirements, such as: TCP/IP connections, using heartbeat packets to keep the connection or detecting whether the connection has been interrupted.There are several timers in WPF:1.using System.Windows.Threading;The code is as follows:usingSystem.Windows.Threading; Public Partial classmainwindow:window{DispatcherTimer timerheartbeat=NewDispatcherTimer (); PublicMainWindow () {Timerheartbeat.tic
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.