[AWS] LIGHTSAIL DATABASE PARAMETERS

Wave·2023년 6월 23일
0

에러 해결

목록 보기
2/2
post-thumbnail

작성일: 2023-04-26
마지막 수정일: 2023-06-23
작성자: @waveinyu

DB 서버로 라이트세일을 사용하고 있으면 DB config는 모두 라이트세일에서 제어할 수밖에 없다는 걸 알면서 자꾸 까먹는다.

problem

라이트세일의 데이터베이스 서버의 파라미터를 확인하기 위해서는 AWS cli터미널을 이용해야 한다.

// aws-cli lightsail parameters
aws lightsail get-relational-database-parameters

이렇게 명령어를 입력하면

C:\Users\USER>aws lightsail get-relational-database-parameters --relational-database-name 데이터베이스명
{
    "parameters": [
        {
            "allowedValues": "0,1",
            "applyMethod": "pending-reboot",
            "applyType": "dynamic",
            "dataType": "boolean",
            "description": "Automatically set all granted roles as active after the user has authenticated successfully.",
            "isModifiable": true,
            "parameterName": "activate_all_roles_on_login",
            "parameterValue": "0"
        },
.....
        {
            "allowedValues": "0,1",
            "applyMethod": "pending-reboot",
            "applyType": "static",
            "dataType": "boolean",
            "description": "Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist.",
            "isModifiable": false,
            "parameterName": "auto_generate_certs"
-- More  --

이렇게 나온다. 마지막의 -- More --이란. . . 끝없이 엔터를 쳐야 나머지 파라미터가 나온다. 엄청 긴데 그걸 마냥 엔터 쳐서 얻을 수는 없는 일이고, 그렇다고 AWS lightsail의 공식문서에 파라미터 리스트가 있는 것도 아니었다. (일단 엄청 뒤져봤지만 나는 못 찾았음)
그래서 터미널에서 해당 내용을 출력해서 파일로 내보내는 방법은 없을까? 해서 찾아봤는데 다행히도 있었다.

solution

참고 : 커맨드 출력을 파일로 저장(Save the output of a command to a file)

#1. 명령어 뒤에 >filename.txt 붙여주기

aws lightsail get-relational-database-parameters --relational-database-name 데이터베이스명 > lightsail.txt

나는 파일명을 lightsail로 지정했다.


#2. 터미널에서 바로 파일 생성 확인하기

notepad lightsail.txt

새창으로 텍스트 파일이 뜨는 거 확인하면 끝! (근데 진짜 해결해야 할 문제는 아직도 남았다 . . . 쩜쩜)

0개의 댓글