MySQL Replication 가끔 누락되는 데이터
DB Master 와 Slave 서버로 Replication 으로 동기화 운영중인데
하루에 몇 건 정도는 싱크가 누락되는 것 같다.
이유가 무엇일까 궁금하다~
cron 으로 두 DB 의 테이블을 비교하는 스크립트를 돌려서 다르면 다시 맞춰주고 있지만
제대로 Replication 이 되면 얼마나 좋을까~
그냥 푸념해본다~
2017년 5월 2일 화요일
2017년 4월 21일 금요일
CentOS 7.x minimal ifconfig command not found
CentOS 7.x minimal ifconfig command not found
[root@localhost ~]# ifconfig
-bash: ifconfig: command not found
[root@localhost ~]# netstat
-bash: netstat: command not found
[root@localhost ~]# yum install net-tools
...
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
Complete!
2017년 4월 7일 금요일
CentOS 6.x X Window 삭제
CentOS 6.x X Window 삭제
서버호스팅을 신청했더니 불필요한 X윈도우까지 설치가 되어 있네요.
삭제하는 방법은 yum 그룹리스트가 있는 확인하고 삭제하면 됩니다.
[root@vps ~]# yum grouplist "X Window System"
Loaded plugins: fastestmirror, security
Setting up Group Process
Loading mirror speeds from cached hostfile
* base: mirror.oasis.onnetcorp.com
* epel: mirror.premi.st
* extras: mirror.oasis.onnetcorp.com
* rpmforge: ftp.neowiz.com
* updates: mirror.oasis.onnetcorp.com
Available Groups:
X Window System
Done
[root@vps ~]# yum groupremove "X Window System"
Loaded plugins: fastestmirror, security
Setting up Group Process
Loading mirror speeds from cached hostfile
* base: mirror.oasis.onnetcorp.com
* epel: mirror.premi.st
* extras: mirror.oasis.onnetcorp.com
* rpmforge: ftp.neowiz.com
* updates: mirror.oasis.onnetcorp.com
Resolving Dependencies
--> Running transaction check
---> Package hal.x86_64 0:0.5.14-14.el6 will be erased
--> Processing Dependency: hal >= 0.5.10 for package: hal-info-20090716-5.el6.noarch
--> Processing Dependency: hal = 0.5.14-14.el6 for package: hal-devel-0.5.14-14.el6.x86_64
--> Processing Dependency: hal for package: pm-utils-1.2.5-11.el6.x86_64
---> Package xorg-x11-server-utils.x86_64 0:7.7-14.el6 will be erased
---> Package xorg-x11-xauth.x86_64 1:1.0.9-1.el6 will be erased
---> Package xorg-x11-xinit.x86_64 0:1.0.9-14.el6 will be erased
--> Processing Dependency: xorg-x11-xinit >= 1.0.2-22.fc8 for package: imsettings-0.108.0-3.6.el6.x86_64
--> Running transaction check
---> Package hal-devel.x86_64 0:0.5.14-14.el6 will be erased
---> Package hal-info.noarch 0:20090716-5.el6 will be erased
---> Package imsettings.x86_64 0:0.108.0-3.6.el6 will be erased
---> Package pm-utils.x86_64 0:1.2.5-11.el6 will be erased
--> Processing Dependency: pm-utils for package: libvirt-client-0.10.2-62.el6.x86_64
--> Running transaction check
---> Package libvirt-client.x86_64 0:0.10.2-62.el6 will be erased
--> Processing Dependency: libvirt-qemu.so.0()(64bit) for package: libvirt-devel-0.10.2-62.el6.x86_64
--> Processing Dependency: libvirt.so.0()(64bit) for package: libvirt-devel-0.10.2-62.el6.x86_64
--> Processing Dependency: libvirt-client = 0.10.2-62.el6 for package: libvirt-devel-0.10.2-62.el6.x86_64
--> Processing Dependency: libvirt-client >= 0.9.12 for package: libvirt-java-0.4.9-1.el6.noarch
--> Running transaction check
---> Package libvirt-devel.x86_64 0:0.10.2-62.el6 will be erased
---> Package libvirt-java.noarch 0:0.4.9-1.el6 will be erased
--> Processing Dependency: libvirt-java = 0.4.9-1.el6 for package: libvirt-java-devel-0.4.9-1.el6.noarch
--> Running transaction check
---> Package libvirt-java-devel.noarch 0:0.4.9-1.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
hal x86_64 0.5.14-14.el6 @base 1.2 M
xorg-x11-server-utils x86_64 7.7-14.el6 @base 364 k
xorg-x11-xauth x86_64 1:1.0.9-1.el6 @base 89 k
xorg-x11-xinit x86_64 1.0.9-14.el6 @base 71 k
Removing for dependencies:
hal-devel x86_64 0.5.14-14.el6 @base 48 k
hal-info noarch 20090716-5.el6 @base 311 k
imsettings x86_64 0.108.0-3.6.el6 @base 813 k
libvirt-client x86_64 0.10.2-62.el6 @base 15 M
libvirt-devel x86_64 0.10.2-62.el6 @base 5.0 M
libvirt-java noarch 0.4.9-1.el6 @base 73 k
libvirt-java-devel noarch 0.4.9-1.el6 @base 15 k
pm-utils x86_64 1.2.5-11.el6 @base 254 k
Transaction Summary
================================================================================
Remove 12 Package(s)
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : libvirt-devel-0.10.2-62.el6.x86_64 1/12
Erasing : libvirt-java-devel-0.4.9-1.el6.noarch 2/12
Erasing : libvirt-java-0.4.9-1.el6.noarch 3/12
Erasing : hal-devel-0.5.14-14.el6.x86_64 4/12
Erasing : libvirt-client-0.10.2-62.el6.x86_64 5/12
Erasing : hal-info-20090716-5.el6.noarch 6/12
Erasing : hal-0.5.14-14.el6.x86_64 7/12
Erasing : pm-utils-1.2.5-11.el6.x86_64 8/12
Erasing : imsettings-0.108.0-3.6.el6.x86_64 9/12
Erasing : xorg-x11-xinit-1.0.9-14.el6.x86_64 10/12
Erasing : 1:xorg-x11-xauth-1.0.9-1.el6.x86_64 11/12
Erasing : xorg-x11-server-utils-7.7-14.el6.x86_64 12/12
Verifying : xorg-x11-server-utils-7.7-14.el6.x86_64 1/12
Verifying : pm-utils-1.2.5-11.el6.x86_64 2/12
Verifying : xorg-x11-xinit-1.0.9-14.el6.x86_64 3/12
Verifying : hal-info-20090716-5.el6.noarch 4/12
Verifying : hal-devel-0.5.14-14.el6.x86_64 5/12
Verifying : libvirt-client-0.10.2-62.el6.x86_64 6/12
Verifying : 1:xorg-x11-xauth-1.0.9-1.el6.x86_64 7/12
Verifying : imsettings-0.108.0-3.6.el6.x86_64 8/12
Verifying : hal-0.5.14-14.el6.x86_64 9/12
Verifying : libvirt-java-devel-0.4.9-1.el6.noarch 10/12
Verifying : libvirt-java-0.4.9-1.el6.noarch 11/12
Verifying : libvirt-devel-0.10.2-62.el6.x86_64 12/12
Removed:
hal.x86_64 0:0.5.14-14.el6 xorg-x11-server-utils.x86_64 0:7.7-14.el6
xorg-x11-xauth.x86_64 1:1.0.9-1.el6 xorg-x11-xinit.x86_64 0:1.0.9-14.el6
Dependency Removed:
hal-devel.x86_64 0:0.5.14-14.el6 hal-info.noarch 0:20090716-5.el6
imsettings.x86_64 0:0.108.0-3.6.el6 libvirt-client.x86_64 0:0.10.2-62.el6
libvirt-devel.x86_64 0:0.10.2-62.el6 libvirt-java.noarch 0:0.4.9-1.el6
libvirt-java-devel.noarch 0:0.4.9-1.el6 pm-utils.x86_64 0:1.2.5-11.el6
Complete!
2017년 3월 28일 화요일
UNISON Waiting for changes from server
UNISON Waiting for changes from server
unison 을 실행하였는데 "Waiting for changes from server" 메시지 출력 이후 한참 기다려도 끝이 안나는데 그래도 기다리면 결과가 나옵니다.
이유는 두 서버에 파일이 많으면 파일 비교 데이터를 생성하는 과정에서 시간이 걸리기 때문입니다.
서버 사양에 따라 다르겠지만 7기가 조금 넘은 분량인데 10분 정도 걸렸습니다.
# unison
Contacting server...
Connected [//mydomain2.com//home -> //mydomain1.com//home]
Looking for changes
Warning: No archive files were found for these roots, whose canonical names are:
/home
//mydomain1.com//home
This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.
Update detection may take a while on this run if the replicas are
large.
Unison will assume that the 'last synchronized state' of both replicas
was completely empty. This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.
If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations. See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.
Donations to the Unison project are gratefully accepted:
http://www.cis.upenn.edu/~bcpierce/unison
Waiting for changes from server
Reconciling changes
Nothing to do: replicas have been changed only in identical ways since last sync.
2017년 3월 27일 월요일
CentOS 7.x lsyncd Error: Temporary or permanent failure on startup
CentOS 7.x lsyncd Error: Temporary or permanent failure on startup
# systemctl start lsyncd
Mon Mar 27 15:45:27 2017 Error: Temporary or permanent failure on startup of "/home/". Terminating since "insist" is not set.
Main Server
# cat /etc/ssh/sshd_config | grep PermitRoot
PermitRootLogin no
# vi /etc/ssh/sshd_config
#PermitRootLogin no
PermitRootLogin yes
# systemctl restart sshd
Backup Server
# ssh-keygen
# ssh-copy-id root@mainserverip
# systemctl start lsyncd
2017년 3월 22일 수요일
CentOS 7.x mod_cband compile error
CentOS 7.x mod_cband compile error
# ./configure
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
# yum install gcc
# ./configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether make sets $(MAKE)... yes
checking for apr_palloc in -laprutil... no
checking for an ANSI C-conforming const... yes
checking for apxs... no
checking for apxs2... no
configure: error: apxs missing
# yum install httpd-devel
# make
apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function 'mod_cband_create_traffic_size':
src/mod_cband.c:1054:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
if ((unit != "" && unit[0] == 'G') || (unit == "" && kb >= mult*mult)) {
^
src/mod_cband.c:1054:49: warning: comparison with string literal results in unspecified behavior [-Waddress]
if ((unit != "" && unit[0] == 'G') || (unit == "" && kb >= mult*mult)) {
^
src/mod_cband.c:1058:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
if ((unit != "" && unit[0] == 'M') || (unit == "" && kb >= mult)) {
^
src/mod_cband.c:1058:49: warning: comparison with string literal results in unspecified behavior [-Waddress]
if ((unit != "" && unit[0] == 'M') || (unit == "" && kb >= mult)) {
^
src/mod_cband.c: In function 'mod_cband_get_dst':
src/mod_cband.c:1333:47: error: 'conn_rec' has no member named 'remote_ip'
p.add.sin.s_addr = inet_addr(r->connection->remote_ip);
^
src/mod_cband.c: In function 'mod_cband_get_remote_host':
src/mod_cband.c:1362:10: error: 'struct conn_rec' has no member named 'remote_i '
if (c->remote_ip != NULL)
^
src/mod_cband.c:1363:20: error: 'struct conn_rec' has no member named 'remote_i '
addr = inet_addr(c->remote_ip);
^
src/mod_cband.c:1365:10: error: 'struct conn_rec' has no member named 'remote_addr'
addr = c->remote_addr->sa.sin.sin_addr.s_addr;
^
src/mod_cband.c: In function 'mod_cband_update_speed':
src/mod_cband.c:1905:19: warning: variable 'time_last_request' set but not used [-Wunused-but-set-variable]
unsigned long time_last_request;
^
src/mod_cband.c: In function 'mod_cband_check_connections_speed':
src/mod_cband.c:2963:19: warning: variable 'time_now' set but not used [-Wunused-but-set-variable]
unsigned long time_now;
^
apxs:Error: Command failed with rc=65536
.
make: *** [src/.libs/mod_cband.so] Error 1
# sed -i 's/remote_ip/client_ip/g' ./src/mod_cband.c
# sed -i 's/c->remote_addr/c->client_addr/g' ./src/mod_cband.c
# make
# make install
CentOS 7.x How to open 53 port
CentOS 7.x How to open 53 port
[root@vps log]# firewall-cmd --permanent --zone=public --add-service=dns
success
[root@vps log]# firewall-cmd --reload
success
[root@vps log]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client dns ftp http https mysql ssh
ports:
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks: echo-request
rich rules:
[root@vps log]# firewall-cmd --permanent --zone=public --add-service=dns
success
[root@vps log]# firewall-cmd --reload
success
[root@vps log]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client dns ftp http https mysql ssh
ports:
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks: echo-request
rich rules:
[root@vps log]# netstat -ant | grep :53
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
how to remove
# firewall-cmd --permanent --zone=public --remove-service=dns
피드 구독하기:
글 (Atom)