Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
#!/bin/sh

#################################################
#                                               #
#        Configuraton for Playce RoRo           #
#                                               #
#################################################

# Working dir입니다, 아래는 예시로 roro로 지정되어 있습니다
# Working directory for RoRo (Inventory, Assessment, Migration and etc.)
WORKING_DIR=/roro

# DB Connection URL 연결할 데이터데이스 URL을 입력합니다. 아래 예시는 MariaDB 기준으로 작성되었습니다.
DB_URL=jdbc:log4jdbc:mariadb://localhost:3306/roro

# DB Username (데이터베이스 사용자를 입력합니다.)
DB_USERNAME=roro

# DB Password (데이터베이스 패스워드를 입력합니다.)
DB_PASSWORD=password

# Bucket name to save disk images for migration (AWS or GCP)
BUCKET_NAME=

# Bucket region about given bucket name for migration (AWS)
BUCKET_REGION=

if [ e$WORKING_DIR = "e" ] ; then
    echo "[Error] WORKING_DIR must be set."
    exit;
fi

if [ e$DB_USERNAME = "e" ] ; then
    echo "[Error] DB_USERNAME must be set."
    exit;
fi

if [ e$DB_PASSWORD = "e" ] ; then
    echo "[Error] DB_PASSWORD must be set."
    exit;
fi

if [ e$BUCKET_NAME = "e" ] ; then
    echo "[Warning] BUCKET_NAME is empty and migration will be failed."
fi

if [ e$BUCKET_REGION = "e" ] ; then
    echo "[Warning] BUCKET_REGION is empty and migration to AWS will be failed."
fi

# 로그파일 경로(Log file path)
JAVA_OPTS="$JAVA_OPTS -DLOG_PATH=$CATALINA_HOME/logs/"
 
# 파일 인코딩(File encoding)
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dfile.client.encoding=UTF-8"

# 추가 설정(Additional config)
JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx2048m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m"
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseLargePagesInMetaspace"
JAVA_OPTS="$JAVA_OPTS -XX:+ExplicitGCInvokesConcurrent"
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"
JAVA_OPTS="$JAVA_OPTS -XX:ReservedCodeCacheSize=512m"
JAVA_OPTS="$JAVA_OPTS -XX:-UseCodeCacheFlushing"
JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/urandom"
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
JAVA_OPTS="$JAVA_OPTS -Djava.security.properties=$CATALINA_HOME/conf/security/java.security"

# 사전 환경 분석(prerequisite), 평가 수행(assessment), 마이그레이션(migration) 스케줄러 사용여부를 설정합니다.
JAVA_OPTS="$JAVA_OPTS -Denable.prerequisite.schedule=true"
JAVA_OPTS="$JAVA_OPTS -Denable.assessment.schedule=true"
JAVA_OPTS="$JAVA_OPTS -Denable.migration.schedule=true"

# 서버 모니터링 여부 및 주기 설정과 주기적 스캔 여부 및 주기를 설정합니다.
JAVA_OPTS="$JAVA_OPTS -Denable.monitoring.schedule=true"
JAVA_OPTS="$JAVA_OPTS -Denable.scheduled.scan=true"
JAVA_OPTS="$JAVA_OPTS -Dscheduler.schedule.monitoring.cron='0 0 0/3 * * ?'"
JAVA_OPTS="$JAVA_OPTS -Dscheduler.schedule.scheduled-scan.cron='0 0 0 * * ?'"

# 상기 설정한 데이터베이스 정보를 사용하기 위해 설정합니다.
JAVA_OPTS="$JAVA_OPTS -Dspring.datasource.url='$DB_URL'"
JAVA_OPTS="$JAVA_OPTS -Dspring.datasource.username='$DB_USERNAME'"
JAVA_OPTS="$JAVA_OPTS -Dspring.datasource.password='$DB_PASSWORD'"

# RoRo Migration config (마이그레이션 정보를 설정합니다.)
JAVA_OPTS="$JAVA_OPTS -Droro.migration.bucket.name=$BUCKET_NAME"
JAVA_OPTS="$JAVA_OPTS -Droro.migration.bucket.region=$BUCKET_REGION"
JAVA_OPTS="$JAVA_OPTS -Droro.migration.bucket.remove=true"
JAVA_OPTS="$JAVA_OPTS -Droro.migration.include.system.uid=false"

# RoRo working directory & SSH Connection Info
JAVA_OPTS="$JAVA_OPTS -Droro.working.dir-path=$WORKING_DIR"
JAVA_OPTS="$JAVA_OPTS -Droro.ssh.ip-address="
JAVA_OPTS="$JAVA_OPTS -Droro.ssh.port=22"
JAVA_OPTS="$JAVA_OPTS -Droro.ssh.user-name="
JAVA_OPTS="$JAVA_OPTS -Droro.ssh.password="
JAVA_OPTS="$JAVA_OPTS -Droro.ssh.ppk-file-path="

Database와 User 생성

MariaDB 10.6 이상 버전의 설치를 권고합니다.

...