k8s部署单点的mysql实例

k8s部署单点的mysql实例

文章目录

  • 前言
  • 一、基础环境准备
  • 二、准备yaml文件
  • 三、yaml文件中的特殊配置
    • 3.1 时区的配置
    • 3.2 管理员密码的配置
    • 3.3 lost+found配置
    • 3.4 探针配置
  • 总结


前言

记录一下根据kubernetes.io的范本部署一个mysql实例的过程

一、基础环境准备

准备一个k8s集群,配置好存储类,我这里使用的是rook-ceph的cephfs

二、准备yaml文件

mysql.yaml

# get from https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/
apiVersion: v1
kind: Namespace
metadata:name: daxinxindahaohao-mysql---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: mysql-pv-claimnamespace: daxinxindahaohao-mysql
spec:storageClassName: rook-cephfsaccessModes:- ReadWriteManyresources:requests:storage: 50G
---
apiVersion: v1
kind: Service
metadata:name: mysqlnamespace: daxinxindahaohao-mysql
spec:type: ClusterIPports:- name: mysql-3306protocol: TCPport: 3306targetPort: 3306selector:app: mysql
---
apiVersion: apps/v1
kind: Deployment
metadata:name: mysqlnamespace: oneops-mysql
spec:selector:matchLabels:app: mysqlstrategy:type: Recreatetemplate:metadata:labels:app: mysqlspec:containers:# 指定现在使用的特定版本- image: docker.io/library/mysql:5.7.36name: mysql# 解决pvc使用ceph的rbd格式引入的lost+found文件导致无法正常启动的问题args: ["--ignore-db-dir=lost+found"]env:# 设定root用户的账号密码- name: MYSQL_ROOT_PASSWORDvalue: "123456"- name: TZvalue: Asia/Shanghaiports:- containerPort: 3306name: mysqlvolumeMounts:- name: mysql-persistent-storagemountPath: /var/lib/mysql# 增加探针readinessProbe:tcpSocket:port: 3306initialDelaySeconds: 1periodSeconds: 30successThreshold: 2volumes:- name: mysql-persistent-storagepersistentVolumeClaim:claimName: mysql-pv-claim

三、yaml文件中的特殊配置

3.1 时区的配置

        - name: TZvalue: Asia/Shanghai

3.2 管理员密码的配置

        - name: MYSQL_ROOT_PASSWORDvalue: "123456"

3.3 lost+found配置

解决报错信息:[ERROR] --initialize specified but the data directory has files in it. Aborting.

        args: ["--ignore-db-dir=lost+found"]

3.4 探针配置

          # 增加探针readinessProbe:tcpSocket:port: 3306initialDelaySeconds: 1periodSeconds: 30successThreshold: 2

这里增加探针的原因是因为pod状态变为RUNNING之后,内部的mariadb服务会有一个初始化重启过程,只有当初始化重启完毕之后,3306端口才会被监听起来。
简单的说就是mariadb服务的生命周期是:第一次启动–》自动初始化–》重启服务进行初始化–》初始化完成,二次启动。只有当二次启动之后,服务才是正常对外提供服务的。
但是如果是设置数据库初始化脚本的话,在第一次启动的时候就载入数据库表结构文件就会出现中断的错误,影响初始化脚本的成功运行。
下面付上初始化启动的日志

2023-09-06 16:18:13+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.36-1debian10 started.
2023-09-06 16:18:14+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-09-06 16:18:14+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.36-1debian10 started.
2023-09-06 16:18:15+08:00 [Note] [Entrypoint]: Initializing database files
2023-09-06T08:18:15.068741Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-09-06T08:18:53.008582Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-09-06T08:18:55.351193Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-09-06T08:18:56.020897Z 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: 05ba0787-4c8e-11ee-b619-fecb0056b728.
2023-09-06T08:18:56.139729Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-09-06T08:18:56.709872Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:18:56.709901Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:18:56.710623Z 0 [Warning] CA certificate ca.pem is self signed.
2023-09-06T08:18:56.913185Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2023-09-06 16:20:26+08:00 [Note] [Entrypoint]: Database files initialized
2023-09-06 16:20:26+08:00 [Note] [Entrypoint]: Starting temporary server
2023-09-06 16:20:26+08:00 [Note] [Entrypoint]: Waiting for server startup
2023-09-06T08:20:26.418510Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-09-06T08:20:26.423936Z 0 [Note] mysqld (mysqld 5.7.36) starting as process 108 ...
2023-09-06T08:20:26.430518Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-09-06T08:20:26.430547Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-09-06T08:20:26.430551Z 0 [Note] InnoDB: Uses event mutexes
2023-09-06T08:20:26.430554Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-09-06T08:20:26.430557Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-09-06T08:20:26.430562Z 0 [Note] InnoDB: Using Linux native AIO
2023-09-06T08:20:26.430958Z 0 [Note] InnoDB: Number of pools: 1
2023-09-06T08:20:26.431158Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-09-06T08:20:26.434067Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-09-06T08:20:26.446992Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-09-06T08:20:26.450888Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-09-06T08:20:26.471519Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-09-06T08:20:26.700633Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-09-06T08:20:26.701971Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-09-06T08:20:29.172209Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-09-06T08:20:29.177887Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-09-06T08:20:29.177925Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-09-06T08:20:29.180270Z 0 [Note] InnoDB: 5.7.36 started; log sequence number 2751302
2023-09-06T08:20:29.180687Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-09-06T08:20:29.181526Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-09-06T08:20:29.192825Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230906 16:20:29
2023-09-06T08:20:29.199171Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-09-06T08:20:29.199208Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-09-06T08:20:29.199215Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:20:29.199220Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:20:29.200335Z 0 [Warning] CA certificate ca.pem is self signed.
2023-09-06T08:20:29.200416Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-09-06T08:20:29.210472Z 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-09-06T08:20:29.283645Z 0 [Note] Event Scheduler: Loaded 0 events
2023-09-06T08:20:29.284159Z 0 [Note] mysqld: ready for connections.
Version: '5.7.36'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
2023-09-06 16:20:30+08:00 [Note] [Entrypoint]: Temporary server started.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
2023-09-06T08:21:17.708990Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 14928ms. The settings might not be optimal. (flushed=3 and evicted=0, during the time.)
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.2023-09-06 16:21:22+08:00 [Note] [Entrypoint]: Stopping temporary server
2023-09-06T08:21:22.927973Z 0 [Note] Giving 0 client threads a chance to die gracefully
2023-09-06T08:21:22.928036Z 0 [Note] Shutting down slave threads
2023-09-06T08:21:22.928052Z 0 [Note] Forcefully disconnecting 0 remaining clients
2023-09-06T08:21:22.928063Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2023-09-06T08:21:22.928161Z 0 [Note] Binlog end
2023-09-06T08:21:22.929679Z 0 [Note] Shutting down plugin 'ngram'
2023-09-06T08:21:22.929707Z 0 [Note] Shutting down plugin 'partition'
2023-09-06T08:21:22.929713Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2023-09-06T08:21:22.929719Z 0 [Note] Shutting down plugin 'ARCHIVE'
2023-09-06T08:21:22.929722Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2023-09-06T08:21:22.929787Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2023-09-06T08:21:22.929797Z 0 [Note] Shutting down plugin 'MyISAM'
2023-09-06T08:21:22.929821Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2023-09-06T08:21:22.929827Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2023-09-06T08:21:22.929831Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2023-09-06T08:21:22.929834Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2023-09-06T08:21:22.929837Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2023-09-06T08:21:22.929842Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2023-09-06T08:21:22.929845Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2023-09-06T08:21:22.929849Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2023-09-06T08:21:22.929852Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2023-09-06T08:21:22.929856Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2023-09-06T08:21:22.929862Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2023-09-06T08:21:22.929865Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2023-09-06T08:21:22.929869Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2023-09-06T08:21:22.929873Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2023-09-06T08:21:22.929876Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2023-09-06T08:21:22.929879Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2023-09-06T08:21:22.929883Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2023-09-06T08:21:22.929887Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2023-09-06T08:21:22.929890Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2023-09-06T08:21:22.929895Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2023-09-06T08:21:22.929899Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2023-09-06T08:21:22.929903Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2023-09-06T08:21:22.929907Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2023-09-06T08:21:22.929910Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2023-09-06T08:21:22.929914Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2023-09-06T08:21:22.929917Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2023-09-06T08:21:22.929921Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2023-09-06T08:21:22.929925Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2023-09-06T08:21:22.929928Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2023-09-06T08:21:22.929932Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2023-09-06T08:21:22.929936Z 0 [Note] Shutting down plugin 'InnoDB'
2023-09-06T08:21:22.930018Z 0 [Note] InnoDB: FTS optimize thread exiting.
2023-09-06T08:21:22.930342Z 0 [Note] InnoDB: Starting shutdown...
2023-09-06T08:21:23.030855Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2023-09-06T08:21:23.034210Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230906 16:21:23
2023-09-06T08:21:35.754523Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12661989
2023-09-06T08:21:36.550125Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-09-06T08:21:36.550239Z 0 [Note] Shutting down plugin 'MEMORY'
2023-09-06T08:21:36.550268Z 0 [Note] Shutting down plugin 'CSV'
2023-09-06T08:21:36.550281Z 0 [Note] Shutting down plugin 'sha256_password'
2023-09-06T08:21:36.550287Z 0 [Note] Shutting down plugin 'mysql_native_password'
2023-09-06T08:21:36.550653Z 0 [Note] Shutting down plugin 'binlog'
2023-09-06T08:21:36.556583Z 0 [Note] mysqld: Shutdown complete2023-09-06 16:21:36+08:00 [Note] [Entrypoint]: Temporary server stopped2023-09-06 16:21:36+08:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.2023-09-06T08:21:37.264717Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-09-06T08:21:37.271432Z 0 [Note] mysqld (mysqld 5.7.36) starting as process 1 ...
2023-09-06T08:21:37.279621Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-09-06T08:21:37.279661Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-09-06T08:21:37.279669Z 0 [Note] InnoDB: Uses event mutexes
2023-09-06T08:21:37.279677Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-09-06T08:21:37.279684Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-09-06T08:21:37.279695Z 0 [Note] InnoDB: Using Linux native AIO
2023-09-06T08:21:37.280444Z 0 [Note] InnoDB: Number of pools: 1
2023-09-06T08:21:37.280779Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-09-06T08:21:37.285025Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-09-06T08:21:37.311721Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-09-06T08:21:37.317736Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-09-06T08:21:37.338335Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-09-06T08:21:38.398840Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-09-06T08:21:38.401005Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-09-06T08:21:40.329229Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-09-06T08:21:40.334360Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-09-06T08:21:40.334393Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-09-06T08:21:40.335344Z 0 [Note] InnoDB: Waiting for purge to start
2023-09-06T08:21:40.385739Z 0 [Note] InnoDB: 5.7.36 started; log sequence number 12661989
2023-09-06T08:21:40.386093Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-09-06T08:21:40.386668Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-09-06T08:21:40.401632Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230906 16:21:40
2023-09-06T08:21:40.409594Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-09-06T08:21:40.409615Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-09-06T08:21:40.409621Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:21:40.409625Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-09-06T08:21:40.410398Z 0 [Warning] CA certificate ca.pem is self signed.
2023-09-06T08:21:40.410457Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-09-06T08:21:40.411310Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2023-09-06T08:21:40.411396Z 0 [Note] IPv6 is available.
2023-09-06T08:21:40.411422Z 0 [Note]   - '::' resolves to '::';
2023-09-06T08:21:40.411460Z 0 [Note] Server socket created on IP: '::'.
2023-09-06T08:21:40.421034Z 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-09-06T08:21:40.480176Z 0 [Note] Event Scheduler: Loaded 0 events
2023-09-06T08:21:40.480637Z 0 [Note] mysqld: ready for connections.
Version: '5.7.36'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
2023-09-06T08:25:16.406841Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)

总结

只是单纯部署使用的话用不到探针的配置。我这里选择使用是因为有个一键式部署和初始化的功能需求,加上探针的话就只需要判断pod状态就可以了,比较简单。

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

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

相关文章

前端开发与后端开发:探索编程世界的两个街区

一、引言 编程世界就像一座大城市,前端开发和后端开发就像城市的两个不同街区。在这个城市中,每个街区都有其独特的魅力和吸引力。作为初学者,我们站在这个城市的交叉口,不知道应该选择哪个街区。而作为过来者,你已经…

马斯洛需求层次模型之安全需求之云安全浅谈

在互联网云服务领域,安全需求是用户首要考虑的因素之一。用户希望在将数据和信息托付给云服务提供商时,这些数据和信息能够得到充分的保护,避免遭受未经授权的访问、泄露或破坏。这种安全需求的满足,对于用户来说是至关重要的&…

物理层下的传输媒体

物理层下的传输媒体 传输媒体就是数据传输系统中在发送器和接收器之间的物理通路。 一、导引型传输媒体 1、双绞线 ​ 把两根相互绝缘的铜导线并排放在,然后用规则的方法绞合起来就构成了双绞线。绞合可较少对相邻导线的电磁干扰。 ​ 电话系统使用的双绞线通信距…

【人工智能导论】线性回归模型

一、线性回归模型概述 线性回归是利用函数对一个或多个自变量和因变量之间关系进行建模的一种回归分析。简单来说,就是试图找到自变量与因变量之间的关系。 二、线性回归案例:房价预测 1、案例分析 问题:现在要预测140平方的房屋的价格&…

Lilliefors正态性检验(一种非参数统计方法)

Lilliefors检验(也称为Kolmogorov-Smirnov-Lilliefors检验)是一种用于检验数据是否符合正态分布的统计检验方法,它是Kolmogorov-Smirnov检验的一种变体,专门用于小样本情况。与K-S检验不同,Lilliefors检验不需要假定数…

什么是DevOps

文章目录 一、概念二、地位三、目标四、要求五、具体手段 一、概念 是一组过程、方法与系统的统称,有助于打破开发、测试、运维、交付部门之间的壁垒,提高部门间的沟通协助能力。 二、地位 应成为公司的一种理念、文化、哲学。 三、目标 实现更加高…

【vue3】Suspense组件和动态引入defineAsyncComponent的搭配使用

假期第五篇&#xff0c;对于基础的知识点&#xff0c;我感觉自己还是很薄弱的。 趁着假期&#xff0c;再去复习一遍 在app中定义子组件child //静态引入&#xff0c;网速慢的时候&#xff0c;父子组件也是同时渲染出来 <template><div><h3>APP父组件</…

Android自动化测试之MonkeyRunner--从环境构建、参数讲解、脚本制作到实战技巧

monkeyrunner 概述、环境搭建 monkeyrunner环境搭建 (1) JDK的安装不配置 http://www.oracle.com/technetwork/java/javase/downloads/index.html (2) 安装Python编译器 https://www.python.org/download/ (3) 设置环境变量(配置Monkeyrunner工具至path目彔下也可丌配置) (4) …

重新认识mysql

title: “重新认识mysql” createTime: 2022-03-06T15:52:4108:00 updateTime: 2022-03-06T15:52:4108:00 draft: false author: “ggball” tags: [“mysql”] categories: [“db”] description: “” 文章目录 title: "重新认识mysql" createTime: 2022-03-06T15:…

pygame - 贪吃蛇小游戏

