使用dockerfile 构建自己的nacos-mysql

news/2024/5/20 15:12:06/文章来源:https://blog.csdn.net/bj_xuzhiqiang/article/details/134830079

前言

在部署nacos的时候触发的脑袋灵光一闪,每次部署nacos都要部署下mysql服务器,然后导入sql语句,配置nacos配置文件,那有没有简单的方法实现一键部署nacos和nacos-mysql 呢?

答案是肯定!如下目录图:

我用的IDE是 Idea 2023

源码下载地址 :docker-mysql-master

1、编写dockerfile

mysql属于oracle 当然要orcale的镜像喽!

下面代码是官方提供的代码 我们需要稍微的改动一下文件添加下面这句话复制init.sql到

/docker-entrypoint-initdb.d/
COPY init.sql /docker-entrypoint-initdb.d/
/docker-entrypoint-initdb.d/ 解释:

 /docker-entrypoint-initdb.d/ 是一个特殊的目录,用于在 Docker 容器启动时运行 SQL 脚本初始化数据库。任何位于该目录下的文件都会在容器启动时被 Docker 引擎执行。这个目录通常用于初始化数据库或设置默认密码等操作。这个功能是为了一些初始化操作可以在容器启动时自动完成,避免了手动登录容器进行初始化的步骤

FROM oraclelinux:7-slimRUN set -eux; \groupadd --system --gid 999 mysql; \useradd --system --uid 999 --gid 999 --home-dir /var/lib/mysql --no-create-home mysql# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases
ENV GOSU_VERSION 1.16
RUN set -eux; \
# TODO find a better userspace architecture detection method than querying the kernelarch="$(uname -m)"; \case "$arch" in \aarch64) gosuArch='arm64' ;; \x86_64) gosuArch='amd64' ;; \*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \esac; \curl -fL -o /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch.asc"; \curl -fL -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch"; \export GNUPGHOME="$(mktemp -d)"; \gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \chmod +x /usr/local/bin/gosu; \gosu --version; \gosu nobody trueRUN set -eux; \
# https://github.com/docker-library/mysql/pull/871#issuecomment-1167954236yum install -y --setopt=skip_missing_names_on_install=False oracle-epel-release-el7; \yum install -y --setopt=skip_missing_names_on_install=False \bzip2 \gzip \openssl \xz \zstd \; \yum clean allRUN set -eux; \
# https://dev.mysql.com/doc/refman/8.0/en/checking-gpg-signature.html
# gpg: key 3A79BD29: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" importedkey='859BE8D7C586F538430B19C2467B942D3A79BD29'; \export GNUPGHOME="$(mktemp -d)"; \gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \gpg --batch --export --armor "$key" > /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql; \rm -rf "$GNUPGHOME"ENV MYSQL_MAJOR 5.7
ENV MYSQL_VERSION 5.7.44-1.el7RUN set -eu; \. /etc/os-release; \{ \echo '[mysql5.7-server-minimal]'; \echo 'name=MySQL 5.7 Server Minimal'; \echo 'enabled=1'; \echo "baseurl=https://repo.mysql.com/yum/mysql-5.7-community/docker/el/${VERSION_ID%%[.-]*}/\$basearch/"; \echo 'gpgcheck=1'; \echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524echo 'module_hotfixes=true'; \} | tee /etc/yum.repos.d/mysql-community-minimal.repoRUN set -eux; \yum install -y --setopt=skip_missing_names_on_install=False "mysql-community-server-minimal-$MYSQL_VERSION"; \yum clean all; \
# the "socket" value in the Oracle packages is set to "/var/lib/mysql" which isn't a great place for the socket (we want it in "/var/run/mysqld" instead)
# https://github.com/docker-library/mysql/pull/680#issuecomment-636121520grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf; \sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf; \grep -F 'socket=/var/run/mysqld/mysqld.sock' /etc/my.cnf; \{ echo '[client]'; echo 'socket=/var/run/mysqld/mysqld.sock'; } >> /etc/my.cnf; \\
# make sure users dumping files in "/etc/mysql/conf.d" still works! grep -F '!includedir' /etc/my.cnf; \{ echo; echo '!includedir /etc/mysql/conf.d/'; } >> /etc/my.cnf; \mkdir -p /etc/mysql/conf.d; \
# 5.7 Debian-based images also included "/etc/mysql/mysql.conf.d" so let's include it too{ echo '!includedir /etc/mysql/mysql.conf.d/'; } >> /etc/my.cnf; \mkdir -p /etc/mysql/mysql.conf.d; \\
# comment out a few problematic configuration valuesfind /etc/my.cnf /etc/mysql/ -name '*.cnf' -print0 \| xargs -0 grep -lZE '^(bind-address|log)' \| xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/'; \\
# ensure these directories exist and have useful permissions
# the rpm package has different opinions on the mode of `/var/run/mysqld`, so this needs to be after installmkdir -p /var/lib/mysql /var/run/mysqld; \chown mysql:mysql /var/lib/mysql /var/run/mysqld; \
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtimechmod 1777 /var/lib/mysql /var/run/mysqld; \\mkdir /docker-entrypoint-initdb.d; \\mysqld --version; \mysql --versionRUN set -eu; \. /etc/os-release; \{ \echo '[mysql-tools-community]'; \echo 'name=MySQL Tools Community'; \echo "baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/${VERSION_ID%%[.-]*}/\$basearch/"; \echo 'enabled=1'; \echo 'gpgcheck=1'; \echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524echo 'module_hotfixes=true'; \} | tee /etc/yum.repos.d/mysql-community-tools.repo
ENV MYSQL_SHELL_VERSION 8.0.35-1.el7
RUN set -eux; \yum install -y --setopt=skip_missing_names_on_install=False "mysql-shell-$MYSQL_SHELL_VERSION"; \yum clean all; \\mysqlsh --versionVOLUME /var/lib/mysql
COPY init.sql /docker-entrypoint-initdb.d/
COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]EXPOSE 3306 33060
CMD ["mysqld"]

2、编写 docker-entrypoint.sh

直接上代码了

#!/bin/bash
set -eo pipefail
shopt -s nullglob# logging functions
mysql_log() {local type="$1"; shift# accept argument string or stdinlocal text="$*"; if [ "$#" -eq 0 ]; then text="$(cat)"; filocal dt; dt="$(date --rfc-3339=seconds)"printf '%s [%s] [Entrypoint]: %s\n' "$dt" "$type" "$text"
}
mysql_note() {mysql_log Note "$@"
}
mysql_warn() {mysql_log Warn "$@" >&2
}
mysql_error() {mysql_log ERROR "$@" >&2exit 1
}# usage: file_env VAR [DEFAULT]
#    ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
#  "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {local var="$1"local fileVar="${var}_FILE"local def="${2:-}"if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; thenmysql_error "Both $var and $fileVar are set (but are exclusive)"filocal val="$def"if [ "${!var:-}" ]; thenval="${!var}"elif [ "${!fileVar:-}" ]; thenval="$(< "${!fileVar}")"fiexport "$var"="$val"unset "$fileVar"
}# check to see if this file is being run or sourced from another script
_is_sourced() {# https://unix.stackexchange.com/a/215279[ "${#FUNCNAME[@]}" -ge 2 ] \&& [ "${FUNCNAME[0]}" = '_is_sourced' ] \&& [ "${FUNCNAME[1]}" = 'source' ]
}# usage: docker_process_init_files [file [file [...]]]
#    ie: docker_process_init_files /always-initdb.d/*
# process initializer files, based on file extensions
docker_process_init_files() {# mysql here for backwards compatibility "${mysql[@]}"mysql=( docker_process_sql )echolocal ffor f; docase "$f" in*.sh)# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936# https://github.com/docker-library/postgres/pull/452if [ -x "$f" ]; thenmysql_note "$0: running $f""$f"elsemysql_note "$0: sourcing $f". "$f"fi;;*.sql)     mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;;*.sql.bz2) mysql_note "$0: running $f"; bunzip2 -c "$f" | docker_process_sql; echo ;;*.sql.gz)  mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;;*.sql.xz)  mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;;*.sql.zst) mysql_note "$0: running $f"; zstd -dc "$f" | docker_process_sql; echo ;;*)         mysql_warn "$0: ignoring $f" ;;esacechodone
}# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
_verboseHelpArgs=(--verbose --help--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
)mysql_check_config() {local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errorsif ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; thenmysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"fi
}# Fetch value from server config
# We use mysqld --verbose --help instead of my_print_defaults because the
# latter only show values present in config files, and not server defaults
mysql_get_config() {local conf="$1"; shift"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'# match "datadir      /some/path with/spaces in/it here" but not "--xyz=abc\n     datadir (xyz)"
}# Ensure that the package default socket can also be used
# since rpm packages are compiled with a different socket location
# and "mysqlsh --mysql" doesn't read the [client] config
# related to https://github.com/docker-library/mysql/issues/829
mysql_socket_fix() {local defaultSocketdefaultSocket="$(mysql_get_config 'socket' mysqld --no-defaults)"if [ "$defaultSocket" != "$SOCKET" ]; thenln -sfTv "$SOCKET" "$defaultSocket" || :fi
}# Do a temporary startup of the MySQL server, for init purposes
docker_temp_server_start() {if [ "${MYSQL_MAJOR}" = '5.7' ]; then"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" &mysql_note "Waiting for server startup"local ifor i in {30..0}; do# only use the root password if the database has already been initialized# so that it won't try to fill in a password file when it hasn't been set yetextraArgs=()if [ -z "$DATABASE_ALREADY_EXISTS" ]; thenextraArgs+=( '--dont-use-mysql-root-password' )fiif docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; thenbreakfisleep 1doneif [ "$i" = 0 ]; thenmysql_error "Unable to start server."fielse# For 5.7+ the server is ready for use as soon as startup command unblocksif ! "$@" --daemonize --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}"; thenmysql_error "Unable to start server."fifi
}# Stop the server. When using a local socket file mysqladmin will block until
# the shutdown is complete.
docker_temp_server_stop() {if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; thenmysql_error "Unable to shut down server."fi
}# Verify that the minimally required password settings are set for new databases.
docker_verify_minimum_env() {if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; thenmysql_error <<-'EOF'Database is uninitialized and password option is not specifiedYou need to specify one of the following as an environment variable:- MYSQL_ROOT_PASSWORD- MYSQL_ALLOW_EMPTY_PASSWORD- MYSQL_RANDOM_ROOT_PASSWORDEOFfi# This will prevent the CREATE USER from failing (and thus exiting with a half-initialized database)if [ "$MYSQL_USER" = 'root' ]; thenmysql_error <<-'EOF'MYSQL_USER="root", MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root userRemove MYSQL_USER="root" and use one of the following to control the root user password:- MYSQL_ROOT_PASSWORD- MYSQL_ALLOW_EMPTY_PASSWORD- MYSQL_RANDOM_ROOT_PASSWORDEOFfi# warn when missing one of MYSQL_USER or MYSQL_PASSWORDif [ -n "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; thenmysql_warn 'MYSQL_USER specified, but missing MYSQL_PASSWORD; MYSQL_USER will not be created'elif [ -z "$MYSQL_USER" ] && [ -n "$MYSQL_PASSWORD" ]; thenmysql_warn 'MYSQL_PASSWORD specified, but missing MYSQL_USER; MYSQL_PASSWORD will be ignored'fi
}# creates folders for the database
# also ensures permission for user mysql of run as root
docker_create_db_directories() {local user; user="$(id -u)"local -A dirs=( ["$DATADIR"]=1 )local dirdir="$(dirname "$SOCKET")"dirs["$dir"]=1# "datadir" and "socket" are already handled above (since they were already queried previously)local conffor conf in \general-log-file \keyring_file_data \pid-file \secure-file-priv \slow-query-log-file \; dodir="$(mysql_get_config "$conf" "$@")"# skip empty valuesif [ -z "$dir" ] || [ "$dir" = 'NULL' ]; thencontinueficase "$conf" insecure-file-priv)# already points at a directory;;*)# other config options point at a file, but we need the directorydir="$(dirname "$dir")";;esacdirs["$dir"]=1donemkdir -p "${!dirs[@]}"if [ "$user" = "0" ]; then# this will cause less disk access than `chown -R`find "${!dirs[@]}" \! -user mysql -exec chown --no-dereference mysql '{}' +fi
}# initializes the database directory
docker_init_database_dir() {mysql_note "Initializing database files""$@" --initialize-insecure --default-time-zone=SYSTEMmysql_note "Database files initialized"
}# Loads various settings that are used elsewhere in the script
# This should be called after mysql_check_config, but before any other functions
docker_setup_env() {# Get configdeclare -g DATADIR SOCKETDATADIR="$(mysql_get_config 'datadir' "$@")"SOCKET="$(mysql_get_config 'socket' "$@")"# Initialize values that might be stored in a filefile_env 'MYSQL_ROOT_HOST' '%'file_env 'MYSQL_DATABASE'file_env 'MYSQL_USER'file_env 'MYSQL_PASSWORD'file_env 'MYSQL_ROOT_PASSWORD'declare -g DATABASE_ALREADY_EXISTSif [ -d "$DATADIR/mysql" ]; thenDATABASE_ALREADY_EXISTS='true'fi
}# Execute sql script, passed via stdin
# usage: docker_process_sql [--dont-use-mysql-root-password] [mysql-cli-args]
#    ie: docker_process_sql --database=mydb <<<'INSERT ...'
#    ie: docker_process_sql --dont-use-mysql-root-password --database=mydb <my-file.sql
docker_process_sql() {passfileArgs=()if [ '--dont-use-mysql-root-password' = "$1" ]; thenpassfileArgs+=( "$1" )shiftfi# args sent in can override this db, since they will be later in the commandif [ -n "$MYSQL_DATABASE" ]; thenset -- --database="$MYSQL_DATABASE" "$@"fimysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --comments "$@"
}# Initializes database with timezone info and root password, plus optional extra db/user
docker_setup_db() {# Load timezone info into databaseif [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then# sed is for https://bugs.mysql.com/bug.php?id=20545mysql_tzinfo_to_sql /usr/share/zoneinfo \| sed 's/Local time zone must be set--see zic manual page/FCTY/' \| docker_process_sql --dont-use-mysql-root-password --database=mysql# tell docker_process_sql to not use MYSQL_ROOT_PASSWORD since it is not set yetfi# Generate random root passwordif [ -n "$MYSQL_RANDOM_ROOT_PASSWORD" ]; thenMYSQL_ROOT_PASSWORD="$(openssl rand -base64 24)"; export MYSQL_ROOT_PASSWORDmysql_note "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD"fi# Sets root password and creates root users for non-localhost hostslocal rootCreate=# default root to listen for connections from anywhereif [ -n "$MYSQL_ROOT_HOST" ] && [ "$MYSQL_ROOT_HOST" != 'localhost' ]; then# no, we don't care if read finds a terminating character in this heredoc# https://unix.stackexchange.com/questions/265149/why-is-set-o-errexit-breaking-this-read-heredoc-expression/265151#265151read -r -d '' rootCreate <<-EOSQL || trueCREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;EOSQLfilocal passwordSet=# no, we don't care if read finds a terminating character in this heredoc (see above)read -r -d '' passwordSet <<-EOSQL || trueALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;EOSQL# tell docker_process_sql to not use MYSQL_ROOT_PASSWORD since it is just now being setdocker_process_sql --dont-use-mysql-root-password --database=mysql <<-EOSQL-- What's done in this file shouldn't be replicated--  or products like mysql-fabric won't workSET @@SESSION.SQL_LOG_BIN=0;${passwordSet}GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ;FLUSH PRIVILEGES ;${rootCreate}DROP DATABASE IF EXISTS test ;EOSQL# Creates a custom database and user if specifiedif [ -n "$MYSQL_DATABASE" ]; thenmysql_note "Creating database ${MYSQL_DATABASE}"docker_process_sql --database=mysql <<<"CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;"fiif [ -n "$MYSQL_USER" ] && [ -n "$MYSQL_PASSWORD" ]; thenmysql_note "Creating user ${MYSQL_USER}"docker_process_sql --database=mysql <<<"CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;"if [ -n "$MYSQL_DATABASE" ]; thenmysql_note "Giving user ${MYSQL_USER} access to schema ${MYSQL_DATABASE}"docker_process_sql --database=mysql <<<"GRANT ALL ON \`${MYSQL_DATABASE//_/\\_}\`.* TO '$MYSQL_USER'@'%' ;"fifi
}_mysql_passfile() {# echo the password to the "file" the client uses# the client command will use process substitution to create a file on the fly# ie: --defaults-extra-file=<( _mysql_passfile )if [ '--dont-use-mysql-root-password' != "$1" ] && [ -n "$MYSQL_ROOT_PASSWORD" ]; thencat <<-EOF[client]password="${MYSQL_ROOT_PASSWORD}"EOFfi
}# Mark root user as expired so the password must be changed before anything
# else can be done (only supported for 5.6+)
mysql_expire_root_user() {if [ -n "$MYSQL_ONETIME_PASSWORD" ]; thendocker_process_sql --database=mysql <<-EOSQLALTER USER 'root'@'%' PASSWORD EXPIRE;EOSQLfi
}# check arguments for an option that would cause mysqld to stop
# return true if there is one
_mysql_want_help() {local argfor arg; docase "$arg" in-'?'|--help|--print-defaults|-V|--version)return 0;;esacdonereturn 1
}_main() {# if command starts with an option, prepend mysqldif [ "${1:0:1}" = '-' ]; thenset -- mysqld "$@"fi# skip setup if they aren't running mysqld or want an option that stops mysqldif [ "$1" = 'mysqld' ] && ! _mysql_want_help "$@"; thenmysql_note "Entrypoint script for MySQL Server ${MYSQL_VERSION} started."mysql_check_config "$@"# Load various environment variablesdocker_setup_env "$@"docker_create_db_directories "$@"# If container is started as root user, restart as dedicated mysql userif [ "$(id -u)" = "0" ]; thenmysql_note "Switching to dedicated user 'mysql'"exec gosu mysql "$BASH_SOURCE" "$@"fi# there's no database, so it needs to be initializedif [ -z "$DATABASE_ALREADY_EXISTS" ]; thendocker_verify_minimum_env# check dir permissions to reduce likelihood of half-initialized databasels /docker-entrypoint-initdb.d/ > /dev/nulldocker_init_database_dir "$@"mysql_note "Starting temporary server"docker_temp_server_start "$@"mysql_note "Temporary server started."mysql_socket_fixdocker_setup_dbdocker_process_init_files /docker-entrypoint-initdb.d/*mysql_expire_root_usermysql_note "Stopping temporary server"docker_temp_server_stopmysql_note "Temporary server stopped"echomysql_note "MySQL init process done. Ready for start up."echoelsemysql_socket_fixfifiexec "$@"
}# If we are sourced from elsewhere, don't perform any further actions
if ! _is_sourced; then_main "$@"
fi

3、编写-init.sql-Nacos

/** Copyright 1999-2018 Alibaba Group Holding Ltd.** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**      http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*//******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info   */
/******************************************/
CREATE TABLE `config_info` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',`data_id` varchar(255) NOT NULL COMMENT 'data_id',`group_id` varchar(128) DEFAULT NULL,`content` longtext NOT NULL COMMENT 'content',`md5` varchar(32) DEFAULT NULL COMMENT 'md5',`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',`src_user` text COMMENT 'source user',`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',`app_name` varchar(128) DEFAULT NULL,`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',`c_desc` varchar(256) DEFAULT NULL,`c_use` varchar(64) DEFAULT NULL,`effect` varchar(64) DEFAULT NULL,`type` varchar(64) DEFAULT NULL,`c_schema` text,`encrypted_data_key` text NOT NULL COMMENT '秘钥',PRIMARY KEY (`id`),UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_aggr   */
/******************************************/
CREATE TABLE `config_info_aggr` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',`data_id` varchar(255) NOT NULL COMMENT 'data_id',`group_id` varchar(128) NOT NULL COMMENT 'group_id',`datum_id` varchar(255) NOT NULL COMMENT 'datum_id',`content` longtext NOT NULL COMMENT '内容',`gmt_modified` datetime NOT NULL COMMENT '修改时间',`app_name` varchar(128) DEFAULT NULL,`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',PRIMARY KEY (`id`),UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_beta   */
/******************************************/
CREATE TABLE `config_info_beta` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',`data_id` varchar(255) NOT NULL COMMENT 'data_id',`group_id` varchar(128) NOT NULL COMMENT 'group_id',`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',`content` longtext NOT NULL COMMENT 'content',`beta_ips` varchar(1024) DEFAULT NULL COMMENT 'betaIps',`md5` varchar(32) DEFAULT NULL COMMENT 'md5',`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',`src_user` text COMMENT 'source user',`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',`encrypted_data_key` text NOT NULL COMMENT '秘钥',PRIMARY KEY (`id`),UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_tag   */
/******************************************/
CREATE TABLE `config_info_tag` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',`data_id` varchar(255) NOT NULL COMMENT 'data_id',`group_id` varchar(128) NOT NULL COMMENT 'group_id',`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',`tag_id` varchar(128) NOT NULL COMMENT 'tag_id',`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',`content` longtext NOT NULL COMMENT 'content',`md5` varchar(32) DEFAULT NULL COMMENT 'md5',`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',`src_user` text COMMENT 'source user',`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',PRIMARY KEY (`id`),UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_tags_relation   */
/******************************************/
CREATE TABLE `config_tags_relation` (`id` bigint(20) NOT NULL COMMENT 'id',`tag_name` varchar(128) NOT NULL COMMENT 'tag_name',`tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type',`data_id` varchar(255) NOT NULL COMMENT 'data_id',`group_id` varchar(128) NOT NULL COMMENT 'group_id',`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',`nid` bigint(20) NOT NULL AUTO_INCREMENT,PRIMARY KEY (`nid`),UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = group_capacity   */
/******************************************/
CREATE TABLE `group_capacity` (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',`group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',PRIMARY KEY (`id`),UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = his_config_info   */
/******************************************/
CREATE TABLE `his_config_info` (`id` bigint(20) unsigned NOT NULL,`nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,`data_id` varchar(255) NOT NULL,`group_id` varchar(128) NOT NULL,`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',`content` longtext NOT NULL,`md5` varchar(32) DEFAULT NULL,`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,`src_user` text,`src_ip` varchar(50) DEFAULT NULL,`op_type` char(10) DEFAULT NULL,`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',`encrypted_data_key` text NOT NULL COMMENT '秘钥',PRIMARY KEY (`nid`),KEY `idx_gmt_create` (`gmt_create`),KEY `idx_gmt_modified` (`gmt_modified`),KEY `idx_did` (`data_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = tenant_capacity   */
/******************************************/
CREATE TABLE `tenant_capacity` (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',`tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID',`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',PRIMARY KEY (`id`),UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';CREATE TABLE `tenant_info` (`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',`kp` varchar(128) NOT NULL COMMENT 'kp',`tenant_id` varchar(128) default '' COMMENT 'tenant_id',`tenant_name` varchar(128) default '' COMMENT 'tenant_name',`tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc',`create_source` varchar(32) DEFAULT NULL COMMENT 'create_source',`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',PRIMARY KEY (`id`),UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';CREATE TABLE `users` (`username` varchar(50) NOT NULL PRIMARY KEY,`password` varchar(500) NOT NULL,`enabled` boolean NOT NULL
);CREATE TABLE `roles` (`username` varchar(50) NOT NULL,`role` varchar(50) NOT NULL,UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
);CREATE TABLE `permissions` (`role` varchar(50) NOT NULL,`resource` varchar(255) NOT NULL,`action` varchar(8) NOT NULL,UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
);INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');

4、Docker Image Mysql环境变量设置

| 变量名                 | 变量值          | 说明           |
|---------------------|--------------|--------------|
| MYSQL_ROOT_PASSWORD | 123qwe##     | mysql root密码 |
| MYSQL_DATABASE      | nacos_config | mysql数据库名    |
| MYSQL_USER          | nacos        | mysql用户名     |
| MYSQL_PASSWORD      | 123qwe##     | mysql用户密码    |
| MYSQL_HOST          | %            | 指定mysql地址    |

5、Docker 容器配置

6、生成自己的Nacos-mysql 镜像。

6.1构建日志

Deploying 'nacos-mysql Dockerfile: yc-nacos-mysql/dockerfile'…
Building image…
Preparing build context archive…
[==================================================>]5/5 files
DoneSending build context to Docker daemon…
[==================================================>] 20.40kB
DoneStep 1/20 : FROM oraclelinux:7-slim---> 506c06ed74d4
Step 2/20 : RUN set -eux;       groupadd --system --gid 999 mysql;      useradd --system --uid 999 --gid 999 --home-dir /var/lib/mysql --no-create-home mysql---> Using cache---> 149cb7eee42f
Step 3/20 : ENV GOSU_VERSION 1.16---> Using cache---> d5327d11c477
Step 4/20 : RUN set -eux;       arch="$(uname -m)";     case "$arch" in                 aarch64) gosuArch='arm64' ;;            x86_64) gosuArch='amd64' ;;    *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;;        esac;   curl -fL -o /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch.asc";        curl -fL -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$gosuArch";        export GNUPGHOME="$(mktemp -d)";        gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4;   gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu;       rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc;    chmod +x /usr/local/bin/gosu;   gosu --version; gosu nobody true---> Using cache---> 7a10e99cd095
Step 5/20 : RUN set -eux;       yum install -y --setopt=skip_missing_names_on_install=False oracle-epel-release-el7;    yum install -y --setopt=skip_missing_names_on_install=False             bzip2           gzip            openssl                 xz              zstd    ;       yum clean all---> Using cache---> 352cd65d9fdb
Step 6/20 : RUN set -eux;       key='859BE8D7C586F538430B19C2467B942D3A79BD29';         export GNUPGHOME="$(mktemp -d)";        gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key";        gpg --batch --export --armor "$key" > /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql;       rm -rf "$GNUPGHOME"---> Using cache---> 5fed7d6e6085
Step 7/20 : ENV MYSQL_MAJOR 5.7---> Using cache---> 4cd6aac4a517
Step 8/20 : ENV MYSQL_VERSION 5.7.44-1.el7---> Using cache---> d90fb55e1207
Step 9/20 : RUN set -eu;        . /etc/os-release;      {               echo '[mysql5.7-server-minimal]';               echo 'name=MySQL 5.7 Server Minimal';  echo 'enabled=1';                echo "baseurl=https://repo.mysql.com/yum/mysql-5.7-community/docker/el/${VERSION_ID%%[.-]*}/\$basearch/";               echo 'gpgcheck=1';              echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql';                echo 'module_hotfixes=true';    } | tee /etc/yum.repos.d/mysql-community-minimal.repo---> Using cache---> 44966cebfd61
Step 10/20 : RUN set -eux;      yum install -y --setopt=skip_missing_names_on_install=False "mysql-community-server-minimal-$MYSQL_VERSION";    yum clean all; grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf;  sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf;  grep -F 'socket=/var/run/mysqld/mysqld.sock' /etc/my.cnf;       { echo '[client]'; echo 'socket=/var/run/mysqld/mysqld.sock'; } >> /etc/my.cnf;                 ! grep -F '!includedir' /etc/my.cnf;    { echo; echo '!includedir /etc/mysql/conf.d/'; } >> /etc/my.cnf;        mkdir -p /etc/mysql/conf.d;     { echo '!includedir /etc/mysql/mysql.conf.d/'; } >> /etc/my.cnf;        mkdir -p /etc/mysql/mysql.conf.d;               find /etc/my.cnf /etc/mysql/ -name '*.cnf' -print0              | xargs -0 grep -lZE '^(bind-address|log)'              | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/';             mkdir -p /var/lib/mysql /var/run/mysqld;        chown mysql:mysql /var/lib/mysql /var/run/mysqld;       chmod 1777 /var/lib/mysql /var/run/mysqld;              mkdir /docker-entrypoint-initdb.d;              mysqld --version;       mysql --version---> Using cache---> c37be0578163
Step 11/20 : RUN set -eu;       . /etc/os-release;      {               echo '[mysql-tools-community]';                 echo 'name=MySQL Tools Community';     echo "baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/${VERSION_ID%%[.-]*}/\$basearch/";             echo 'enabled=1';               echo 'gpgcheck=1';              echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql';                echo 'module_hotfixes=true';    } | tee /etc/yum.repos.d/mysql-community-tools.repo---> Using cache---> ae4e17896b0f
Step 12/20 : ENV MYSQL_SHELL_VERSION 8.0.35-1.el7---> Using cache---> 18872e904b82
Step 13/20 : RUN set -eux;      yum install -y --setopt=skip_missing_names_on_install=False "mysql-shell-$MYSQL_SHELL_VERSION";         yum clean all;         mysqlsh --version---> Using cache---> b6e1f947709b
Step 14/20 : VOLUME /var/lib/mysql---> Using cache---> 65bbe7d888a0
Step 15/20 : COPY init.sql /docker-entrypoint-initdb.d/---> Using cache---> 8fad45952ad1
Step 16/20 : COPY docker-entrypoint.sh /usr/local/bin/---> Using cache---> 05b7fd188a49
Step 17/20 : RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat---> Using cache---> dc870e8a34f6
Step 18/20 : ENTRYPOINT ["docker-entrypoint.sh"]---> Using cache---> 2b3914887fbc
Step 19/20 : EXPOSE 3306 33060---> Using cache---> 47f937fa6071
Step 20/20 : CMD ["mysqld"]---> Using cache---> 57b9eff3e8c9Successfully built 57b9eff3e8c9
Successfully tagged nacos-mysql:latest
Creating container…
Container Id: dd10d3c555977a800d684247bbf2fde7aedc1ca8fc466f12eb8623633a0a9c98
Container name: 'nacos-mysql'
Starting container 'nacos-mysql'
'nacos-mysql Dockerfile: yc-nacos-mysql/dockerfile' has been deployed successfully.

6.2容器启动日志

2023-12-06T05:45:59.858850844Z 2023-12-06 05:45:59+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started.
2023-12-06T05:46:00.013146971Z 2023-12-06 05:46:00+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-12-06T05:46:00.019866125Z 2023-12-06 05:46:00+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started.
2023-12-06T05:46:00.126593631Z 2023-12-06 05:46:00+00:00 [Note] [Entrypoint]: Initializing database files
2023-12-06T05:46:00.135671104Z 2023-12-06T05:46:00.133897Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-06T05:46:00.260745583Z 2023-12-06T05:46:00.260279Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-12-06T05:46:00.294105943Z 2023-12-06T05:46:00.293695Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-12-06T05:46:00.356578609Z 2023-12-06T05:46:00.355176Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: bc31cd01-93fa-11ee-89cc-0242ac110002.
2023-12-06T05:46:00.362412649Z 2023-12-06T05:46:00.361790Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-12-06T05:46:00.419515051Z 2023-12-06T05:46:00.419178Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:00.419568578Z 2023-12-06T05:46:00.419217Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:00.419804886Z 2023-12-06T05:46:00.419534Z 0 [Warning] CA certificate ca.pem is self signed.
2023-12-06T05:46:00.451283525Z 2023-12-06T05:46:00.450838Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2023-12-06T05:46:03.297442118Z 2023-12-06 05:46:03+00:00 [Note] [Entrypoint]: Database files initialized
2023-12-06T05:46:03.298176479Z 2023-12-06 05:46:03+00:00 [Note] [Entrypoint]: Starting temporary server
2023-12-06T05:46:03.299256255Z 2023-12-06 05:46:03+00:00 [Note] [Entrypoint]: Waiting for server startup
2023-12-06T05:46:03.462935561Z 2023-12-06T05:46:03.459918Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-06T05:46:03.462985482Z 2023-12-06T05:46:03.460960Z 0 [Note] mysqld (mysqld 5.7.44) starting as process 125 ...
2023-12-06T05:46:03.463528586Z 2023-12-06T05:46:03.463191Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-12-06T05:46:03.463551208Z 2023-12-06T05:46:03.463271Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-12-06T05:46:03.463553575Z 2023-12-06T05:46:03.463323Z 0 [Note] InnoDB: Uses event mutexes
2023-12-06T05:46:03.463555104Z 2023-12-06T05:46:03.463328Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-12-06T05:46:03.463556403Z 2023-12-06T05:46:03.463330Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-12-06T05:46:03.463557670Z 2023-12-06T05:46:03.463333Z 0 [Note] InnoDB: Using Linux native AIO
2023-12-06T05:46:03.464065857Z 2023-12-06T05:46:03.463869Z 0 [Note] InnoDB: Number of pools: 1
2023-12-06T05:46:03.464794894Z 2023-12-06T05:46:03.464571Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-12-06T05:46:03.466197499Z 2023-12-06T05:46:03.465994Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-12-06T05:46:03.470714277Z 2023-12-06T05:46:03.470473Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-06T05:46:03.472201823Z 2023-12-06T05:46:03.471995Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-12-06T05:46:03.483721101Z 2023-12-06T05:46:03.483319Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-12-06T05:46:03.491312845Z 2023-12-06T05:46:03.490953Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-06T05:46:03.491365104Z 2023-12-06T05:46:03.491031Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-06T05:46:03.502096902Z 2023-12-06T05:46:03.501684Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-06T05:46:03.502374854Z 2023-12-06T05:46:03.502086Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-12-06T05:46:03.502388281Z 2023-12-06T05:46:03.502106Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-12-06T05:46:03.503470624Z 2023-12-06T05:46:03.503297Z 0 [Note] InnoDB: 5.7.44 started; log sequence number 2768291
2023-12-06T05:46:03.504242888Z 2023-12-06T05:46:03.503949Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-12-06T05:46:03.504285805Z 2023-12-06T05:46:03.504094Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-12-06T05:46:03.505556081Z 2023-12-06T05:46:03.505181Z 0 [Note] InnoDB: Buffer pool(s) load completed at 231206  5:46:03
2023-12-06T05:46:03.508863825Z 2023-12-06T05:46:03.508512Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-12-06T05:46:03.508892191Z 2023-12-06T05:46:03.508550Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-12-06T05:46:03.508895897Z 2023-12-06T05:46:03.508553Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:03.508898452Z 2023-12-06T05:46:03.508555Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:03.509275328Z 2023-12-06T05:46:03.509045Z 0 [Warning] CA certificate ca.pem is self signed.
2023-12-06T05:46:03.509308392Z 2023-12-06T05:46:03.509110Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-12-06T05:46:03.512940944Z 2023-12-06T05:46:03.512660Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2023-12-06T05:46:03.516970335Z 2023-12-06T05:46:03.516502Z 0 [Note] Event Scheduler: Loaded 0 events
2023-12-06T05:46:03.517159352Z 2023-12-06T05:46:03.516908Z 0 [Note] mysqld: ready for connections.
2023-12-06T05:46:03.517165340Z Version: '5.7.44'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
2023-12-06T05:46:04.313414008Z 2023-12-06 05:46:04+00:00 [Note] [Entrypoint]: Temporary server started.
2023-12-06T05:46:04.327188808Z '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-12-06T05:46:04.334307518Z 2023-12-06T05:46:04.333900Z 3 [Note] InnoDB: Stopping purge
2023-12-06T05:46:04.339950351Z 2023-12-06T05:46:04.339762Z 3 [Note] InnoDB: Resuming purge
2023-12-06T05:46:04.341347902Z 2023-12-06T05:46:04.341141Z 3 [Note] InnoDB: Stopping purge
2023-12-06T05:46:04.344824986Z 2023-12-06T05:46:04.344560Z 3 [Note] InnoDB: Resuming purge
2023-12-06T05:46:04.347857179Z 2023-12-06T05:46:04.347609Z 3 [Note] InnoDB: Stopping purge
2023-12-06T05:46:04.352620331Z 2023-12-06T05:46:04.352344Z 3 [Note] InnoDB: Resuming purge
2023-12-06T05:46:04.353773905Z 2023-12-06T05:46:04.353578Z 3 [Note] InnoDB: Stopping purge
2023-12-06T05:46:04.358259937Z 2023-12-06T05:46:04.358037Z 3 [Note] InnoDB: Resuming purge
2023-12-06T05:46:04.839703139Z Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
2023-12-06T05:46:04.839729029Z Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
2023-12-06T05:46:05.732274102Z Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
2023-12-06T05:46:05.732316028Z Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
2023-12-06T05:46:05.732318519Z Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2023-12-06T05:46:05.784854385Z 2023-12-06 05:46:05+00:00 [Note] [Entrypoint]: Creating database nacos_config
2023-12-06T05:46:05.790153334Z 2023-12-06 05:46:05+00:00 [Note] [Entrypoint]: Creating user nacos
2023-12-06T05:46:05.796019216Z 2023-12-06 05:46:05+00:00 [Note] [Entrypoint]: Giving user nacos access to schema nacos_config
2023-12-06T05:46:05.800292086Z 
2023-12-06T05:46:05.800816923Z 2023-12-06 05:46:05+00:00 [Note] [Entrypoint]: /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init.sql
2023-12-06T05:46:06.141703007Z 
2023-12-06T05:46:06.141759931Z 
2023-12-06T05:46:06.142746681Z 2023-12-06 05:46:06+00:00 [Note] [Entrypoint]: Stopping temporary server
2023-12-06T05:46:06.147604797Z 2023-12-06T05:46:06.147171Z 0 [Note] Giving 0 client threads a chance to die gracefully
2023-12-06T05:46:06.147625861Z 2023-12-06T05:46:06.147219Z 0 [Note] Shutting down slave threads
2023-12-06T05:46:06.147627525Z 2023-12-06T05:46:06.147225Z 0 [Note] Forcefully disconnecting 0 remaining clients
2023-12-06T05:46:06.147628812Z 2023-12-06T05:46:06.147291Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2023-12-06T05:46:06.147639845Z 2023-12-06T05:46:06.147344Z 0 [Note] Binlog end
2023-12-06T05:46:06.148341755Z 2023-12-06T05:46:06.148124Z 0 [Note] Shutting down plugin 'ngram'
2023-12-06T05:46:06.148349018Z 2023-12-06T05:46:06.148145Z 0 [Note] Shutting down plugin 'partition'
2023-12-06T05:46:06.148350578Z 2023-12-06T05:46:06.148148Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2023-12-06T05:46:06.148351830Z 2023-12-06T05:46:06.148150Z 0 [Note] Shutting down plugin 'ARCHIVE'
2023-12-06T05:46:06.148353114Z 2023-12-06T05:46:06.148176Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2023-12-06T05:46:06.148354355Z 2023-12-06T05:46:06.148194Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2023-12-06T05:46:06.148355563Z 2023-12-06T05:46:06.148206Z 0 [Note] Shutting down plugin 'MyISAM'
2023-12-06T05:46:06.148356767Z 2023-12-06T05:46:06.148212Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2023-12-06T05:46:06.148358000Z 2023-12-06T05:46:06.148214Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2023-12-06T05:46:06.148359261Z 2023-12-06T05:46:06.148216Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2023-12-06T05:46:06.148360503Z 2023-12-06T05:46:06.148216Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2023-12-06T05:46:06.148361722Z 2023-12-06T05:46:06.148217Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2023-12-06T05:46:06.148362944Z 2023-12-06T05:46:06.148229Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2023-12-06T05:46:06.148364164Z 2023-12-06T05:46:06.148230Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2023-12-06T05:46:06.148365364Z 2023-12-06T05:46:06.148232Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2023-12-06T05:46:06.148366568Z 2023-12-06T05:46:06.148233Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2023-12-06T05:46:06.148367786Z 2023-12-06T05:46:06.148234Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2023-12-06T05:46:06.148368984Z 2023-12-06T05:46:06.148236Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2023-12-06T05:46:06.148370209Z 2023-12-06T05:46:06.148237Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2023-12-06T05:46:06.148371418Z 2023-12-06T05:46:06.148238Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2023-12-06T05:46:06.148372614Z 2023-12-06T05:46:06.148239Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2023-12-06T05:46:06.148373865Z 2023-12-06T05:46:06.148239Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2023-12-06T05:46:06.148375060Z 2023-12-06T05:46:06.148240Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2023-12-06T05:46:06.148376342Z 2023-12-06T05:46:06.148242Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2023-12-06T05:46:06.148377578Z 2023-12-06T05:46:06.148243Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2023-12-06T05:46:06.148379075Z 2023-12-06T05:46:06.148245Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2023-12-06T05:46:06.148384367Z 2023-12-06T05:46:06.148246Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2023-12-06T05:46:06.148385623Z 2023-12-06T05:46:06.148256Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2023-12-06T05:46:06.148386824Z 2023-12-06T05:46:06.148258Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2023-12-06T05:46:06.148388026Z 2023-12-06T05:46:06.148259Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2023-12-06T05:46:06.148398675Z 2023-12-06T05:46:06.148261Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2023-12-06T05:46:06.148400306Z 2023-12-06T05:46:06.148262Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2023-12-06T05:46:06.148401569Z 2023-12-06T05:46:06.148264Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2023-12-06T05:46:06.148402942Z 2023-12-06T05:46:06.148265Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2023-12-06T05:46:06.148404333Z 2023-12-06T05:46:06.148266Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2023-12-06T05:46:06.148405692Z 2023-12-06T05:46:06.148267Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2023-12-06T05:46:06.148406897Z 2023-12-06T05:46:06.148268Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2023-12-06T05:46:06.148408134Z 2023-12-06T05:46:06.148271Z 0 [Note] Shutting down plugin 'InnoDB'
2023-12-06T05:46:06.148491909Z 2023-12-06T05:46:06.148332Z 0 [Note] InnoDB: FTS optimize thread exiting.
2023-12-06T05:46:06.148591762Z 2023-12-06T05:46:06.148494Z 0 [Note] InnoDB: Starting shutdown...
2023-12-06T05:46:06.249703464Z 2023-12-06T05:46:06.248839Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2023-12-06T05:46:06.249991716Z 2023-12-06T05:46:06.249604Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 231206  5:46:06
2023-12-06T05:46:07.475307343Z 2023-12-06T05:46:07.474510Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12476314
2023-12-06T05:46:07.478384761Z 2023-12-06T05:46:07.477242Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-12-06T05:46:07.478424799Z 2023-12-06T05:46:07.477340Z 0 [Note] Shutting down plugin 'MEMORY'
2023-12-06T05:46:07.478431159Z 2023-12-06T05:46:07.477350Z 0 [Note] Shutting down plugin 'CSV'
2023-12-06T05:46:07.478436486Z 2023-12-06T05:46:07.477358Z 0 [Note] Shutting down plugin 'sha256_password'
2023-12-06T05:46:07.478440418Z 2023-12-06T05:46:07.477362Z 0 [Note] Shutting down plugin 'mysql_native_password'
2023-12-06T05:46:07.478444386Z 2023-12-06T05:46:07.477569Z 0 [Note] Shutting down plugin 'binlog'
2023-12-06T05:46:07.479056032Z 2023-12-06T05:46:07.478513Z 0 [Note] mysqld: Shutdown complete
2023-12-06T05:46:07.479098691Z 
2023-12-06T05:46:08.149822396Z 2023-12-06 05:46:08+00:00 [Note] [Entrypoint]: Temporary server stopped
2023-12-06T05:46:08.149942269Z 
2023-12-06T05:46:08.150975998Z 2023-12-06 05:46:08+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
2023-12-06T05:46:08.151025512Z 
2023-12-06T05:46:08.306771184Z 2023-12-06T05:46:08.304462Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-06T05:46:08.306795634Z 2023-12-06T05:46:08.305102Z 0 [Note] mysqld (mysqld 5.7.44) starting as process 1 ...
2023-12-06T05:46:08.307460424Z 2023-12-06T05:46:08.307064Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-12-06T05:46:08.307494374Z 2023-12-06T05:46:08.307095Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-12-06T05:46:08.307496191Z 2023-12-06T05:46:08.307098Z 0 [Note] InnoDB: Uses event mutexes
2023-12-06T05:46:08.307497487Z 2023-12-06T05:46:08.307100Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-12-06T05:46:08.307498810Z 2023-12-06T05:46:08.307101Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-12-06T05:46:08.307500146Z 2023-12-06T05:46:08.307103Z 0 [Note] InnoDB: Using Linux native AIO
2023-12-06T05:46:08.307644310Z 2023-12-06T05:46:08.307452Z 0 [Note] InnoDB: Number of pools: 1
2023-12-06T05:46:08.308006677Z 2023-12-06T05:46:08.307771Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-12-06T05:46:08.309168963Z 2023-12-06T05:46:08.308977Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-12-06T05:46:08.313089162Z 2023-12-06T05:46:08.312783Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-12-06T05:46:08.314296278Z 2023-12-06T05:46:08.314057Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-12-06T05:46:08.326071975Z 2023-12-06T05:46:08.325497Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-12-06T05:46:08.334465415Z 2023-12-06T05:46:08.333945Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-12-06T05:46:08.334504016Z 2023-12-06T05:46:08.334013Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-06T05:46:08.343097479Z 2023-12-06T05:46:08.342809Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-12-06T05:46:08.343683775Z 2023-12-06T05:46:08.343449Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-12-06T05:46:08.343707120Z 2023-12-06T05:46:08.343560Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-12-06T05:46:08.345640054Z 2023-12-06T05:46:08.345320Z 0 [Note] InnoDB: Waiting for purge to start
2023-12-06T05:46:08.396397571Z 2023-12-06T05:46:08.395760Z 0 [Note] InnoDB: 5.7.44 started; log sequence number 12476314
2023-12-06T05:46:08.397269613Z 2023-12-06T05:46:08.396535Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-12-06T05:46:08.397307560Z 2023-12-06T05:46:08.396668Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-12-06T05:46:08.401581557Z 2023-12-06T05:46:08.400882Z 0 [Note] InnoDB: Buffer pool(s) load completed at 231206  5:46:08
2023-12-06T05:46:08.403199282Z 2023-12-06T05:46:08.402828Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-12-06T05:46:08.403233531Z 2023-12-06T05:46:08.402860Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-12-06T05:46:08.403238522Z 2023-12-06T05:46:08.402864Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:08.403242024Z 2023-12-06T05:46:08.402866Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-12-06T05:46:08.403523965Z 2023-12-06T05:46:08.403229Z 0 [Warning] CA certificate ca.pem is self signed.
2023-12-06T05:46:08.403540814Z 2023-12-06T05:46:08.403267Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-12-06T05:46:08.403623567Z 2023-12-06T05:46:08.403447Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2023-12-06T05:46:08.403642134Z 2023-12-06T05:46:08.403480Z 0 [Note] IPv6 is available.
2023-12-06T05:46:08.403643883Z 2023-12-06T05:46:08.403489Z 0 [Note]   - '::' resolves to '::';
2023-12-06T05:46:08.403645181Z 2023-12-06T05:46:08.403500Z 0 [Note] Server socket created on IP: '::'.
2023-12-06T05:46:08.407799245Z 2023-12-06T05:46:08.407440Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2023-12-06T05:46:08.416167563Z 2023-12-06T05:46:08.415873Z 0 [Note] Event Scheduler: Loaded 0 events
2023-12-06T05:46:08.416560119Z 2023-12-06T05:46:08.416227Z 0 [Note] mysqld: ready for connections.
2023-12-06T05:46:08.416630935Z Version: '5.7.44'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_191140.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Navicat 技术指引 | 适用于 GaussDB 分布式的用户/权限功能

Navicat Premium&#xff08;16.3.3 Windows 版或以上&#xff09;正式支持 GaussDB 分布式数据库。GaussDB 分布式模式更适合对系统可用性和数据处理能力要求较高的场景。Navicat 工具不仅提供可视化数据查看和编辑功能&#xff0c;还提供强大的高阶功能&#xff08;如模型、结…

Navicat 技术指引 | 适用于 GaussDB 分布式的查询功能

Navicat Premium&#xff08;16.3.3 Windows 版或以上&#xff09;正式支持 GaussDB 分布式数据库。GaussDB 分布式模式更适合对系统可用性和数据处理能力要求较高的场景。Navicat 工具不仅提供可视化数据查看和编辑功能&#xff0c;还提供强大的高阶功能&#xff08;如模型、结…

Android 等待view 加载布局完成 (包括动态生成View)

前言 在实际开发中&#xff0c;有很多组件需要 根据数据&#xff0c;动态生成&#xff0c;或者 追加 / 减少 子view&#xff0c;由于View布局需要时间&#xff0c;此时想要获取父View的最新宽高值&#xff0c;要么手动测量&#xff0c;要么等待布局完成后再获取&#xff1b; …

使用 Axios 进行网络请求的全面指南

使用 Axios 进行网络请求的全面指南 本文将向您介绍如何使用 Axios 进行网络请求。通过分步指南和示例代码&#xff0c;您将学习如何使用 Axios 库在前端应用程序中发送 GET、POST、PUT 和 DELETE 请求&#xff0c;并处理响应数据和错误。 准备工作 在开始之前&#xff0c;请…

Navicat 技术指引 | 连接 GaussDB 分布式

Navicat Premium&#xff08;16.3.3 Windows 版或以上&#xff09;正式支持 GaussDB 分布式数据库。GaussDB 分布式模式更适合对系统可用性和数据处理能力要求较高的场景。Navicat 工具不仅提供可视化数据查看和编辑功能&#xff0c;还提供强大的高阶功能&#xff08;如模型、结…

【每日一题】下一个更大的数值平衡数

Tag 【模拟】【取模运算】 题目来源 2048. 下一个更大的数值平衡数 解题思路 方法一&#xff1a;模拟 思路 观察到数据量 0 < n < 1 0 6 0< n <10^6 0<n<106&#xff0c;我们可能返回的数值平衡数最大是 1224444&#xff0c;这个范围可以在时间要求内…

高效的多维空间点索引算法——GeoHash

一、Geohash 算法简介 GeoHash是空间索引的一种方式&#xff0c;其基本原理是将地球理解为一个二维平面&#xff0c;通过把二维的空间经纬度数据编码为一个字符串&#xff0c;可以把平面递归分解成更小的子块&#xff0c;每个子块在一定经纬度范围内拥有相同的编码。以GeoHash方…

多人聊天Java

服务端 import java.io.*; import java.net.*; import java.util.ArrayList; public class Server{ public static ServerSocket server_socket; public static ArrayList<Socket> socketListnew ArrayList<Socket>(); public static void main(String []ar…

将单体应用程序迁移到微服务

多年来&#xff0c;我处理过多个单体应用&#xff0c;并将其中一些迁移到了微服务架构。我打算写下我所学到的东西以及我从经验中用到的策略&#xff0c;以实现成功的迁移。在这篇文章中&#xff0c;我将以AWS为例&#xff0c;但基本原则保持不变&#xff0c;可用于任何类型的基…

web前端之css变量的妙用、通过JavaScrip改变css文件中的属性值、querySelector、setProperty

MENU 效果图htmlJavaScripstylequerySelectorsetProperty 效果图 html <div id"idBox" class"p_r w_680 h_160 b_1s_red"><div id"idItem" class"p_a l_0 t_30 w_100 h_100 bc_rgba_255_00_05 radius_50_"></div> …

智慧安防三大信息技术:云计算、大数据及人工智能在视频监控EasyCVR中的应用

说到三大信息技术大家都很清楚&#xff0c;指的是云计算、大数据和人工智能&#xff0c;在人工智能&#xff08;AI&#xff09;快速发展的当下&#xff0c;例如常见的大数据分析、人工智能芯片生产的智能机器人等等&#xff0c;在工作、生活、教育、金融、科技、工业、农业、娱…

Embedding And Word2vec

Embedding与向量数据库&#xff1a; Embedding 简单地说就是 N 维数字向量&#xff0c;可以代表任何东西&#xff0c;包括文本、音乐、视频等等。要创建一个Embedding有很多方法&#xff0c;可以使用Word2vec&#xff0c;也可以使用OpenAI 的 Ada。创建好的Embedding&#xff…

优化记录 -- 记一次搜索引擎(SOLR)优化

业务场景 某服务根据用户相关信息&#xff0c;使用搜索引擎进行数据检索 软件配置 solr 1台&#xff1a;32c 64g 数据10gb左右&#xff0c;版本 7.5.5 应用服务器1台&#xff1a;16c 64g 应用程序 3节点 问题产生现象 1、因业务系统因处理能不足&#xff0c;对业务系统硬件…

k8s引用环境变量

一 定义环境变量 ① 如何在k8s中定义环境变量 env、configmap、secret补充&#xff1a; k8s 创建Service自带的环境变量 ② 从pod属性中获取 kubectl explain deploy.spec.template.spec.containers.env.valueFrom关注&#xff1a; configMapKeyRef、fieldRef 和 resour…

第十五届蓝桥杯模拟赛B组(第二期)C++

前言&#xff1a; 第一次做蓝桥模拟赛的博客记录&#xff0c;可能有很多不足的地方&#xff0c;现在将第十五届蓝桥杯模拟赛B组&#xff08;第二期&#xff09;的题目与代码与大家进行分享&#xff0c;我是用C做的&#xff0c;有好几道算法题当时自己做的也是一脸懵&#xff0c…

房产中介管理信息系统的设计与实现

摘 要 随着房地产业的开发&#xff0c;房产中介行业也随之发展起来&#xff0c;由于房改政策的出台&#xff0c;购房、售房、租房的居民越来越多&#xff0c;这对房产中介部门无疑是一个发展的契机。本文结合目前中国城市房产管理的实际情况和现阶段房屋产业的供求关系对房产中…

12.7作业

1. #include "mywidget.h"MyWidget::MyWidget(QWidget *parent): QWidget(parent) {//***********窗口相关设置***********//设置窗体大小this->resize(540,410);this->setFixedSize(540,410);//取消菜单栏this->setWindowFlag(Qt::FramelessWindowHint);/…

《计算机网络-自顶向下》wireShark实验-第二章:http

基本HTTP GET/response交互 我们开始探索HTTP&#xff0c;方法是下载一个非常简单的HTML文件。非常短&#xff0c;并且不包含嵌入的对象。执行以下操作&#xff1a; 启动您的浏览器。启动Wireshark数据包嗅探器&#xff0c;如Wireshark实验-入门所述&#xff08;还没开始数据包…

Matlab 用矩阵画图

文章目录 Part.I IntroductionChap.I 预备知识Chap.II 概要Chap.III 杂记 Part.II 用矩阵画图Chap.I 摸索过程Chap.II 绘制专业图Chap.III 矩阵转tiff Part.I Introduction 本文汇总了 Matlab 用矩阵画图的几种方式。 Chap.I 预备知识 关于 *.mat 文件 *.mat文件是 matlab 的…

Thymeleaf生成pdf表格合并单元格描边不显示

生成pdf后左侧第一列的右描边不显示&#xff0c;但是html显示正常 显示异常时描边的写法 cellpadding“0” cellspacing“0” &#xff0c;td,th描边 .self-table{border:1px solid #000;border-collapse: collapse;width:100%}.self-table th{font-size:12px;border:1px sol…