db 6

Airflow OracleOperator Custom 하기

공식 문서를 기반으로 작성하였다. PostgresHook https://airflow.apache.org/docs/apache-airflow-providers-oracle/stable/_modules/airflow/providers/oracle/hooks/oracle.html#OracleHook DbApi https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/hooks/dbapi.html#DbApiHook.get_first 하단 코드는 아래에 있다. https://github.com/GHGHGHKO/airflow/commit/47de1fd55ff2be812702ba4539adf54e6d9bd292 OracleOperator 사용 할..

Airflow 2022.03.17

Airflow PostgresOperator Custom 하기

공식 문서를 기반으로 작성하였다. PostgresHook https://airflow.apache.org/docs/apache-airflow-providers-postgres/stable/_api/airflow/providers/postgres/hooks/postgres/index.html#airflow.providers.postgres.hooks.postgres.PostgresHook.conn_name_attr DbApi https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/hooks/dbapi.html#DbApiHook.get_first 하단 코드는 아래에 있다. https://github.com/GHGHGHKO/airflow/..

Airflow 2022.03.17

Airflow custom Operator 만들기

공식 문서를 기반으로 글과 코드를 작성하였다. https://airflow.apache.org/docs/apache-airflow/stable/howto/custom-operator.html 코드는 아래에 있다. https://github.com/GHGHGHKO/airflow/commit/37966fd4e8774e04c95f6393fd796b86573d4dc2 예시를 들어서 내용을 적도록 하겠다. 테이블 스페이스가 부족할 때 경고 메일을 보내는 스케줄을 추가하려고 한다. 메일 내용에 특정 테이블 스페이스 이름을 넣은 채로 메일을 보내고 싶은데 --테이블 스페이스 이름 조회 select name from table_space; Airflow에서 제공하는 SQLOperator는 Airflow의 XCOM으로 ..

Airflow 2022.03.16

docker 이미지 생성, docker hub 업로드, docker springboot mysql 연동

application.yml 혹은 application.properties 파일 수정 ​ 우선 local에서 작업한 springboot 프로젝트를 docker 이미지로 뽑아내기 위해 application.yml 혹은 application.properties 파일을 수정해야한다. //application.properties spring.datasource.url=jdbc:mysql://my_mysql:3306/mydatabase?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true application.properties 내용에 위 내용 말고도 다른 내용이 많을 것으로 예상된다. localhost 혹은 127...

Docker 2021.10.22

Docker 설치 mysql 설치 및 실행하기 Ubuntu 18.04

현재 서버에는 mysql 없음 ko@ko-MS-16F1:~$ mysql Command 'mysql' not found, but can be installed with: sudo apt install mysql-client-core-5.7 sudo apt install mariadb-client-core-10.1 설치 시작 ​ ​ Docker 저장소 설정 sudo apt-get update # 패키지 다운로드 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common # Docker GPG 키 추가 sudo curl -fsSL https://download.docker.com/linux..

Docker 2021.10.22

docker mysql Unknown or incorrect time zone : 'Asia/Seoul'

docker mysql에서 time_zone 설정 중 ​ Unknown or incorrect time zone : 'Asia/Seoul' 오류가 나왔다. docker mysql /bin/bash 접속 root@05bcc7dfec1c:/# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql Enter password: Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. Warning..

Docker 2021.10.22