蛇每吃掉一个身体块&#xff0c;蛇身就增加一个长度。为了统一计算&#xff0c;界面的尺寸和游戏元素的位置都是身体块长度的倍数 1. 上下左右方向键&#xff08;或者ASDW键&#xff09;控制蛇的移动方向 2. 空格键暂停和继续蛇的身体图片文件&#xff0c;复制到项目的asset\im…

(高阶) Redis 7 第17讲 分布式锁 实战篇

🌹 以下分享 Redis 分布式锁,如有问题请指教。🌹🌹 如你对技术也感兴趣,欢迎交流。🌹🌹🌹 如有对阁下帮助,请👍点赞💖收藏🐱‍🏍分享😀 Redis 除了做缓存,其他基于Redis的用法。(答案:数据共享,分布式session/分布式锁/全局ID/计算器、点赞/位统…

Rust 多线程编程

一个进程一定有一个主线程&#xff0c;主线程之外创建出来的线程称为子线程 多线程编程&#xff0c;其实就是在主线程之外创建子线程&#xff0c;让子线程和主线程并发运行&#xff0c;完成各自的任务。 Rust语言支持多线程编程。 Rust语言标准库中的 std::thread 模块用于多线…

flutter播放rtmp视频

安装 dependencies:fijkplayer: ^0.11.0使用方法 import package:fijkplayer/fijkplayer.dart; import package:flutter/material.dart;class RtmpPlayerPage extends StatefulWidget {const RtmpPlayerPage({super.key});overrideState<RtmpPlayerPage> createState()…

【Python】返回指定时间对应的时间戳

使用模块datetime&#xff0c;附赠一个没啥用的“时间推算”功能(获取n天后对应的时间 代码&#xff1a; import datetimedef GetTimestamp(year,month,day,hour,minute,second,*,relativeNone,timezoneNone):#返回指定时间戳。指定relative时进行时间推算"""根…

TFT LCD刷新原理及LCD时序参数总结(LCD时序,写的挺好)

cd工作原理目前不了解&#xff0c;日后会在博客中添加这一部分的内容。 1.LCD工作原理[1] 我对LCD的工作原理也仅仅处在了解的地步&#xff0c;下面基于NXP公司对LCD工作原理介绍的ppt来学习一下。 LCD(liquid crystal display,液晶显示屏) 是由液晶段阵列组成&#xff0c;当…

目标检测YOLO实战应用案例100讲-机器人路径规划与目标检测

目录 前言 路径规划研究现状 全局路径规划方法 局部路径规划方法

【网络协议】ARP协议

为什么网络需要同时借助MAC地址这种物理地址和IP地址这种逻辑地址进行通信&#xff1f; 尽管目前MAC地址可以通过逻辑的方式进行修改&#xff0c;但它最初是被设计为不可人为更改的硬件地址。虽然MAC地址也可以满足唯一性的要求&#xff0c;但由于它不可由管理员根据需求通过逻…

newstarctf

wp web: 1.rce 可以发现这个变量名有下划线也有点。 $code$_POST[e_v.a.l]; 这时候如果直接按这个变量名来传参&#xff0c;php 是无法接收到这个值的&#xff0c;具体原因是 php 会自动把一些不合法的字符转化为下划线&#xff08;注&#xff1a;php8以下&#xff09;&am…

springboot和vue:八、vue快速入门

vue快速入门 新建一个html文件 导入 vue.js 的 script 脚本文件 <script src"https://unpkg.com/vuenext"></script>在页面中声明一个将要被 vue 所控制的 DOM 区域&#xff0c;既MVVM中的View <div id"app">{{ message }} </div…

Node.js 是如何处理请求的

前言&#xff1a;在服务器软件中&#xff0c;如何处理请求是非常核心的问题。不管是底层架构的设计、IO 模型的选择&#xff0c;还是上层的处理都会影响一个服务器的性能&#xff0c;本文介绍 Node.js 在这方面的内容。 TCP 协议的核心概念 要了解服务器的工作原理首先需要了…