Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2022-07-28 07:26:45
Size: 329
Editor: PieterSmit
Comment:
Revision 4 as of 2022-07-28 11:34:14
Size: 1382
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
   * Only first run, then startup leaves flag '''.user_scripts_initialized'''

   * dirs {{{
export BITNAMI_VOLUME_DIR="/bitnami"
export DB_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/mariadb"
export DB_DATA_DIR="${DB_VOLUME_DIR}/data"
                  #= /bitnami/mariadb/data
}}}
   * *.sql.gz imported with {{{
                *.sql.gz)
                    [[ "$DB_REPLICATION_MODE" = "slave" ]] \
                    && warn "Custom SQL $1db is not supported on slave nodes, ignoring $f" && continue
                    wait_for_mysql_access "$DB_ROOT_USER"
                    # In this case, it is best to pipe the uncompressed SQL commands directly
                    # to the 'mysql' command as extraction may cause problems
                    # e.g. lack of disk space, permission issues...
                    if ! gunzip -c "$f" | mysql_execute_print_output "$DB_DATABASE" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD"; then
                        error "Failed executing $f"
                        return 1
                    fi
}}}

k8s/MariaDbGaleraInitDb

  • Running MariaDb (mysql fork) clusters version (Galera) using helm in Kubernetes, then initializing DB.

  • 2022 - Using the bitnami/Mariadb-galera helm chart to deploy
    • Using startup feature, that looks for db/scripts in "/docker-entrypoint-initdb.d/" and loads then on db creation.

    • Only first run, then startup leaves flag .user_scripts_initialized

    • dirs

      export BITNAMI_VOLUME_DIR="/bitnami"
      export DB_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/mariadb"
      export DB_DATA_DIR="${DB_VOLUME_DIR}/data"
                        #= /bitnami/mariadb/data
    • *.sql.gz imported with

                      *.sql.gz)
                          [[ "$DB_REPLICATION_MODE" = "slave" ]] \
                          && warn "Custom SQL $1db is not supported on slave nodes, ignoring $f" && continue
                          wait_for_mysql_access "$DB_ROOT_USER"
                          # In this case, it is best to pipe the uncompressed SQL commands directly
                          # to the 'mysql' command as extraction may cause problems
                          # e.g. lack of disk space, permission issues...
                          if ! gunzip -c "$f" | mysql_execute_print_output "$DB_DATABASE" "$DB_ROOT_USER" "$DB_ROOT_PASSWORD"; then
                              error "Failed executing $f"
                              return 1
                          fi

k8s/MariaDbGaleraInitDb (last edited 2023-01-24 09:55:24 by PieterSmit)