[MongDB] 인덱스의 expireAfterSeconds 활용으로 collection의 데이터 정리

2025-12-26 KENNETH 0

MongoDB 설정 확인 TTL 모니터 활성화 상태 확인 > db.adminCommand({getParameter: 1, ttlMonitorEnabled: 1}); { “ttlMonitorEnabled” : true, “ok” : 1 } false인 경우 활성화 설정 필요 db.adminCommand({setParameter: 1, ttlMonitorEnabled: true}); DB현황 확인 > show dbs admin            0.000GB monitor     0.948GB local            0.000GB jiraknet        24.964GB > show dbs jiraknet        24.964GB > use jiraknet switched to db jiraknet > db.stats() { “db” : “jiraknet”, “collections” : 6, “views” : 0, “objects” : 56691366, “avgObjSize” : 1156.0611780636932, “dataSize” : 65538687364, “storageSize” : 22406041600, “numExtents” : 0, “indexes” : 22, “indexSize” : 4399296512, “ok” : 1 } db.getCollectionNames() [ “coll_a”, “coll_b”, “coll_c”, “coll_d”, “coll_e”, “coll_f” ] collect의 사용량 확인 명령어는 mongdb 콘솔에서 바로 붙여넣기 가능 var collections = db.getCollectionNames(); var stats = []; collections.forEach(function (n) { var s [ more… ]

[MYSQL] removed Directory(/var/run/mysqld) after server reboot

2023-07-03 KENNETH 0

[MYSQL] removed Directory(/var/run/mysqld) after server reboot   상황 리부팅 후 mysql프로세스가 구동되지 않음 리부팅 전 까지 정상적으로 운영해왔던 상태 수시로 프로세스 재시작을 해왔고 운영하면서 별다른 문제 및 에러메세지가 없었던     ERROR     mysql config     확인 my.cnf 설정에 의해 “/var/run/mysqld” 디렉토리를 사용해야 하지만 디렉토리가 존재하지 않는 문제 디렉토리를 생성해주면 정상적으로 mysql이 구동되지만 리부팅시 “/var/run/mysqld”디렉토리는 삭제되고 없음     해결 리부팅시마다 생성을 해주거나 : 이 경우 귀찮음   설정을 통한 해결     조치를 위한 설정 검토 MySQL 공식 repository 를 이용하여 설치했을 경우 기본 설정 값 mysql-5.7 : /lib/systemd/system/mysql.service   mysql-8.0 : /usr/lib/tmpfiles.d/mysql.conf 본 내용은 “기본 설정 값”일 뿐이며, 참고사항임… (무조건 버전으로 저렇게 해야 함은 아님)      

[MYSQL] NO_PUBKEY error in apt update

2022-05-12 KENNETH 0

환경 OS : Ubuntu 20.04 MYSQL : 8.0.26     발생에러 Err:1 http://repo.mysql.com/apt/ubuntu focal InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 .. .. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Some index files failed to download. They have been ignored, or old ones used instead.     원인 URL : https://docs.oracle.com/cd/E17952_01/mysql-8.0-relnotes-en/news-8-0-28.html#mysqld-8-0-28-packaging https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html The GnuPG build key used to sign MySQL downloadable packages has been updated. The previous GnuPG build key is set to expire on 2022-02-16. [ more… ]

[MYSQL] ‘user’ entry ‘USER@HOSTNAME’ ignored in –skip-name-resolve mode

2022-04-05 KENNETH 0

  에러메세지 [Warning] ‘user’ entry ‘[email protected]’ ignored in –skip-name-resolve mode.     원인 mysql의 skip-name-resolve 옵션에 의해 ‘DNS Lookup’ 과정을 처리하지 않도록 되어있는 상황에서 mysql.user 테이블의 ‘Host’컬럼에 도메인(호스트이름)이 들어갔기 때문에 이는 무시된다는 메세지로서 성능에 영향이 없으며 그냥 두어도 되며 결국 문제는 없는 메세지 즉, 말 그대로 warning 형태의 메세지 이므로 걱정할 필요는 없다     해결 하지만… error-log 에 남는것은 앞으로도 불편한 내용일 수 있으니 처리해서 나쁠것은 없다 단, skip-name-resolve 는 어쩔 수 없이 off 하는 경우가 아님을 전제로 하고 (즉, 사용함) 및 이와 상응하는 방법으로 해결하시면 되겠다      

Failed compile with error “Could not find rpcgen” when configure mysql in centos8(RHEL8)

2019-10-18 KENNETH 0

Failed compile with error “Could not find rpcgen” when configure mysql in centos8(RHEL8)   Error Message : CMake Error at plugin/group_replication/libmysqlgcs/rpcgen.cmake:100 (MESSAGE): Could not find rpcgen Call Stack (most recent call first): plugin/group_replication/libmysqlgcs/CMakeLists.txt:38 (INCLUDE)   원인 : centos8 에는 rpcgen 명령어가 없음 대략적인 관련내용 : https://fedoraproject.org/wiki/Changes/SunRPCRemoval   해결 : rpcgen을 설치하면 된다… 몇가지 방법이 있겠지만…