일반적으로 쿠버네티스에서 최소한의 HA를 보장하기 위한 조건이 마스터 노드 3개, 워커 노드 2개라고 하는데, 마스터 노드가 왜 3개 이상이어야 하는지가 궁금합니다 마스터 노드가 etcd 역할을 수행할 때 데이터베이스의 최소한의 무결성을 보장하기 위한 노드의 수가 3개라는데 무결성을 보장하는 방법이 디스크를 RAID5로 묶는 것과 비슷한 방식인가요? 아니면 RAID1처럼 모든 노드에 동일한 데이터를 분배하는 방식인가요? 만약 이 방식이 맞다면 굳이 2개가 아닌 3개 이상이 최소한의 HA 보장 조건인 이유가 무엇인가요? 최소한의 마스터 노드의 개수가 3개인 것은 etcd에 대한 요구사항이고, control plane과는 전혀 관련이 없는건가요? 그리고 etcd가 무결성을 보장하기 위해 RAFT 알고리즘을 통해 투표로 리더를 선출한다고 하는데, 이 과정은 관리자가 직접 지정하지 않아도 프로그램들이 현재 상태를 참고하여 필요할 때마다 실행하는 방식인가요? 투표로 리더를 선출하기 전에는 명확한 리더가 없는 상태인 것 같은데, 이러한 상태는 leader 노드가 터져야만 발생하는 현상인가요? 마지막으로, mariadb galera 클러스터는 전체 노드를 마스터로써 취급한다고 하는데, etcd에서 이 방식을 사용하지 않는 이유는 효율성을 위해서인가요? 아니면 위에서 말한 리더 중심의 무결성 보장 방식이 더 안정적이기 때문인가요?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install zsh | |
brew install zsh-completions | |
mkdir -p "$HOME/.zsh" | |
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure" | |
chsh -s /bin/zsh $whoami | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
function isPhoneNumberThenEchoYes() { | |
if [[ "${1-}" =~ ^([0-9]{2}|[0-9]{3})(-| )?([0-9]{3}|[0-9]{4})(-| )?[0-9]{4}$ ]]; then | |
echo yes | |
else | |
echo no | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets the minimum version of CMake required to build the native library. | |
cmake_minimum_required(VERSION 3.4.1) | |
# Ref: https://github.com/tensorflow/tensorflow/blob/v1.4.0/tensorflow/contrib/android/cmake/CMakeLists.txt#L37-L48 | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIS_SLIM_BUILD \ | |
-std=c++11 -fno-rtti -fexceptions \ | |
-O2 -Wno-narrowing -fomit-frame-pointer \ | |
-fPIE \ | |
-ftemplate-depth=900 \ | |
-DGOOGLE_PROTOBUF_NO_RTTI \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
OS=${OS:-`uname`} | |
old_rev="$1" | |
new_rev="$2" | |
get_file_rev() { | |
git rev-list -n 1 "$new_rev" "$1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
a=abc!! | |
echo a=[$a] | |
echo "" | |
result=`echo $a | sed -e 's/!/\\\\!/g'` | |
echo \`~\`=[$result] | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def get_header_names(decoded): | |
ret = [] | |
first_tr_idx_st = decoded.find("<tr>") | |
first_tr_idx_ed = decoded.find("</tr>") | |
headers = decoded[first_tr_idx_st + len("<tr>"):first_tr_idx_ed] | |
# print(headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v7.widget.SwitchCompat; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.widget.Checkable; | |
import android.widget.CompoundButton; | |
import android.widget.LinearLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from setuptools import setup, find_packages | |
from mtml.about import __version__, __description__ | |
try: | |
import CPLEX | |
except ImportError as e: | |
raise EnvironmentError("""You must install CPLEX manually first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from __future__ import print_function | |
import datetime | |
import json | |
import os | |
from copy import deepcopy | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials |
NewerOlder