From 984fa247d706705624395a91516ffbdd120844c6 Mon Sep 17 00:00:00 2001 From: marsal Date: Thu, 21 Aug 2025 18:57:57 +0800 Subject: [PATCH] new --- .DS_Store | Bin 6148 -> 6148 bytes README.md | 5 + .../support/data/nginx/conf.d/yudao.conf | 11 ++ .../support/data/nginx/conf/nginx.conf | 31 ++++ .../support/data/redis/conf/redis.conf | 28 +++ docker-3.124/support/docker-compose.yml | 49 +++++ .../snoarqube/docker-compose.yml | 37 ++++ docker-compose-3.111/snoarqube/test | 36 ++++ docker-compose-3.129/test.md | 168 +++++++++++------- .../10.5x环境配置记录/1. 安装docker.md | 7 +- docker-swarm/log/jvm.options | 90 ++++++++++ docker-swarm/log/logstash.conf | 2 +- 运维/my.cnf | 36 ++++ 13 files changed, 434 insertions(+), 66 deletions(-) create mode 100644 docker-3.124/support/data/nginx/conf.d/yudao.conf create mode 100644 docker-3.124/support/data/nginx/conf/nginx.conf create mode 100644 docker-3.124/support/data/redis/conf/redis.conf create mode 100644 docker-3.124/support/docker-compose.yml create mode 100644 docker-compose-3.111/snoarqube/docker-compose.yml create mode 100644 docker-compose-3.111/snoarqube/test create mode 100644 docker-swarm/log/jvm.options create mode 100644 运维/my.cnf diff --git a/.DS_Store b/.DS_Store index ccbbda6817be45b307dbb3859e84002772054571..460766204ce5ff9d77038a62062d4dc8a168421e 100644 GIT binary patch delta 104 zcmZoMXfc@JFUrEez`)4BAi%(o%233h%aF{F&yc&>k$E|z1xQMSAq6Oq%#e*N%}@Xo pD+Y?_G8i-HF&KhiS#VKaPJUiGP|sumX4%aeOv_m}vvd6A2LR*(6w?3z delta 52 zcmZoMXfc@JFUrioz`)4BAi%(o%233h%TUZv&XBmdka;;HBlBcWW|_?iOv_m(Hdt(C I=lIJH02#0hW&i*H diff --git a/README.md b/README.md index f27915b..be446f9 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,11 @@ mysql -uroot -pgkxl650 zd_rescue < ./zd_rescue.sql nohup mysql -uroot -pgkxl650 zd_rescue --max_allowed_packet=16777216 --net_buffer_length=16384 < ./zd_rescue.sql > ./mysql.log 2>&1 & + + +change master to master_host='192.168.10.10',master_user='repl',master_password='nczl@sino_db',master_log_file='mysql-bin.006898',master_log_pos=155; + + ``` ## rabbitmq diff --git a/docker-3.124/support/data/nginx/conf.d/yudao.conf b/docker-3.124/support/data/nginx/conf.d/yudao.conf new file mode 100644 index 0000000..8e45c8b --- /dev/null +++ b/docker-3.124/support/data/nginx/conf.d/yudao.conf @@ -0,0 +1,11 @@ +server { ## 前端项目 + listen 80; + ## server_name admin.iocoder.cn; ## 重要!!!修改成你的前端域名 + + location / { ## 前端项目 + root /usr/share/nginx/html/yudao-ui-admin; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + +}a \ No newline at end of file diff --git a/docker-3.124/support/data/nginx/conf/nginx.conf b/docker-3.124/support/data/nginx/conf/nginx.conf new file mode 100644 index 0000000..4a1a3f3 --- /dev/null +++ b/docker-3.124/support/data/nginx/conf/nginx.conf @@ -0,0 +1,31 @@ +user nginx; +worker_processes 1; + +events { + worker_connections 1024; +} + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; +# access_log /var/log/nginx/access.log main; + + gzip on; + gzip_min_length 1k; # 设置允许压缩的页面最小字节数 + gzip_buffers 4 16k; # 用来存储 gzip 的压缩结果 + gzip_http_version 1.1; # 识别 HTTP 协议版本 + gzip_comp_level 2; # 设置 gzip 的压缩比 1-9。1 压缩比最小但最快,而 9 相反 + gzip_types text/plain application/x-javascript text/css application/xml application/javascript; # 指定压缩类型 + gzip_proxied any; # 无论后端服务器的 headers 头返回什么信息,都无条件启用压缩 + + include /etc/nginx/conf.d/*.conf; ## 加载该目录下的其它 Nginx 配置文件 +} \ No newline at end of file diff --git a/docker-3.124/support/data/redis/conf/redis.conf b/docker-3.124/support/data/redis/conf/redis.conf new file mode 100644 index 0000000..64d61f1 --- /dev/null +++ b/docker-3.124/support/data/redis/conf/redis.conf @@ -0,0 +1,28 @@ +# redis 密码 +requirepass gkxl650 + +# key 监听器配置 +# notify-keyspace-events Ex + +# 配置持久化文件存储路径 +dir /redis/data +# 配置rdb +# 15分钟内有至少1个key被更改则进行快照 +save 900 1 +# 5分钟内有至少10个key被更改则进行快照 +save 300 10 +# 1分钟内有至少10000个key被更改则进行快照 +save 60 10000 +# 开启压缩 +rdbcompression yes +# rdb文件名 用默认的即可 +dbfilename dump.rdb + +# 开启aof +appendonly yes +# 文件名 +appendfilename "appendonly.aof" +# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢 +# appendfsync always +appendfsync everysec +# appendfsync no diff --git a/docker-3.124/support/docker-compose.yml b/docker-3.124/support/docker-compose.yml new file mode 100644 index 0000000..8f38344 --- /dev/null +++ b/docker-3.124/support/docker-compose.yml @@ -0,0 +1,49 @@ +version: '3' +networks: + sa-net: +services: + mysql: + image: mysql:8.0.33 + container_name: mysql + environment: + # 时区上海 + TZ: Asia/Shanghai + # root 密码 + MYSQL_ROOT_PASSWORD: gkxl650 + # 初始化数据库(后续的初始化sql会在这个库执行) + # MYSQL_DATABASE: + ports: + - "3306:3306" + volumes: + # 数据挂载 + - ./data/mysql/data/:/var/lib/mysql/ + # 配置挂载 + - ./data/mysql/conf/:/etc/mysql/conf.d/ + command: + # 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配) + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + privileged: true + networks: + - sa-net + redis: + image: redis:6.2.12 + container_name: redis + ports: + - "6379:6379" + environment: + # 时区上海 + TZ: Asia/Shanghai + volumes: + # 配置文件 + - ./data/redis/conf:/redis/config:rw + # 数据文件 + - ./data/redis/data/:/redis/data/:rw + command: "redis-server /redis/config/redis.conf" + privileged: true + networks: + - sa-net + \ No newline at end of file diff --git a/docker-compose-3.111/snoarqube/docker-compose.yml b/docker-compose-3.111/snoarqube/docker-compose.yml new file mode 100644 index 0000000..9322b11 --- /dev/null +++ b/docker-compose-3.111/snoarqube/docker-compose.yml @@ -0,0 +1,37 @@ + +services: + postgresql: + image: docker.io/bitnami/postgresql:latest + ports: + - '5432:5432' + volumes: + - './data/postgresql:/bitnami/postgresql' + environment: + # ALLOW_EMPTY_PASSWORD is recommended only for development. + - ALLOW_EMPTY_PASSWORD=yes + - POSTGRESQL_USERNAME=bn_sonarqube + - POSTGRESQL_DATABASE=bitnami_sonarqube + - POSTGRESQL_PASSWORD=bn_sonarqube + - TZ=Asia/Shanghai + sonarqube: + image: docker.io/bitnami/sonarqube:25 + ports: + - '9010:9000' + volumes: + - './data/sonarqube/sonarqube:/bitnami/sonarqube' + - './data/sonarqube/data:/opt/bitnami/sonarqube/data' + - './data/sonarqube/extensions:/opt/bitnami/sonarqube/extensions' + - './data/sonarqube/temp:/opt/bitnami/sonarqube/temp' + - './data/sonarqube/logs:/opt/bitnami/sonarqube/logs' + depends_on: + - postgresql + environment: + # ALLOW_EMPTY_PASSWORD is recommended only for development. + - ALLOW_EMPTY_PASSWORD=yes + - SONARQUBE_DATABASE_HOST=postgresql + - SONARQUBE_DATABASE_PORT_NUMBER=5432 + - SONARQUBE_DATABASE_USER=bn_sonarqube + - SONARQUBE_DATABASE_NAME=bitnami_sonarqube + - SONARQUBE_DATABASE_PASSWORD=bn_sonarqube + - TZ=Asia/Shanghai + diff --git a/docker-compose-3.111/snoarqube/test b/docker-compose-3.111/snoarqube/test new file mode 100644 index 0000000..584e6d7 --- /dev/null +++ b/docker-compose-3.111/snoarqube/test @@ -0,0 +1,36 @@ +services: + sonarqube: + image: sonarqube:community + hostname: sonarqube + container_name: sonarqube + read_only: true + depends_on: + db: + condition: service_healthy + environment: + SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar + SONAR_JDBC_USERNAME: sonar + SONAR_JDBC_PASSWORD: sonar + volumes: + - ./data/sonarqube/data:/opt/sonarqube/data + - ./data/sonarqube/extensions:/opt/sonarqube/extensions + - ./data/sonarqube/logs:/opt/sonarqube/logs + - ./data/sonarqube/temp:/opt/sonarqube/temp + ports: + - "9010:9000" + db: + image: postgres:17 + healthcheck: + test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ] + interval: 10s + timeout: 5s + retries: 5 + hostname: postgresql + container_name: postgresql + environment: + POSTGRES_USER: sonar + POSTGRES_PASSWORD: sonar + POSTGRES_DB: sonar + volumes: + - ./data/postgresql:/var/lib/postgresql + - ./data/postgresql_data:/var/lib/postgresql/data diff --git a/docker-compose-3.129/test.md b/docker-compose-3.129/test.md index d5742da..7d821bf 100644 --- a/docker-compose-3.129/test.md +++ b/docker-compose-3.129/test.md @@ -1,75 +1,115 @@ -# 司机/车辆信息核验接口文档 +### 测试人员试用期考试题目 -## 一、接口规范 +--- -### 1.1 信息提交接口(服务商→中道) +#### 一、选择题(每题5分,共10题) -**接口地址**: `/provider/driver-info` -**请求方式**: POST -**Content-Type**: application/json +1. **(技术)以下哪种测试方法主要用于验证软件是否符合需求文档中的功能描述?** + A. 白盒测试 + B. 黑盒测试 + C. 灰盒测试 + D. 单元测试 -#### 请求参数说明: +2. **(经验)在测试过程中发现一个偶现的缺陷,但无法稳定复现,此时应如何处理?** + A. 直接忽略该缺陷 + B. 记录缺陷并注明“偶现” + C. 要求开发立即修复 + D. 不提交缺陷报告 -| 参数名 | 必填 | 类型 | 说明 | -|----------------------|------|--------|--------------------------------------------------------------------| -| providerCode | 是 | String | 服务商编码(由中道分配) | -| operateType | 是 | String | 操作类型:1-新增 2-修改 3-停用 | -| rescueNo | 是 | String | 救援师傅工号(唯一标识) | -| rescueName | 是 | String | 师傅姓名 | -| rescuePhone | 是 | String | 师傅联系电话 | -| sex | 是 | String | 性别:0-女 1-男 | -| identity | 是 | String | 身份证号码 | -| nonMotorVehicle | 是 | String | 是否非机动车驾驶员:1-是 0-否(选1时驾照相关字段可不填) | -| identityPhoto_1 | 是 | String | 身份证正面照片URL | -| identityPhoto_2 | 是 | String | 身份证反面照片URL | -| licenseType | 否 | String | 驾照类型(A1/A2/A3/B1/B2/C1/C2) | -| licenseStartDay | 否 | String | 驾照领证时间(格式:yyyy-MM-dd) | -| licenseEndDay | 否 | String | 驾照失效时间(格式:yyyy-MM-dd) | -| LicensePhoto | 否 | String | 驾照照片URL | -| rescuePersonPhoto | 否 | String | 师傅正面照URL | -| belongType | 是 | String | 归属类型:1-自有师傅 0-外协师傅 | -| timestamp | 是 | String | 请求时间戳(格式:yyyy-MM-dd HH:mm:ss) | +3. **(规范)以下哪种命名方式符合测试用例的规范要求?** + A. Test_Case_1 + B. TC_Login_ValidCredentials + C. Case123 + D. LoginTest -### 1.2 核验通知接口(中道→服务商) +4. **(技术)以下哪项是性能测试工具?** + A. JIRA + B. Selenium + C. JMeter + D. Postman -**回调地址**: 需服务商提前配置 -**通知方式**: POST -**Content-Type**: application/json +5. **(经验)测试用例设计中,等价类划分法的核心目的是:** + A. 减少测试用例数量 + B. 覆盖所有可能的输入组合 + C. 仅测试边界值 + D. 验证用户界面 -#### 通知参数说明: +6. **(规范)测试文档中,以下哪项内容属于测试计划的必要组成部分?** + A. 缺陷统计表 + B. 测试范围与目标 + C. 测试用例详细步骤 + D. 开发人员名单 -| 参数名 | 必填 | 类型 | 说明 | -|---------------|------|--------|--------------------------------------| -| providerCode | 是 | String | 服务商编码 | -| rescueNo | 是 | String | 救援工号 | -| status | 是 | String | 核验状态:certifying/fail/success/expired | -| timestamp | 是 | String | 状态变更时间(格式同上) | -| remark | 否 | String | 失败原因说明 | +7. **(技术)自动化测试脚本的维护成本较高的主要原因是:** + A. 脚本语言复杂 + B. 需求频繁变更导致脚本失效 + C. 测试人员能力不足 + D. 开发工具限制 -## 二、业务流程 +8. **(经验)在敏捷开发模式下,测试人员的主要职责不包括:** + A. 参与需求评审 + B. 编写用户手册 + C. 执行每日构建测试 + D. 设计测试用例 -```mermaid -sequenceDiagram - participant 服务商系统 - participant 中道系统 - - 服务商系统->>中道系统: 提交司机信息(/provider/driver-info) - 中道系统-->>服务商系统: 返回受理结果 - - alt 数据校验失败 - 中道系统-->>服务商系统: code=2001 - else 校验通过 - 中道系统->>中道系统: 状态变更为「认证中」 - - loop 核验流程 - 中道系统->>中道系统: 人工审核/系统核验 - end - - 中道系统->>服务商系统: POST核验通知(/provider/verification-notify) - - alt 核验成功 - 服务商系统->>服务商系统: 锁定认证字段 - else 核验失败/过期 - 服务商系统->>服务商系统: 开放对应修改权限 - end - end +9. **(规范)以下哪种行为违反了缺陷管理规范?** + A. 缺陷描述中包含复现步骤和实际结果 + B. 将多个相似缺陷合并为一个报告 + C. 缺陷状态标记为“已关闭”后不再验证 + D. 使用优先级和严重程度区分缺陷 + +10. **(技术)以下哪项是安全测试的典型场景?** + A. 验证用户登录功能 + B. 检测SQL注入漏洞 + C. 测量系统响应时间 + D. 检查界面布局兼容性 + +--- + +#### 二、填空题(每题3分,共5题) + +1. **(技术)测试用例的三大核心组成部分是:______、测试步骤、预期结果。** +2. **(规范)测试计划中应明确测试的______、资源分配、风险评估和交付物。** +3. **(经验)BUG的生命周期通常包括新建、______、修复、验证、关闭。** +4. **(技术)性能测试中,TPS的全称是______。** +5. **(规范)代码审查时,应重点关注______、可维护性和潜在风险。** + +--- + +#### 三、简答题(每题5分,共7题) + +1. **(技术)请简述黑盒测试与白盒测试的核心区别。** +2. **(经验)如何设计一个高覆盖率的登录功能测试用例?** +3. **(规范)测试人员在提交缺陷报告时需包含哪些关键信息?** +4. **(技术)什么是回归测试?在什么情况下需要执行回归测试?** +5. **(经验)当开发人员不认可你提交的缺陷时,应如何处理?** +6. **(规范)测试用例评审的参与方通常包括哪些角色?** +7. **(技术)请列举3种常见的接口测试工具。** + +--- + +### 标准答案 + +#### 一、选择题 +1. B 2. B 3. B 4. C 5. A +6. B 7. B 8. B 9. C 10. B + +#### 二、填空题 +1. 用例编号/名称 +2. 测试范围 +3. 确认/分配 +4. Transactions Per Second(每秒事务数) +5. 代码逻辑 + +#### 三、简答题 +1. **黑盒测试**关注功能是否符合需求,不关注内部代码;**白盒测试**基于代码结构设计用例,验证逻辑正确性。 +2. 设计用例需覆盖:有效/无效用户名密码、空输入、特殊字符、密码加密、错误提示、多次失败锁定等场景。 +3. 缺陷标题、复现步骤、实际结果、预期结果、环境信息、截图/日志、严重程度、优先级。 +4. **回归测试**用于验证代码修改未引入新缺陷。需执行的情况:需求变更、缺陷修复、版本迭代后。 +5. 提供更详细的复现步骤和日志;沟通需求文档或设计规范;若仍有争议,可请团队负责人或产品经理仲裁。 +6. 测试人员、开发人员、产品经理、项目经理。 +7. Postman、JMeter、SoapUI、Swagger(任选3个)。 + +--- + +试卷设计覆盖技术能力、实际经验和规范意识,适用于评估测试人员的综合能力。 \ No newline at end of file diff --git a/docker-swarm/10.5x环境配置记录/1. 安装docker.md b/docker-swarm/10.5x环境配置记录/1. 安装docker.md index 64e2e2d..9797442 100644 --- a/docker-swarm/10.5x环境配置记录/1. 安装docker.md +++ b/docker-swarm/10.5x环境配置记录/1. 安装docker.md @@ -42,10 +42,15 @@ sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin d 设置日志大小 vim /etc/docker/daemon.json - + + +{ + "log-opts": {"max-size":"1g", "max-file":"3"}, + "registry-mirrors": ["https://docker.hlmirror.com"] } systemctl reload docker diff --git a/docker-swarm/log/jvm.options b/docker-swarm/log/jvm.options new file mode 100644 index 0000000..b729fce --- /dev/null +++ b/docker-swarm/log/jvm.options @@ -0,0 +1,90 @@ +## JVM configuration + +# Xms represents the initial size of total heap space +# Xmx represents the maximum size of total heap space + +-Xms1g +-Xmx1g + +################################################################ +## Expert settings +################################################################ +## +## All settings below this section are considered +## expert settings. Don't tamper with them unless +## you understand what you are doing +## +################################################################ + +## GC configuration +11-13:-XX:+UseConcMarkSweepGC +11-13:-XX:CMSInitiatingOccupancyFraction=75 +11-13:-XX:+UseCMSInitiatingOccupancyOnly + +## Locale +# Set the locale language +#-Duser.language=en + +# Set the locale country +#-Duser.country=US + +# Set the locale variant, if any +#-Duser.variant= + +## basic + +# set the I/O temp directory +#-Djava.io.tmpdir=$HOME + +# set to headless, just in case +-Djava.awt.headless=true + +# ensure UTF-8 encoding by default (e.g. filenames) +-Dfile.encoding=UTF-8 + +# use our provided JNA always versus the system one +#-Djna.nosys=true + +# Turn on JRuby invokedynamic +-Djruby.compile.invokedynamic=true + +## heap dumps + +# generate a heap dump when an allocation from the Java heap fails +# heap dumps are created in the working directory of the JVM +-XX:+HeapDumpOnOutOfMemoryError + +# specify an alternative path for heap dumps +# ensure the directory exists and has sufficient space +#-XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof + +## GC logging +#-Xlog:gc*,gc+age=trace,safepoint:file=@loggc@:utctime,pid,tags:filecount=32,filesize=64m + +# log GC status to a file with time stamps +# ensure the directory exists +#-Xloggc:${LS_GC_LOG_FILE} + +# Entropy source for randomness +-Djava.security.egd=file:/dev/urandom + +# Copy the logging context from parent threads to children +-Dlog4j2.isThreadContextMapInheritable=true + +# FasterXML/jackson defaults +# +# Sets the maximum string length (in chars or bytes, depending on input context). +# This limit is not exact and an exception will happen at sizes greater than this limit. +# Some text values that are a little bigger than the limit may be treated as valid but no +# text values with sizes less than or equal to this limit will be treated as invalid. +# This value should be higher than `logstash.jackson.stream-read-constraints.max-number-length`. +# The jackson library defaults to 20000000 or 20MB, whereas Logstash defaults to 200MB or 200000000 characters. +-Dlogstash.jackson.stream-read-constraints.max-string-length=200000000 +# +# Sets the maximum number length (in chars or bytes, depending on input context). +# The jackson library defaults to 1000, whereas Logstash defaults to 10000. +-Dlogstash.jackson.stream-read-constraints.max-number-length=10000 +# +# Sets the maximum nesting depth. The depth is a count of objects and arrays that have not +# been closed, `{` and `[` respectively. +#-Dlogstash.jackson.stream-read-constraints.max-nesting-depth=1000 \ No newline at end of file diff --git a/docker-swarm/log/logstash.conf b/docker-swarm/log/logstash.conf index 8c4d5b4..eee402c 100644 --- a/docker-swarm/log/logstash.conf +++ b/docker-swarm/log/logstash.conf @@ -16,7 +16,7 @@ filter { output { - if [servicename] { + if [service] { elasticsearch { hosts => [ "prod-es-elasticsearch:9200" ] index => "sslog-%{[service]}" diff --git a/运维/my.cnf b/运维/my.cnf new file mode 100644 index 0000000..4d889c2 --- /dev/null +++ b/运维/my.cnf @@ -0,0 +1,36 @@ +[mysqld] +# 内存核心配置 (适配64GB内存) +innodb_buffer_pool_size = 44G # 提升至物理内存的68% +innodb_buffer_pool_instances = 16 # 匹配CPU核心数 + +# 线程与连接优化 (适配281连接/64核心) +thread_cache_size = 150 # 调整为连接数的一半 +innodb_thread_concurrency = 0 # 禁用并发限制,让MySQL自动管理 +innodb_read_io_threads = 16 +innodb_write_io_threads = 16 + +# 每连接内存优化 (关键!) +max_connections = 400 +sort_buffer_size = 512K # 原256K过低 +read_buffer_size = 256K +read_rnd_buffer_size = 512K +join_buffer_size = 512K +thread_stack = 512K # 防止复杂查询溢出 + +# 临时表与缓存优化 +tmp_table_size = 128M +max_heap_table_size = 128M +table_open_cache = 10000 +table_definition_cache = 4000 + +# InnoDB日志优化 (SSD专用) +innodb_log_file_size = 4G # 增大日志文件 +innodb_log_files_in_group = 2 # 共8GB日志 +innodb_io_capacity = 20000 # SSD优化 +innodb_io_capacity_max = 40000 +innodb_flush_method = O_DIRECT_NO_FSYNC + +# 超时与维护 +wait_timeout = 120 +interactive_timeout = 300 +innodb_purge_threads = 4 \ No newline at end of file