에러 로그

Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event ‘binlog.000201’ at 5480571

분석

slave max_allowed_packet size (  1 M )

max_allowed_packet
서버에 전달 또는 서버로부터 받게 되는 패킷의 최대 길이
MySQL에서의 Packet이라 함은 Single SQL 문 또는 Replication이 이루어지는 Master에서 Slave로의 Binary Log Event를 의미한다.
MySQL 서버의 DEFAULT max_allowed_packet size 는 1 M 이다.

에러 로그는 master의 bin log packet이 허용할 수 있는 최대치를 초과했다는 에러 내용

해결 방법

mysql> set global max_allowed_packet = 1024*1024*100
mysql> set session max_allowed_packet = 1024*1024*100

재시작시 설정값 저장을 위해 my.cnf 파일도 함께 수정

현상

Windows Cluster 서비스 시작이 되지 않을때

에러 로그

The Cluster service cannot be started. An attempt to read configuration data from the Windows registry failed with error '2'. Please use the Failover Cluster Management snap-in to ensure that this machine is a member of a cluster. If you intend to add this machine to an existing cluster use the Add Node Wizard. Alternatively, if this machine has been configured as a member of a cluster, it will be necessary to restore the missing configuration data that is necessary for the Cluster Service to identify that it is a member of a cluster. Perform a System State Restore of this machine in order to restore the configuration data.

 Cluster Service 시작시 에러

해결

administration 권한으로 Cmd 오픈 후, 아래 명령어 실행하여 클러스터 초기화 진행

Cluster Node ServerName /ForceCleanup

아래 명령어로 클러스터 추가

Start-DatabaseAvailabilityGroup DAG1 -MailboxServer SiteA-Mbx1

해소되지 않는 경우 클러스터 신규 구성을 추천..

 

참고

http://www.lab365.in/2017/03/the-cluster-service-cannot-be-started.html

현상

MySQL 재시작 후 Table 내 AUTO_INCREMENT 값이 감소하는 현상이 발생

(예. 재시작 전: Auto_Increment 4000 , 재시작 후 Auto_Increment 3800)

원인

요약: MySQL InnoDB에서는 마지막 AUTO_INCREMENT을 메모리에만 저장

상세:

MySQL에서 InnoDB 엔진의 경우 AUTO_INCREMENT 값을 메모리에 저장하고 Insert 시 증가

 * 이슈 발생의 경우 tb_user 에서 data를 삭제 시 동일한 구조의 tb_user_del 값으로 insert 후 삭제하게 되는데

Table 의 AUTO_INCREMENT 값이 4000인 상태에서 SEQ가 3800~4000까지의 data를 tb_user_del 로 insert하고 삭제한 후 MySQL를 재시작하게 되면서 또 다시 SEQ가 3800부터 insert됨
(SEQ는 tb_user와 tb_user_del 모두 PK로 설정됨) 

재시작 이후 SEQ가 3800~4000인 data를 tb_user_del에 insert하면서 PK충돌이 일어나게 됨

해결 방법

AUTO_INCREMENT 를 MySQL 재시작시에도 유지하기 위해서는 엔진을 MyIsam으로 변경하거나 마지막 AUTO_INCREMENT값을 따로 기록을 하여야 함.

(발생한 이슈 해결을 위하여, tb_user_del의 PK를 nonclustered index로 변경하여 PK충돌을 해결하였음)

 


to Top