Hi there ð
Welcome to my website!
Hi there ð
Welcome to my website!
PostgreSQL16ããœãŒã¹ã³ãŒããããã«ãããŠã¿ãã®ã§ãããããã€ãã€ãŸã¥ãããã€ã³ããããã®ã§ããããã«ã玹ä»ããŸãã PostgreSQL16ããœãŒã¹ã³ãŒããããã«ãããããã®ã³ãã³ãã¯ä»¥äžã®ãšããã§ããåæãšã㊠M1 Mac (macOS 14.4.1) ã䜿ã£ãŠããŸãã % git clone git://git.postgresql.org/git/postgresql.git % cd postgresql % ./configure --enable-debug --enable-cassert --enable-tap-tests --prefix=$HOME/pgsql CFLAGS=-O0 % make -j 4 % make install configureã³ãã³ãã«ã¯ä»¥äžã®ãªãã·ã§ã³ãæå®ããŠããŸãã ãããã°ããããããããã®ãªãã·ã§ã³: âenable-debug âenable-cassert âenable-tap-tests ã€ã³ã¹ããŒã«å ã®ãã£ã¬ã¯ããªãæå®ãããªãã·ã§ã³: âprefix åè: https://www.postgresql.jp/document/16/html/install-make.html#CONFIGURE-OPTIONS icu-uc, icu-i18nã®ããã±ãŒãžãèŠã€ãããªã icu-uc, icu-i18nã®ããã±ãŒãžãèŠã€ãããªããšèšãããŸããã % ./configure --enable-debug --enable-cassert --enable-tap-tests --prefix=$HOME/pgsql CFLAGS=-O0 (çç¥) checking for icu-uc icu-i18n... no configure: error: Package requirements (icu-uc icu-i18n) were not met: No package 'icu-uc' found No package 'icu-i18n' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix....
以åKubernetesã¯ã©ã¹ã¿ãæ§ç¯ãããšãã«ãRocky Linuxã§containerdãã€ã³ã¹ããŒã«ããæ¹æ³ã«ã€ããŠããŸãæ å ±ããªãã£ãã®ã§ããšãŠãèŠåŽããŸããã ãªã®ã§ä»åã¯ãã®æã«èª¿ã¹ãå 容ãèšäºã«ããŠã¿ãŸããã 次ã®ã³ãã³ãã§containerdãã€ã³ã¹ããŒã«ã§ããŸãã # yumã«CentOSçšã®dockerãªããžããªãè¿œå ãã sudo yum config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # docker-ceãªããžããªã«å«ãŸããŠããcontainerd.ioã®ããã±ãŒãžãã€ã³ã¹ããŒã«ãã sudo yum install -y containerd.io # containerdã®ããã©ã«ãèšå®ãã¡ã€ã«ãçæãã sudo sh -c "containerd config default > /etc/containerd/config.toml" ãããŠæåŸã«containerdãæå¹åããŸãã systemctl enable --now containerd.service åè Using containerd without docker (Installing containerdã®éšå)
ãã°ããæŸçœ®ããŠããNUCäžã«k8sãã€ã³ã¹ããŒã«ããŠãããã¡ã¯ã©ã¹ã¿ãéçšããŠããããšæããŸãã ä»åã¯kubeadmã䜿ã£ãŠk8sãã€ã³ã¹ããŒã«ããããšæããŸãã åæ ãã¢ã¡ã¿ã«(Intel NUC11PAHi5)äžã«æ§ç¯ Control Planex1å°ãšWorkerx3å°ã®4å°æ§æ OSã¯Rocky Linux9.3 ã«ãŒã¿ãŒåŽã®èšå®ã§åºå®IPãå²ãåœãŠ åããŒãã®ã¹ããã¯ã¯ä»¥äž CPU ã¡ã¢ãª ã¹ãã¬ãŒãž 4ã³ã¢ 16GB 500GB kubeadmã®ã€ã³ã¹ããŒã« 以äžã®æé ãåèã«ããŸãã kubeadmã®ã€ã³ã¹ããŒã« ãå§ããåã«ãã«Swapããªãã§ããããšããšèšèŒããããŸãããswapããªãã«ãªã£ãŠããªãã£ãã®ã§ç¡å¹åããŸãã sudo swapoff -a ããŒãã®éæŸ kubernetesã®ã³ã³ããŒãã³ããäºãã«éä¿¡ããããã«ããããã®ããŒããéãå¿ èŠããããŸãã Rockyã¯RHELç³»ãªã®ã§firewall-cmdã䜿ã£ãŠãControl PlaneããŒãã®ããŒããéæŸããŸãã sudo firewall-cmd --add-port=6443/tcp --permanent sudo firewall-cmd --add-port=2379-2380/tcp --permanent sudo firewall-cmd --add-port=10250/tcp --permanent sudo firewall-cmd --add-port=10257/tcp --permanent sudo firewall-cmd --add-port=10259/tcp --permanent ããŒããéæŸãããããšã確èªããŸãã sudo firewall-cmd --reload sudo firewall-cmd --list-ports ç¶ããŠåWorkerããŒãã®ããŒããéæŸããŸãã sudo firewall-cmd --add-port=30000-32767/tcp --permanent sudo firewall-cmd --add-port=10250/tcp --permanent ããŒããéæŸãããããšã確èªããŸãã sudo firewall-cmd --reload sudo firewall-cmd --list-ports ã³ã³ããã©ã³ã¿ã€ã ã®ã€ã³ã¹ããŒã« ã³ã³ããã©ã³ã¿ã€ã ã®æé ãåèã«ãåããŒãã«èšå®ãããŠãããŸãã...
ãŠã©ã³ããããªãŒã«å ¥ç€ŸããŠ1ã¶æçµã£ãã®ã§ãè²ã ãšæ¯ãè¿ã£ãŠã¿ãããšæããŸãã 転è·ãèãããã£ãã åè·ã§ã¯ããããããªããŒãã«åãçµãã§ããããšãããããã®ãŸãŸé·ãå± ç¶ããŠãä»ã®äŒç€Ÿã§ãã£ãŠããããäžå®ã§ããããŸããå€åãæ©ãæ代ãªã®ã§ãäŒç€Ÿã«äŸåããå人ã§ãã£ãŠãããã ãã®å®åã»ã¹ãã«ã身ã«ã€ããããšèãããã£ãšæè¡åã䌞ã°ãããããªäŒç€Ÿã«ç§»ããããšæãããã«ãªããŸããã äŒæ¥éžã³ã®è»ž äŒæ¥éžã³ã¯ä»¥äžã®è»žãããšã«èããŸããã èªç€Ÿã§ãµãŒãã¹ãéçºã»éçšããŠãã æè¡åã®é«ããšã³ãžãã¢ãåšç±ããŠãã å é²çãªæè¡ãæ±ã£ãŠãã äžèšã®æ¡ä»¶ãæºãããããªäŒç€Ÿã§ããã°ããã£ãšæè¡åã䌞ã°ãããšæã£ãããã§ãã 転è·ã«åããŠè¡ã£ãããš ã€ã³ãã©ãšã³ãžã㢠/ SREè·ãåžæããŠããã®ã§ãäž»ã«ä»¥äžã®ãããªããšãè¡ããŸããã é¢é£ããè³æ Œã®ååŸ (AWS SAPãCKA) å人ããã°ã§ã®çºä¿¡ ç°¡åãªWebã¢ããªã®äœæ åè·ã§PostgreSQLãKubernetesã觊ãæ©äŒããã£ããã®ã®ãAWSãTerraformã®çµéšãããã«æ¬çªç°å¢ã®éçšçµéšããªãèŠåŽããŸãããå®åã§ã®çµéšäžè¶³ãè£ãããã«ãAWSã®è³æ ŒãååŸããããå人ããã°ã§ä»ãŸã§åŠãã ããšã®ã¢ãŠãããããªã©ãè¡ãããã«ããŸããããŸããSREè·ãªã©ã ãšèªååã®ããŒã«ãªã©ãGoã§æžãããšããããšæã£ãã®ã§ãGoã§ç°¡åãªTo-doã¢ããªãäœæãããããŸããã ãŠã©ã³ããããªãŒãžã®å ¥ç€Ÿã決ããçµç·¯ ãŠã©ã³ããããªãŒãžã¯ã¹ã«ãŠãçµç±ã§å ¥ç€ŸããŸãããïŒWantedly Visitã«ç»é²ãããããŠã©ã³ããããªãŒããã¹ã«ãŠããæ¥ãŠã³ã£ããããŸããç¬ïŒã«ãžã¥ã¢ã«é¢è«ã§è©±ãèããŠãããšãPostgreSQLãKubernetesãªã©ä»ãŸã§å¹ã£ãçµéšã掻ããã€ã€ãæ°ããææŠãã§ãããã ã£ãã®ã§ãéžèãåããŠã¿ãããšæããŸããã éžèãåããåã ã£ããã1次é¢æ¥ã®åŸã ã£ããèŠããŠããŸããããEngineering HandbookãšCulture Bookãããã ããŸããããŸããéçºãäŒç€Ÿã®æåã«é¢ããããšããã®ãããªåœ¢ã«ãŸãšããããŠããã®ãçŽ æµã ãšæããŸããããããŠãå 容ã«é¢ããŠããšã³ãžãã¢ãªã³ã°ã«å¯ŸããŠçæ¯ã«åãåã姿å¢ããšã³ãžãã¢ã«ãšãŠãç解ã®ããäŒç€Ÿã ãšããããšãäŒãã£ãŠããŠããããªäŒç€Ÿã§åããŠã¿ãããšæãããã«ãªããŸãããïŒå人çã«ã¯Culture Bookã®ãå€ãããšã³ãžãã¢ã®å®çŸ©ãã奜ãã§ãã) ãŸãã2次éžèãšã㊠1 day ã€ã³ã¿ãŒã³ã«åå ãããŠããã ããŸãããããã1æ¥ã®ã€ã³ã¿ãŒã³ã·ããã§ã¯ãããã®ã®ãããŒã ã¡ã³ããŒãã©ããªäººãªã®ããæ¥ã ã©ããªæ¥åã«åãçµãã§ããã®ããªã©å®éã«åãã€ã¡ãŒãžãã€ãããã®åŸå®å¿ããŠå ¥ç€Ÿããããšãã§ããŸããã å ¥ç€ŸããŠããã®ææ³ æ¯æ¥åãããªãããšã ããã§ããããã®ååŠã¶ããšãå€ããŠãšãŠãå å®ããŠããŸããåšãã®ãšã³ãžãã¢ã®æ¹ã ã¯æè¡åãé«ããŠãå°æ¬ã§ããæ¹ã°ããã§ãã ãªã³ããŒãã£ã³ã°ã«é¢ããŠã¯ãç ä¿®ã瀟å ã®ããã¥ã¡ã³ããæŽåãããŠããŠãã¹ã ãŒãºã«ç°å¢ã«éŠŽæãããšãã§ããŸãããåãããªãããšããããšããã«èããé°å²æ°ããããã¡ãã£ãšããããšã§ãSlackãHuddleã§çžè«ã§ããŠå€§å€ãããããã§ããé±2åºç€Ÿãªã®ã§ã察é¢ã§ã®ã³ãã¥ãã±ãŒã·ã§ã³ãã§ããŠè¯ãæãã§ãã ã³ã£ããããããšã¯ãäŒè°å®€ã®ååããžã§ãžã§ã®å¥åŠãªåéºããã€ããããŠããããšãçœéå°ã®ã©ã³ãã®éžæè¢ã®å°ãªããããšã¯ãšã³ãžãã¢ã®1å²ãDvorak䜿ããšããããšã§ãããç¬ãä»åŸãŠã©ã³ããããªãŒã§åãçµã¿ããããš ä»åŸåãçµã¿ããããšã¯ä»¥äžã®éãã§ãã Kubernetes, PostgreSQLãªã©ã®ã¢ããã°ã¬ãŒã ã€ã³ãã©ã®æ§èœç£èŠã»éçšæ¹åã»éå®³å¯Ÿå¿ GoãçšããããŒã«ã®éçº åè·ã ãšå®éçšãçµéšããŠããªãã£ãã®ã§ãã·ã¹ãã åºç€ã®ã¢ããã°ã¬ãŒããçµéšããããšããæãããããŸããåæ§ã«ãæ§èœç£èŠãéçšæ¹åãé害察å¿ãªã©ã€ã³ãã©ãšã³ãžãã¢ãšããŠæ±ããããŠããåºæ¬çãªæ¥åãäžéãçµéšããŠã¿ããã§ãããŸãããŠã©ã³ããããªãŒã®ã€ã³ãã©ããŒã ã¯æ§ã ãªããŒã«ãGoã§å®è£ ããŠããã®ã§ããããã®å®è£ ãç解ãæ¹åããŠãããã ãã®åãã€ããŠããããã§ãã äžèšä»¥å€ã«ãçŽè¿äžè¶³ããŠããç¥è(NWãAWSãTerraformãGitãªã©)ãå€ãã®ã§ãæ¥ã 粟é²ããŠããæåã§ãïŒ
Kubernetesäžã§Alertmanagerãã¡ãããšéç¥ã§ããããã©ããªå 容ãéç¥ãããŠããã®ã確èªããŠã¿ãããšãããšãé£æºããããã®Slackãå¿ èŠã§ãã£ãããEmailãéä¿¡ããã«ãã¡ãŒã«ãµãŒããå¿ èŠã ã£ãããšãæå€ãšæ°è»œã«è©ŠããªããšããããšããããŸããã ãªã®ã§ãä»åã¯webhookã®æ©èœã䜿ã£ãŠNginxã«ãªã¯ãšã¹ããé£ã°ãããªã¯ãšã¹ãã®å 容ããã°ãã確èªããŠã¿ãããšæããŸãã webhookãšã¯? Alertmanagerã®receiverã«ã¯ä»¥äžãæå®ã§ããŸãã Email Opesgenie PagerDuty Pushover Slack AWS SNS VictorOps Webhook Wechat Telegram Webex Webhookãšã¯ç¹å®ã®ãšã³ããã€ã³ãã«å¯ŸããŠHTTP POSTãªã¯ãšã¹ãã§ã¢ã©ãŒãã®æ å ±ãéä¿¡ãããšãããã®ã§ãã å€éšãµãŒãã¹ã§ã¯ãªãã®ã§ãèªåèªèº«ã§ãšã³ããã€ã³ããçšæããèªåèªèº«ã§åŸç¶ã®åŠçãå®è£ ããå¿ èŠããããŸãã äŸãã°ã以äžã®ããã«èšå®ããŸãã receivers: - name: "nginx" webhook_configs: - url: 'http://nginx-svc.default:8080/' webhookã®é£æºå ãšããŠnginxã䜿ã ä»åã¯webhookã®é£æºå ãšããŠnginxã䜿çšããŸãã nginxã䜿ã£ãŠå®çŸãããããšã¯ä»¥äžã®ãšããã§ãã ãšã³ããã€ã³ããçšæãã ãªã¯ãšã¹ãå 容ã確èªãã nginx.confã®åæèšå®ãããŒã¹ã«ããŠããŸããããã®ãŸãŸã ãšãªã¯ãšã¹ãå 容ã確èªããããšãã§ããªãã®ã§ãèšå®ãè¿œå ããŸããã log_formatã§$request_bodyãæå®ãã/ã«ã¢ã¯ã»ã¹ããæã«$request_bodyããã°ãšããŠæšæºåºåã«åºãããã«èšå®ããŠããŸãã ãããã$request_bodyãæå¹åããã«ã¯proxy_passãªã©ã®åŸç¶åŠçãå¿ èŠã«ãªããŸãããªã®ã§ãproxy_passã§/trashãšãããšã³ããã€ã³ãã«ãªã¯ãšã¹ãã転éãã/trashã§ç¹ã«æå³ã®ãªãåŠç(1x1ãã¯ã»ã«ã®gifãè¿ã)ãããŠããŸãã The variableâs value is made available in locations processed by the proxy_pass, fastcgi_pass, uwsgi_pass, and scgi_pass directives when the request body was read to a memory buffer. http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx....