System Integration Challenge: Ensuring Lossless Log Collection During MySQL Log Rotation with FluentBit
·
DevOps
OutlineOne concern I had while setting up logrotate was that although it was confirmed that logs could be received without loss through logrotate, the question was how fluentbit would recognize the newly created log files through logrotate.Since fluentbit also recognizes files registered to fd once based on inode, I had to notify fluentbit about the newly created files through logrotate.Therefor..
System-level Analysis of Lossless Log Rotation in MySQL: An strace-based Investigation of logrotate Mechanisms
·
데이터베이스/MySQL
What happens when you FLUSH LOGS and the RELOAD permissionI thought that the log file for MySQL would be continuously growing, making it difficult to check the logs later when analyzing the problem.So I thought of a way to store the logs in segments by dividing them by date.I looked into MySQL and found that you can restart the entire log file using the SQL Statement called FLUSH LOGS.https://de..
Deep Dive into MySQL Health Check Mechanisms: From Access Denied Analysis to Privilege Minimization
·
데이터베이스/MySQL
While checking MySQL's general log, I noticed that the message Connect Access denied for user 'root'@'localhost' (using password: NO) was added every 10 seconds.I clearly set the password through the environment variable MYSQL_ROOT_PASSWORD provided by the MYSQL Docker image, and when I checked the SQL statement in another General log, it didn't seem to be a problem caused by an incorrect root a..
Redis를 컨테이너 환경에서 실행할 때 deamonize을 키면 안되는 이유
·
데이터베이스/Redis
Redis의 deamonize 옵션은 기본적으로 꺼져 있는데, 이를 키게 되면 Redis를 데몬 프로세스로 실행하게 된다.데몬은 사용자가 제어하는 것이 아닌 백그라운드에서 돌면서 여러 작업을 하는 프로그램을 말한다. 일반적으로 데몬은 프로세스로 실행하지만, 부모 프로세스를 가지지 않으며 보통 포크를 통해 자식 프로세스가 만들어지고 이후 부모 프로세스를 죽이는 과정을 통해 자식 프로세스가 부모 프로세스가 되는 과정을 거치도록 한다. 이러한 방법을 fork off and die라고 한다.시스템은 시동할 때 데몬을 시작하는 경우가 많으며, 이러한 데몬들은 네트워크 요청, 하드웨어 동작, 여타 프로그램에 반응하는 기능을 담당하게 된다.데몬을 만드려면 보통 다음과 같은 과정을 거친다.프로세스를 제어하고 있는 터미..
umask란 무엇인가
·
궁금했던 거
umask - 위키백과, 우리 모두의 백과사전위키백과, 우리 모두의 백과사전. umask는 컴퓨팅에서 새로 만들어진 파일에 파일 권한을 어떻게 설정할지를 제어하는 마스크 설정을 결정하는 명령어이다. mask, umask 명령어와 umask 함수는 원래ko.wikipedia.org Linux_umaskumask : 리눅스에서 새로 만들어진 파일에 권한을 어떻게 설정할지 마스크를 결정하는 명령어. umask 명령은 mask 매개변수가 지정되지 않는 경우 현재 쉘 환경의 파일 모드 작성 마스크를 표준 출력proengineer.tistory.com umask는 앞으로 생길 파일/디렉토리의 권한을 설정하는 명령어이다.umask에서 파일은 기본적으로 666로 시작하고 디렉토리는 777으로 시작해서 계산한다.디렉토리..
MySQL 로깅 분할 방식에 대한 고찰
·
데이터베이스/MySQL
FLUSH LOGS 시 발생하는 일과 RELOAD 권한MySQL에 대한 로그 파일이 지속적으로 커져 추후 로그를 보며 문제를 분석할 때 확인하기 어려울 거 같다는 생각이 들었다.때문에 날짜별로 로그를 나눠서 저장함으로써 로그를 분할 저장하는 방식을 생각했다.MySQL을 찾아보니 FLUSH LOGS라는 SQL Statement를 사용해서 전반적인 로그 파일을 재시작시킬 수 있다고 한다. MySQL :: MySQL 8.4 Reference Manual :: 15.7.8.3 FLUSH Statement15.7.8.3 FLUSH Statement FLUSH [NO_WRITE_TO_BINLOG | LOCAL] { flush_option [, flush_option] ... | tables_option } flus..
MySQL 컨테이너에 있는 로그 마운트하기
·
데이터베이스/MySQL
글쓴이의 컴퓨터 환경은 다음과 같습니다.사용기기: Macbook pro M1 pro 16GB사용OS: macOS - Sequoia 15.3사용 소프트웨어- Docker Desktop: v4.38.0- Docker: Docker version 27.5.1, build 9f9e405- MySQL 컨테이너: mysql:8.0호스트 머신의 /var/log/mysql 폴더를 만들고 거기다 MySQL 컨테이너에서 발생하는 로그들을 Bind Mount 하려고 했으나 다음과 같은 에러가 발생했었다./var가 아닌 다른 경로로 설정하는 것도 하나의 방법이었고, bind mounts 대신 volume mounts를 쓰는 것도 하나의 방법이었겠지만, 일반적으로 Linux에서 가지고 있는 /var 경로 안에서 폴더를 만들어 ..
서드파티 쿠키(3자 쿠키)를 활용한 트래커 사이트의 추적 방식
·
궁금했던 거
여기서 알아야 할 것은 쿠키 같은 경우 특정 도메인에 대해 요청을 보낼 때, 만약 특정 도메인에 대한 쿠키를 가지고 있는 상태라면 credential 정책에 따라 쿠키를 자동으로 담아서 보낸다.광고 및 트래픽 추적을 대신 해주는 3자 사이트에서 광고 수익 분석 및 트래픽 추적을 3자 쿠키로 하는 방식은 위에서 말한 지식을 응용한 것이다.예시를 들어 설명할 것이다. 원본 사이트가 example.com이고 example.com에서 광고 및 트래픽 추적으로 제 3자 사이트를 통해서 관리하는 일을 tracker.com에 맡겼다고 해보자,tracker.com은 example.com에 대한 고유 번호를 발급함과 동시에 해당 고유 번호에 대한 쿠키를 발급받을 수 있는 스크립트를 example.com의 html에 넣으..