feat(商城): 更新部署脚本

master
wayn 1 year ago
parent eda2b109e7
commit ab72fe9375

@ -57,5 +57,6 @@ services:
volumes: volumes:
- ./mysql/data:/var/lib/mysql - ./mysql/data:/var/lib/mysql
- ./db-init:/docker-entrypoint-initdb.d - ./db-init:/docker-entrypoint-initdb.d
command: mysqld --lower_case_table_names=1 --default-authentication-plugin=mysql_native_password # - ./mysql/conf.d:/etc/mysql/conf.d
command: mysqld --lower_case_table_names=1 --slow_query_log=1 --max_connections=1000 --default-authentication-plugin=mysql_native_password
network_mode: "host" network_mode: "host"

@ -1,38 +1,10 @@
[mysqld] [mysqld]
user=mysql
basedir=/app/database/mysql
datadir=/data/3306
server_id=6
socket=/tmp/mysql.sock
bind-address = 0.0.0.0
# connect
max_connections = 1000 max_connections = 1000
max_connect_errors = 200 max_connect_errors = 200
# charset
character_set_server = utf8mb4 character_set_server = utf8mb4
# InnoDB Settings
innodb_buffer_pool_size = 2G
innodb_read_io_threads = 15
innodb_write_io_threads = 15
# innodb_flush_log_at_trx_commit = 0
innodb_buffer_pool_instances = 8
innodb_log_file_size = 1G
innodb_log_buffer_size = 64M
# innodb_flush_method = O_DIRECT
innodb_page_cleaners = 16
# session memory settings
read_buffer_size = 32M
read_rnd_buffer_size = 32M
sort_buffer_size = 64M
tmp_table_size = 64M
join_buffer_size = 128M
thread_cache_size = 64
# slow log
slow_query_log = 1 slow_query_log = 1
slow_query_log_file = slow.log slow_query_log_file = slow.log
long_query_time = 10 long_query_time = 10
@ -40,12 +12,3 @@ min_examined_row_limit = 100
log-queries-not-using-indexes log-queries-not-using-indexes
log_throttle_queries_not_using_indexes = 10 log_throttle_queries_not_using_indexes = 10
log_timestamps = system log_timestamps = system
# log settings
log_error = error.log
# client settings
[mysql]
prompt = (\\u@\\h) [\\d]>\\_
socket=/tmp/mysql.sock
no-auto-rehash

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="dev"/>
<property name="logPath" value="/home/logs/${appName}"/>
<property name="pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{request_id}] [%thread] [%-5level] %logger{36}:%L %M - %msg%n"/>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoder 默认配置为PatternLayoutEncoder -->
<encoder>
<pattern>${pattern}</pattern>
</encoder>
</appender>
<!-- 记录日志到文件 -->
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logPath}/info.log</file>
<encoder>
<pattern>${pattern}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logPath}/run.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">
&lt;!&ndash; 过滤的级别 &ndash;&gt;
<level>INFO</level>
&lt;!&ndash; 匹配时的操作:接收(记录) &ndash;&gt;
<onMatch>ACCEPT</onMatch>
&lt;!&ndash; 不匹配时的操作:拒绝(不记录) &ndash;&gt;
<onMismatch>DENY</onMismatch>
</filter>-->
</appender>
<logger name="org.springframework" level="INFO"/>
<logger name="io.lettuce.core" level="INFO"/>
<!-- logger为java中的包 -->
<logger name="com.wayn.common.core.mapper" level="INFO" />
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="INFO"/>
</root>
</configuration>
Loading…
Cancel
Save