openEuler 22.03 LTS 环境使用 Docker Compose 一键部署 JumpServer (all-in-one 模式)
环境回顾
上一篇文章中,我们讲解了 openEuler 22.03 LTS 安装 Docker CE 和 Dcoker Compose,部署的软件环境版本分别如下:
- OS 系统:
openEuler 22.03 LTS(openEuler-22.03-LTS-x86_64-dvd.iso)
- Docker Engine:
Docker CE(Docker Engine - Community v24.0.6)
- Docker Compose:
Docker Compose v2.21.0
接着上面部署的环境,我们继续讲解如何使用 docker compose
一键部署 JumpServer
(all-in-one
模式)。
Compose 部署步骤
编排文件是使用 Docker Compose
的核心,支持 compose.yaml
或者compose.yml
作为默认名称,也向后兼容 docker-compose.yaml
和 docker-compose.yml
,如果这些文件都存在则首选 compose.yaml
。你也可以使用其他名称,只是需要在启动的时候指定文件名。
Docker Engine
和Compose
版本支持列表
Compose file format | Docker Engine release |
---|---|
Compose specification | 19.03.0+ |
3.8 | 19.03.0+ |
3.7 | 18.06.0+ |
3.6 | 18.02.0+ |
3.5 | 17.12.0+ |
3.4 | 17.09.0+ |
3.3 | 17.06.0+ |
3.2 | 17.04.0+ |
3.1 | 1.13.1+ |
3.0 | 1.13.0+ |
2.4 | 17.12.0+ |
2.3 | 17.06.0+ |
2.2 | 1.13.0+ |
2.1 | 1.12.0+ |
2.0 | 1.10.0+ |
关于
docker
和compose
支持矩阵更多信息,请查看官方文档 https://docs.docker.com/compose/compose-file/compose-file-v3/
1、compose healthcheck 举例
关于 mariadb docker compose healthcheck
配置说明:
Docker Compose
可以通过在 docker-compose.yml
文件中设置 healthcheck
配置来检查 MariaDB
容器的健康状态。
在 docker-compose.yml
中,可以在 services.mariadb
配置下添加 healthcheck
:
services:mariadb:image: mariadb:latesthealthcheck:test: ["CMD-SHELL", "mysqladmin ping --silent"]interval: 30stimeout: 10sretries: 3
在这个例子中,我们使用了 mysqladmin ping
命令来检查 MariaDB
是否健康。如果 MariaDB
返回了 “mysqld is alive”
,则视为健康,否则视为不健康。间隔 30s
检查一次,超时 10s
,如果失败 3次
就认为 unhealthy
。
注意:如果
MariaDB
容器内部没有安装mysqladmin
命令,这个健康检查将失败。
2、编写 Compose.yaml 文件
编写 jumpserver-allinone-compose.yaml
文件信息如下:
version: '3.8'
services:mariadb:image: mariadb:10.11container_name: jms_mariadbrestart: alwayscommand: --log-bin --log-basename=mariadb --character-set-server=utf8mb4 --collation-server=utf8mb4_general_cienvironment:DB_PORT: ${DB_PORT:-3306}MARIADB_ROOT_PASSWORD: ${DB_PASSWORD:-My123456}MARIADB_DATABASE: ${DB_NAME:-jumpserver}TZ: "Asia/Shanghai"ports:- 3306:3306healthcheck:test: "mysql -h 127.0.0.1 -u root -p $$MARIADB_ROOT_PASSWORD -e 'SHOW DATABASES;'"interval: 10stimeout: 5sretries: 3start_period: 30svolumes:- ${VOLUME_DIR:-./jms_data}/mariadb/data:/var/lib/mysqlnetworks:- netredis:image: redis:6.2container_name: jms_redisrestart: alwayscommand: redis-server --requirepass ${REDIS_PASSWORD:-Rds123456} --loglevel warning --maxmemory-policy allkeys-lruenvironment:REDIS_PORT: ${REDIS_PORT:-6379}REDIS_PASSWORD: ${REDIS_PASSWORD:-Rds123456}ports:- 6379:6379healthcheck:test: "redis-cli -h 127.0.0.1 -p $$REDIS_PORT -a $$REDIS_PASSWORD info Replication"interval: 10stimeout: 5sretries: 3start_period: 10svolumes:- ${VOLUME_DIR:-./jms_data}/redis/data:/datanetworks:- netjumpserver:image: jumpserver/jms_all:${VERSION:-latest}build:context: .dockerfile: Dockerfilecontainer_name: jms_allprivileged: truerestart: alwaysenvironment:SECRET_KEY: ${SECRET_KEY:-vYneAbsXUhe4BghEeedNL7nfWLwaTTmhnwQMvjYOIG25Ofzghk}BOOTSTRAP_TOKEN: ${BOOTSTRAP_TOKEN:-K1ffDfLSIK8SV2PZj6VaxOiv8KuawlJK}DEBUG: ${DEBUG:-FALSE}LOG_LEVEL: ${LOG_LEVEL:-ERROR}DB_HOST: ${DB_HOST:-mysql}DB_PORT: ${DB_PORT:-3306}DB_USER: ${DB_USER:-root}DB_PASSWORD: ${DB_PASSWORD:-My123456}DB_NAME: ${DB_NAME:-jumpserver}REDIS_HOST: ${REDIS_HOST:-redis}REDIS_PORT: ${REDIS_PORT:-6379}REDIS_PASSWORD: ${REDIS_PASSWORD:-Rds123456}MAGNUS_MYSQL_PORT: ${MAGNUS_MYSQL_PORT:-33061}MAGNUS_MARIADB_PORT: ${MAGNUS_MARIADB_PORT:-33062}MAGNUS_REDIS_PORT: ${MAGNUS_REDIS_PORT:-63790}ports:- ${HTTP_PORT:-80}:80/tcp- ${SSH_PORT:-2222}:2222/tcp- ${MAGNUS_MYSQL_PORT:-33061}:33061/tcp- ${MAGNUS_MARIADB_PORT:-33062}:33062/tcp- ${MAGNUS_REDIS_PORT:-63790}:63790/tcpdepends_on:mariadb:condition: service_healthyredis:condition: service_healthyhealthcheck:test: "curl -fsL http://localhost/api/health/ > /dev/null"interval: 10stimeout: 5sretries: 3start_period: 90svolumes:- ${VOLUME_DIR:-./jms_data}/core/data:/opt/jumpserver/core/data- ${VOLUME_DIR:-./jms_data}/koko/data:/opt/jumpserver/koko/data- ${VOLUME_DIR:-./jms_data}/lion/data:/opt/jumpserver/lion/data- ${VOLUME_DIR:-./jms_data}/magnus/data:/opt/jumpserver/magnus/data- ${VOLUME_DIR:-./jms_data}/chen/data:/opt/jumpserver/chen/data- ${VOLUME_DIR:-./jms_data}/kael/data:/opt/jumpserver/kael/data- ${VOLUME_DIR:-./jms_data}/nginx/data:/var/log/nginxnetworks:- netnetworks:net:
3、执行 Compose 命令
查看 docker compose
命令:
[root@jumpServer ~]# docker compose --helpUsage: docker compose [OPTIONS] COMMANDDefine and run multi-container applications with Docker.Options:--ansi string Control when to print ANSI control characters ("never"|"always"|"auto")(default "auto")--compatibility Run compose in backward compatibility mode--dry-run Execute command in dry run mode--env-file stringArray Specify an alternate environment file.-f, --file stringArray Compose configuration files--parallel int Control max parallelism, -1 for unlimited (default -1)--profile stringArray Specify a profile to enable--progress string Set type of progress output (auto, tty, plain, quiet) (default "auto")--project-directory string Specify an alternate working directory(default: the path of the, first specified, Compose file)-p, --project-name string Project nameCommands:build Build or rebuild servicesconfig Parse, resolve and render compose file in canonical formatcp Copy files/folders between a service container and the local filesystemcreate Creates containers for a service.down Stop and remove containers, networksevents Receive real time events from containers.exec Execute a command in a running container.images List images used by the created containerskill Force stop service containers.logs View output from containersls List running compose projectspause Pause servicesport Print the public port for a port binding.ps List containerspull Pull service imagespush Push service imagesrestart Restart service containersrm Removes stopped service containersrun Run a one-off command on a service.start Start servicesstop Stop servicestop Display the running processesunpause Unpause servicesup Create and start containersversion Show the Docker Compose version informationwait Block until the first service container stopsRun 'docker compose COMMAND --help' for more information on a command.
- 指定
jumpserver-allinone-compose.yaml
文件执行命令快速部署:
docker compose -f jumpserver-allinone-compose.yaml up -d
执行此步骤耐心等待,正常情况输出如下信息:
[root@jumpServer ~]# docker compose -f jumpserver-allinone-compose.yaml up -d
[+] Running 51/51✔ jumpserver 34 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 1597.9s ✔ b70638ed4228 Pull complete 26.3s ✔ 1671b05d5ff8 Pull complete 14.2s ✔ cf6d41d3b58e Pull complete 15.3s ✔ 4658ace5181e Pull complete 26.8s ✔ 7d89f2b712aa Pull complete 19.0s ✔ 27f0595597bf Pull complete 1371.3s ✔ 5e1c9213656f Pull complete 30.6s ✔ 6b08cbabd196 Pull complete 59.3s ✔ d5e6b8f645d0 Pull complete 33.5s ✔ e61f3aac1553 Pull complete 35.3s ✔ 38e8b0b2cb1d Pull complete 37.2s ✔ 4f4fb700ef54 Pull complete 106.2s ✔ 0c2dc397c237 Pull complete 153.2s ✔ fdf489862f49 Pull complete 115.6s ✔ 7d15347457c2 Pull complete 122.3s ✔ 9ee083a8a7ed Pull complete 127.2s ✔ 3028c2686750 Pull complete 134.0s ✔ 5c15a5371a5f Pull complete 136.6s ✔ df85ed73d9c7 Pull complete 175.0s ✔ 0fbce6cdb40f Pull complete 180.1s ✔ 58780c9b73c1 Pull complete 430.0s ✔ 8370e2af9b40 Pull complete 185.8s ✔ cd0ff3c5c678 Pull complete 205.5s ✔ 46772bf55cde Pull complete 222.4s ✔ e58fedb6f561 Pull complete 227.6s ✔ 361691cd930c Pull complete 257.6s ✔ 181b8c1b3ce9 Pull complete 274.7s ✔ 282738152c09 Pull complete 291.6s ✔ 9b9cbb19c5bf Pull complete 299.0s ✔ 0256f5cdf016 Pull complete 314.0s ✔ bdf2050c3e51 Pull complete 315.9s ✔ 34b12bf59808 Pull complete 331.0s ✔ 1676acb3a378 Pull complete 344.4s ✔ c009086876be Pull complete 346.3s ✔ mariadb 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 484.5s ✔ 7a2c55901189 Pull complete 370.2s ✔ 7eb404fb6599 Pull complete 385.5s ✔ b82494ba74d0 Pull complete 391.6s ✔ c12aefc63360 Pull complete 394.9s ✔ 755d4f319cad Pull complete 397.0s ✔ 3a356b485f3e Pull complete 429.8s ✔ 58cecd92a800 Pull complete 442.3s ✔ 1a788b911657 Pull complete 442.4s ✔ redis 6 layers [⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 520.5s ✔ a378f10b3218 Pull complete 454.1s ✔ a18aae639f26 Pull complete 447.5s ✔ cc636628b1d6 Pull complete 451.5s ✔ 28d286c885bb Pull complete 458.1s ✔ eb5d7888e466 Pull complete 456.4s ✔ 94ae6bcf7a05 Pull complete 471.0s
[+] Running 4/4✔ Network root_net Created 7.2s ✔ Container jms_mariadb Healthy 5.6s ✔ Container jms_redis Healthy 5.6s ✔ Container jms_all Created 2.0s
...
如果出现如下错误信息:
说明:该问题已经反馈 github issues,请查看https://github.com/jumpserver/jumpserver/issues/11983
[+] Running 4/4✔ Network root_net Created 7.2s ✘ Container jms_mariadb Error 5.6s✔ Container jms_redis Healthy 5.6s ✔ Container jms_all Created 2.0s
dependency failed to start: container jms_mariadb is unhealthy
继续查看 168b11c99368 mariadb:10.11
容器日志信息:
[root@jumpServer ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
168b11c99368 mariadb:10.11 "docker-entrypoint.s…" About a minute ago Up About a minute (unhealthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp jms_mariadb
a1a18950bf2c redis:6.2 "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp jms_redis
[root@jumpServer ~]# docker container logs 168b11c99368
2023-10-25 22:27:25+08:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.5+maria~ubu2204 started.
2023-10-25 22:27:26+08:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-10-25 22:27:26+08:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.5+maria~ubu2204 started.
2023-10-25 22:27:26+08:00 [Note] [Entrypoint]: Initializing database filesPLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:'/usr/bin/mariadb-secure-installation'which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.See the MariaDB Knowledgebase at https://mariadb.com/kbPlease report any problems at https://mariadb.org/jiraThe latest information about MariaDB is available at https://mariadb.org/.Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/2023-10-25 22:28:35+08:00 [Note] [Entrypoint]: Database files initialized
2023-10-25 22:28:35+08:00 [Note] [Entrypoint]: Starting temporary server
2023-10-25 22:28:35+08:00 [Note] [Entrypoint]: Waiting for server startup
2023-10-25 22:28:35 0 [Note] Starting MariaDB 10.11.5-MariaDB-1:10.11.5+maria~ubu2204-log source revision 7875294b6b74b53dd3aaa723e6cc103d2bb47b2c as process 141
2023-10-25 22:28:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-10-25 22:28:36 0 [Note] InnoDB: Number of transaction pools: 1
2023-10-25 22:28:36 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-10-25 22:28:36 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-10-25 22:28:36 0 [Note] InnoDB: Using liburing
2023-10-25 22:28:36 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-10-25 22:28:36 0 [Note] InnoDB: Completed initialization of buffer pool
2023-10-25 22:28:36 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2023-10-25 22:28:36 0 [Note] InnoDB: End of log at LSN=46438
2023-10-25 22:28:36 0 [Note] InnoDB: 128 rollback segments are active.
2023-10-25 22:28:36 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-10-25 22:28:36 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-10-25 22:28:36 0 [Note] InnoDB: log sequence number 46438; transaction id 14
2023-10-25 22:28:36 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-10-25 22:28:37 0 [Warning] 'user' entry 'root@168b11c99368' ignored in --skip-name-resolve mode.
2023-10-25 22:28:37 0 [Warning] 'proxies_priv' entry '@% root@168b11c99368' ignored in --skip-name-resolve mode.
2023-10-25 22:28:37 0 [Note] mariadbd: ready for connections.
Version: '10.11.5-MariaDB-1:10.11.5+maria~ubu2204-log' socket: '/run/mysqld/mysqld.sock' port: 0 mariadb.org binary distribution
2023-10-25 22:28:38+08:00 [Note] [Entrypoint]: Temporary server started.
2023-10-25 22:28:47+08:00 [Note] [Entrypoint]: Creating database jumpserver
2023-10-25 22:28:47+08:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)2023-10-25 22:28:48+08:00 [Note] [Entrypoint]: Stopping temporary server
2023-10-25 22:28:48 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
2023-10-25 22:28:48 0 [Note] InnoDB: FTS optimize thread exiting.
2023-10-25 22:28:49 0 [Note] InnoDB: Starting shutdown...
2023-10-25 22:28:49 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2023-10-25 22:28:49 0 [Note] InnoDB: Buffer pool(s) dump completed at 231025 22:28:49
2023-10-25 22:28:50 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2023-10-25 22:28:50 0 [Note] InnoDB: Shutdown completed; log sequence number 46438; transaction id 15
2023-10-25 22:28:50 0 [Note] mariadbd: Shutdown complete2023-10-25 22:28:50+08:00 [Note] [Entrypoint]: Temporary server stopped2023-10-25 22:28:50+08:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.2023-10-25 22:28:50 0 [Note] Starting MariaDB 10.11.5-MariaDB-1:10.11.5+maria~ubu2204-log source revision 7875294b6b74b53dd3aaa723e6cc103d2bb47b2c as process 1
2023-10-25 22:28:50 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-10-25 22:28:50 0 [Note] InnoDB: Number of transaction pools: 1
2023-10-25 22:28:50 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-10-25 22:28:50 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-10-25 22:28:50 0 [Note] InnoDB: Using liburing
2023-10-25 22:28:50 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-10-25 22:28:50 0 [Note] InnoDB: Completed initialization of buffer pool
2023-10-25 22:28:50 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2023-10-25 22:28:50 0 [Note] InnoDB: End of log at LSN=46438
2023-10-25 22:28:50 0 [Note] InnoDB: 128 rollback segments are active.
2023-10-25 22:28:50 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-10-25 22:28:50 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-10-25 22:28:50 0 [Note] InnoDB: log sequence number 46438; transaction id 14
2023-10-25 22:28:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-10-25 22:28:50 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-10-25 22:28:50 0 [Note] InnoDB: Buffer pool(s) load completed at 231025 22:28:50
2023-10-25 22:28:50 0 [Note] Server socket created on IP: '0.0.0.0'.
2023-10-25 22:28:50 0 [Note] Server socket created on IP: '::'.
2023-10-25 22:28:51 0 [Note] mariadbd: ready for connections.
Version: '10.11.5-MariaDB-1:10.11.5+maria~ubu2204-log' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
继续进入容器查看:
docker 进入当前正在运行容器的两种方式(exec 和 attach 的区别),https://blog.csdn.net/Starrysky_LTL/article/details/121168670
- 测试完毕后清理环境:
docker compose -f jumpserver-allinone-compose.yaml down -v
输出如下信息:
[root@jumpServer ~]# docker compose -f jumpserver-allinone-compose.yaml down
[+] Running 4/4✔ Container jms_all Removed 0.0s ✔ Container jms_mariadb Removed 5.2s ✔ Container jms_redis Removed 5.0s ✔ Network root_net Removed 1.1s
4、查看 Docker 镜像
通过 compose.yaml
文件拉取的 docker
镜像(image
)如下:
[root@jumpServer ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
jumpserver/jms_all latest a4428decf662 4 days ago 3.48GB
redis 6.2 81f00da770d8 6 days ago 127MB
mariadb 10.11 3b3ad3b80a5c 11 days ago 395MB
验证 JumpServer 安装
浏览器查看 JumpServer
:
- 地址:
http://<JumpServer服务器IP地址>:<服务运行端口>
- 用户名:
admin
- 密码:
admin
首次登陆需要修改初始密码,修改后再次登录即可进入系统。
相关文章:

openEuler 22.03 LTS 环境使用 Docker Compose 一键部署 JumpServer (all-in-one 模式)
环境回顾 上一篇文章中,我们讲解了 openEuler 22.03 LTS 安装 Docker CE 和 Dcoker Compose,部署的软件环境版本分别如下: OS 系统:openEuler 22.03 LTS(openEuler-22.03-LTS-x86_64-dvd.iso)Docker Engine:Docker C…...

宏电5G RedCap工业智能网关获首个中国移动5G物联网开放实验室5G及轻量化产品能力认证
10月21日,2023世界物联网博览会——中国移动物联网开发者大会暨物联网产业论坛在无锡圆满举行。宏电股份参与中国移动5G物联网开放实验室5G及轻量化产品能力认证成果授牌仪式,并获得认证证书。 此次认证主要对产品功能、产品性能、RedCap网络兼容性进行测…...

MySQL查询今日、昨日、最近七天的数据
查询今日数据 sql语句: SELECT * FROM short_oper_log WHERE to_days(login_time) to_days(now());运行结果: 查询昨日数据 sql语句: SELECT * FROM short_oper_log WHERE DATEDIFF(login_time,NOW()) -1;运行结果: 额外…...
Oracle 19c新特性:DBCA静默模式克隆远端PDB
源库为ORCL中的orclpdb1,目标库为ORCL2。版本均为19c。 我们将利用19c中dbca新支持的-createFromRemotePDB选项来从远端克隆PDB。 确认源库中有业务数据: SQL> connect hrorclpdb1 Enter password: Connected. SQL> select count(*) from hr.em…...
css:如何通过不同的值,改变盒子的样式和字体颜色通过computed而不是v-if
在使用uni-app编写功能时,可以通过computed方法来实现根据num这个值也可以是后端传过来的值只要是number类型都可以。不同取值来修改盒子的背景颜色和字体颜色。首先,在data中定义一个num来存储当前的值,然后在computed中创建一个样式对象&am…...
做外贸真诚是最好的套路
在朋友圈发装柜的照片,之前合作的一些其他供应商看到了就问:最近生意怎样啊?看着好像挺多货出的,怎么最近都没跟我拿货啊? 空了我就回复:最近一般啊,有人做得很好,单很多࿰…...

RPA厂商大比拼,哪家才更适合您?
引言:随着数字化时代的到来,自动化已成为推动企业数字化发展的关键举措之一,RPA作为自动化中的重要技术之一,可为企业提供了实现业务流程自动化的强大工具。然而,如何选择适合自己的RPA厂商也是各大企业现在面临的难题…...
更换网络ip地址怎么设置
在互联网时代,网络已经成为我们生活中不可或缺的一部分。随着网络技术的不断发展,IP地址作为网络通信中的重要标识,其重要性日益凸显。在某些情况下,我们需要更换网络IP地址以保护自己的信息安全。那么,更换网络IP地址…...

开始学习Go编程
探索Go编程中的语法、数据类型和控制流 Go,又称为Golang,因其简单性、性能和效率而广受欢迎。在本文中,我们将深入研究构成Go编程语言基础的基本概念。从理解其语法和数据类型到掌握控制流和函数,我们将为您提供启动Go编程之旅所…...

《SpringBoot项目实战》第五篇—接口发生异常如何统一处理
系列文章导航 第一篇—接口参数的一些弯弯绕绕 第二篇—接口用户上下文的设计与实现 第三篇—留下用户调用接口的痕迹 第四篇—接口的权限控制 第五篇—接口发生异常如何统一处理 本文参考项目源码地址:summo-springboot-interface-demo 前言 大家好!…...

vue+golang上传微信头像
<button class"avatar" open-type"chooseAvatar" chooseavatar"onChooseAvatar"><image :src"avatarUrl" class"avatar-img"></image></button> // 微信头像修改onChooseAvatar(e) {this.uploadFil…...
JavaScript charCodeAt() 方法
charCodeAt() 方法是 JavaScript 字符串对象的一个方法,它用于返回给定位置的字符的 Unicode 编码值(整数)。Unicode 编码是一个标识字符的数字,它包含了世界上几乎所有字符的映射,包括常见字符、特殊字符和表情符号。…...

Talk | 纽约州立宾汉姆顿大学博士生丁琰:开放环境中机器人的任务与动作规划
本期为TechBeat人工智能社区第541期线上Talk。 北京时间10月26日(周四)20:00,纽约州立宾汉姆顿大学博士生—丁琰的Talk已准时在TechBeat人工智能社区开播! 他与大家分享的主题是: “开放环境中机器人的任务与动作规划”࿰…...

2023年Q3企业邮箱安全性报告:境内钓鱼邮件超过境外攻击
10月25日,Coremail邮件安全联合北京中睿天下信息技术有限公司发布《2023年第三季度企业邮箱安全性研究报告》。2023年第三季度企业邮箱安全呈现出何种态势?作为邮箱管理员,我们又该如何做好防护? 以下为精华版阅读,如需…...

WebSocket 原理揭秘:让你彻底搞懂 Websocket 原理
WebSocket 的原理 WebSocket 是什么? WebSocket 是一种新型的协议,它可以在客户端和服务器之间建立长连接,实现双向通信。在传统的 HTTP 协议中,当客户端向服务器发送请求后,服务器会返回响应,然后连接就…...
react中的函数式组件和类式组件
一、函数组件 1. 定义函数组件 在React中,函数组件(Functional Component)是一种通过纯粹的JavaScript函数定义的UI组件。函数组件采用函数的方式接收一个输入参数 props,并返回一个React元素或者一组React元素作为输出。定义函…...
Visual Studio 2022 设置 PySide6 扩展工具
前言 本人不想电脑上装一堆的IDE,所以把 Python 开发也交给了 Visual Studio,如果你不是用 Visual Studio 做 Python 开发,下文就不用看了。 PySide简介 PySide跟PyQt类似,都是支持Python的Qt包,不同的是,PyQt是第三方的,PySide是Qt官方的。 PySide的推出比PyQt晚很…...

【高效开发工具系列】Postman
💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:kuan 的首页,持续学…...

汇编语言王爽第四版17.3完程可运行可调试
汇编语言王爽第四版17.3节完整程序,可调试,可运行。 最基本的字符串输入程序,具备以下功能: 1、在输入的同时需要显示这个字符串; 2、输入回车符后,一个字符串的输入结束; 3、能够删除已经输入…...

CH9329芯片应用—简介
概述 CH9329是一款串口转USB HID设备功能芯片,根据不同的工作模式,HID设备可以识别为:USB键盘设备、USB鼠标设备或者自定义HID类设备。接收串口数据,并自动根据串口工作模式进行数据解析,解析完成后按照HID类设备规范…...

XCTF-web-easyupload
试了试php,php7,pht,phtml等,都没有用 尝试.user.ini 抓包修改将.user.ini修改为jpg图片 在上传一个123.jpg 用蚁剑连接,得到flag...
Vue记事本应用实现教程
文章目录 1. 项目介绍2. 开发环境准备3. 设计应用界面4. 创建Vue实例和数据模型5. 实现记事本功能5.1 添加新记事项5.2 删除记事项5.3 清空所有记事 6. 添加样式7. 功能扩展:显示创建时间8. 功能扩展:记事项搜索9. 完整代码10. Vue知识点解析10.1 数据绑…...
React Native 开发环境搭建(全平台详解)
React Native 开发环境搭建(全平台详解) 在开始使用 React Native 开发移动应用之前,正确设置开发环境是至关重要的一步。本文将为你提供一份全面的指南,涵盖 macOS 和 Windows 平台的配置步骤,如何在 Android 和 iOS…...
《Playwright:微软的自动化测试工具详解》
Playwright 简介:声明内容来自网络,将内容拼接整理出来的文档 Playwright 是微软开发的自动化测试工具,支持 Chrome、Firefox、Safari 等主流浏览器,提供多语言 API(Python、JavaScript、Java、.NET)。它的特点包括&a…...
线程与协程
1. 线程与协程 1.1. “函数调用级别”的切换、上下文切换 1. 函数调用级别的切换 “函数调用级别的切换”是指:像函数调用/返回一样轻量地完成任务切换。 举例说明: 当你在程序中写一个函数调用: funcA() 然后 funcA 执行完后返回&…...

算法笔记2
1.字符串拼接最好用StringBuilder,不用String 2.创建List<>类型的数组并创建内存 List arr[] new ArrayList[26]; Arrays.setAll(arr, i -> new ArrayList<>()); 3.去掉首尾空格...
探索Selenium:自动化测试的神奇钥匙
目录 一、Selenium 是什么1.1 定义与概念1.2 发展历程1.3 功能概述 二、Selenium 工作原理剖析2.1 架构组成2.2 工作流程2.3 通信机制 三、Selenium 的优势3.1 跨浏览器与平台支持3.2 丰富的语言支持3.3 强大的社区支持 四、Selenium 的应用场景4.1 Web 应用自动化测试4.2 数据…...

VSCode 使用CMake 构建 Qt 5 窗口程序
首先,目录结构如下图: 运行效果: cmake -B build cmake --build build 运行: windeployqt.exe F:\testQt5\build\Debug\app.exe main.cpp #include "mainwindow.h"#include <QAppli...

篇章一 论坛系统——前置知识
目录 1.软件开发 1.1 软件的生命周期 1.2 面向对象 1.3 CS、BS架构 1.CS架构编辑 2.BS架构 1.4 软件需求 1.需求分类 2.需求获取 1.5 需求分析 1. 工作内容 1.6 面向对象分析 1.OOA的任务 2.统一建模语言UML 3. 用例模型 3.1 用例图的元素 3.2 建立用例模型 …...
DriveGPT4: Interpretable End-to-end Autonomous Driving via Large Language Model
一、研究背景与创新点 (一)现有方法的局限性 当前智驾系统面临两大核心挑战:一是长尾问题,即系统在遇到新场景时可能失效,例如突发交通状况或非常规道路环境;二是可解释性问题,传统方法无法解释智驾系统的决策过程,用户难以理解车辆行为的依据。传统语言模型(如 BERT…...