Linux(35)
-
Aurora MySQL 대용량 테이블 DROP COLUMN
Aurora MySQL 대용량 테이블 DROP COLUMN, 두 번 실패 후 성공한 기록수억 행, 200GB가 넘는 테이블에서 컬럼을 제거해야 할 때가 있다. ALTER TABLE DROP COLUMN은 단순해 보이지만, 테이블 규모가 크면 예상보다 훨씬 오래 걸리고, 리소스 부족으로 실패하기도 한다. 이번에는 두 번 실패한 뒤 세 번째 시도에서 성공한 과정을 정리해봤다.배경: 왜 컬럼을 제거했나개인정보 보호를 위해 기존 평문 컬럼을 제거하고, 암호화된 컬럼만 남기는 작업이었다. 대상 테이블은 감사(audit) 로그용으로, 수억 행에 200GB 이상의 데이터와 인덱스를 가지고 있었다.1차 시도: 일괄 DROP – 실패첫 시도는 3개 컬럼을 한 번에 제거하는 방식이었다.ALTER TABLE target_t..
2026.03.19 -
MySQL Dump, Restore 관련 필요한 명령어
개요MySQL을 운영할 때 필요한 작업중에는 MySQL dump 및 restore 작업이 있다. 이에 관련된 명령어를 정리해봤다. 명령어## mysql database create 확인show create database ;## mysql table create 확인show create table ;## mysql schema dump 명령어 예시mysqldump -u -h -p \ --no-data --skip-comments \ --skip-set-charset \ --skip-add-drop-table \ --skip-add-locks \ --skip-disable-keys \ --skip-triggers \ --skip-routines \ --set-gtid-purged=OF..
2025.02.26 -
Failed to pull image "amazon/aws-cli": pull QPS exceeded
개요EKS나 Docker를 시작할 때 위와 같은 에러가 날 경우 원인docker hub에서 rate limit이 걸리는 현상 해결아래와 같이 Docker hub가 아닌 AWS Public ECR에서 Pull을 하면 해소가 됩니다.amazon/aws-cli >> public.ecr.aws/aws-cli/aws-cli:latest
2024.12.17 -
docker desktop 대안
개요mac 환경에서 docker desktop을 사용하다보면 프로그램이 무겁고 느려서 개발 환경에 안 좋은 영향을 끼친다. 대안Docker desktop 삭제하고 orbstack을 깔면 해결된다.https://orbstack.dev/ 참고https://levelup.gitconnected.com/stop-using-docker-desktop-faster-alternative-nobody-uses-d36a64af09a6
2024.10.23 -
bash 스크립트 (숫자의 배수 출력 하기)
개요 Bash script를 사용해서 1에서 100까지 숫자중에 3, 5, 7의 배수를 출력하는 예제이다. 예제 1 #!/bin/bash for i in $(seq 1 100); do if (( i % 3 == 0 )); then echo "Multiple of 3: $i" fi if (( i % 5 == 0 )); then echo "Multiple of 5: $i" fi if (( i % 7 == 0 )); then echo "Multiple of 7: $i" fi done 예제 2 #!/bin/bash for x in 3 5 7; do for i in $(seq 1 100); do if (( i % $x == 0 )); then echo "Multiple of $x : $i" fi done done
2024.02.19 -
Error response from daemon: readlink /var/lib/docker/overlay2/l: invalid argument
개요 docker inspect 명령어 사용시 발생하는 에러 에러 메세지 Error response from daemon: readlink /var/lib/docker/overlay2/l: invalid argument 원인 not enough docker overlay2 disk 해결 overlay 디스크 정리 # docker system prune -af
2023.12.29 -
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
- 개요 docker build .. >>> 위 명령어를 사용하는 경우 error 및 warning이 발생한다 - 에러 메세지 failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-buildx: no such file or directory DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/buildx/ - 해결 install docker-buildx-plugin d..
2023.09.19 -
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
- 개요 docker login 할때 아래와 같은 warning 발생 WARNING! Using --password via the CLI is insecure. Use --password-stdin. - 발생 docker login --username AWS -p $(aws ecr get-login-password --region ap-northeast-2) .dkr.ecr.ap-northeast-2.amazonaws.com/ - 해결 aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin "$(aws sts get-caller-identity --query Account --outpu..
2023.09.19 -
bash에서 파일 안에 column 값을 다 더하기
- 옵션1 paste -sd+ | bc - 옵션2 cat | paste -sd+ | bc
2023.08.30 -
systemctl 환경에서 sysstat interval 변경
- 개요 sysstat sar data는 default 10분 간격이다. 그러나 1분 으로 조정하는게 훨씬 효과적이다. CentOS 7까지는 cron.d에서 변경이 가능했으나, 8 이상 부터는 systemctl에서 변경해야 한다 - 변경 방법 >> sudo systemctl edit --full sysstat-collect.timer ## change 10 -> 1 >> systemctl daemon-reload >> systemctl cat sysstat-collect.timer # /etc/systemd/system/sysstat-collect.timer # /usr/lib/systemd/system/sysstat-collect.timer # (C) 2014 Tomasz Torcz # # syssta..
2023.08.14