Update outdated files in the dev-1.19-ko.7 branch
This commit is contained in:
@@ -11,6 +11,7 @@ spec:
|
||||
containers:
|
||||
- name: hello
|
||||
image: busybox
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
|
||||
@@ -5,12 +5,12 @@ metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
data:
|
||||
master.cnf: |
|
||||
# Apply this config only on the master.
|
||||
primary.cnf: |
|
||||
# Primary에만 이 구성을 적용한다.
|
||||
[mysqld]
|
||||
log-bin
|
||||
slave.cnf: |
|
||||
# Apply this config only on slaves.
|
||||
replica.cnf: |
|
||||
# 레플리카에만 이 구성을 적용한다.
|
||||
[mysqld]
|
||||
super-read-only
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Headless service for stable DNS entries of StatefulSet members.
|
||||
# 스테이트풀셋 멤버의 안정적인 DNS 엔트리를 위한 헤드리스 서비스.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
@@ -13,8 +13,8 @@ spec:
|
||||
selector:
|
||||
app: mysql
|
||||
---
|
||||
# Client service for connecting to any MySQL instance for reads.
|
||||
# For writes, you must instead connect to the master: mysql-0.mysql.
|
||||
# 읽기용 MySQL 인스턴스에 연결하기 위한 클라이언트 서비스.
|
||||
# 쓰기용은 Primary인 mysql-0.mysql에 대신 연결해야 한다.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
|
||||
@@ -21,17 +21,17 @@ spec:
|
||||
- "-c"
|
||||
- |
|
||||
set -ex
|
||||
# Generate mysql server-id from pod ordinal index.
|
||||
# 파드의 원래 인덱스에서 mysql server-id를 생성.
|
||||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
|
||||
ordinal=${BASH_REMATCH[1]}
|
||||
echo [mysqld] > /mnt/conf.d/server-id.cnf
|
||||
# Add an offset to avoid reserved server-id=0 value.
|
||||
# 예약된 server-id=0 값을 피하기 위해 오프셋 추가.
|
||||
echo server-id=$((100 + $ordinal)) >> /mnt/conf.d/server-id.cnf
|
||||
# Copy appropriate conf.d files from config-map to emptyDir.
|
||||
# config-map에서 emptyDir로 적당한 conf.d 파일들을 복사.
|
||||
if [[ $ordinal -eq 0 ]]; then
|
||||
cp /mnt/config-map/master.cnf /mnt/conf.d/
|
||||
cp /mnt/config-map/primary.cnf /mnt/conf.d/
|
||||
else
|
||||
cp /mnt/config-map/slave.cnf /mnt/conf.d/
|
||||
cp /mnt/config-map/replica.cnf /mnt/conf.d/
|
||||
fi
|
||||
volumeMounts:
|
||||
- name: conf
|
||||
@@ -45,15 +45,15 @@ spec:
|
||||
- "-c"
|
||||
- |
|
||||
set -ex
|
||||
# Skip the clone if data already exists.
|
||||
# 데이터가 이미 존재하면 복제 생략.
|
||||
[[ -d /var/lib/mysql/mysql ]] && exit 0
|
||||
# Skip the clone on master (ordinal index 0).
|
||||
# Primary에 복제 생략(ordinal index 0).
|
||||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
|
||||
ordinal=${BASH_REMATCH[1]}
|
||||
[[ $ordinal -eq 0 ]] && exit 0
|
||||
# Clone data from previous peer.
|
||||
# 이전 피어(peer)에서 데이터 복제.
|
||||
ncat --recv-only mysql-$(($ordinal-1)).mysql 3307 | xbstream -x -C /var/lib/mysql
|
||||
# Prepare the backup.
|
||||
# 백업 준비.
|
||||
xtrabackup --prepare --target-dir=/var/lib/mysql
|
||||
volumeMounts:
|
||||
- name: data
|
||||
@@ -88,7 +88,7 @@ spec:
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
# Check we can execute queries over TCP (skip-networking is off).
|
||||
# TCP 상에서 쿼리를 실행할 수 있는지 확인(skip-networking은 off).
|
||||
command: ["mysql", "-h", "127.0.0.1", "-e", "SELECT 1"]
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 2
|
||||
@@ -105,22 +105,22 @@ spec:
|
||||
set -ex
|
||||
cd /var/lib/mysql
|
||||
|
||||
# Determine binlog position of cloned data, if any.
|
||||
# 복제된 데이터의 binlog 위치를 확인.
|
||||
if [[ -f xtrabackup_slave_info && "x$(<xtrabackup_slave_info)" != "x" ]]; then
|
||||
# XtraBackup already generated a partial "CHANGE MASTER TO" query
|
||||
# because we're cloning from an existing slave. (Need to remove the tailing semicolon!)
|
||||
# XtraBackup은 기존 레플리카에서 복제하기 때문에
|
||||
# 일부 "CHANGE MASTER TO" 쿼리는 이미 생성했음. (테일링 세미콜론을 제거해야 한다!)
|
||||
cat xtrabackup_slave_info | sed -E 's/;$//g' > change_master_to.sql.in
|
||||
# Ignore xtrabackup_binlog_info in this case (it's useless).
|
||||
# 이 경우에는 xtrabackup_binlog_info는 무시(필요없음).
|
||||
rm -f xtrabackup_slave_info xtrabackup_binlog_info
|
||||
elif [[ -f xtrabackup_binlog_info ]]; then
|
||||
# We're cloning directly from master. Parse binlog position.
|
||||
# Primary로부터 직접 복제함. binlog 위치를 파싱.
|
||||
[[ `cat xtrabackup_binlog_info` =~ ^(.*?)[[:space:]]+(.*?)$ ]] || exit 1
|
||||
rm -f xtrabackup_binlog_info xtrabackup_slave_info
|
||||
echo "CHANGE MASTER TO MASTER_LOG_FILE='${BASH_REMATCH[1]}',\
|
||||
MASTER_LOG_POS=${BASH_REMATCH[2]}" > change_master_to.sql.in
|
||||
fi
|
||||
|
||||
# Check if we need to complete a clone by starting replication.
|
||||
# Replication을 시작하여 복제를 완료해야 하는지 확인.
|
||||
if [[ -f change_master_to.sql.in ]]; then
|
||||
echo "Waiting for mysqld to be ready (accepting connections)"
|
||||
until mysql -h 127.0.0.1 -e "SELECT 1"; do sleep 1; done
|
||||
@@ -133,11 +133,11 @@ spec:
|
||||
MASTER_PASSWORD='', \
|
||||
MASTER_CONNECT_RETRY=10; \
|
||||
START SLAVE;" || exit 1
|
||||
# In case of container restart, attempt this at-most-once.
|
||||
# 컨테이너가 다시 시작하는 경우, 이 작업을 한번만 시도한다.
|
||||
mv change_master_to.sql.in change_master_to.sql.orig
|
||||
fi
|
||||
|
||||
# Start a server to send backups when requested by peers.
|
||||
# 피어가 요청할 때 서버를 시작하여 백업을 보냄.
|
||||
exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
|
||||
"xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=root"
|
||||
volumeMounts:
|
||||
|
||||
Reference in New Issue
Block a user