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 EngineDocker CE(Docker Engine - Community v24.0.6)
  • Docker ComposeDocker Compose v2.21.0

接着上面部署的环境,我们继续讲解如何使用 docker compose 一键部署 JumpServer (all-in-one 模式)。
docker-compose

Compose 部署步骤

编排文件是使用 Docker Compose 的核心,支持 compose.yaml 或者compose.yml 作为默认名称,也向后兼容 docker-compose.yamldocker-compose.yml,如果这些文件都存在则首选 compose.yaml。你也可以使用其他名称,只是需要在启动的时候指定文件名。

  • Docker EngineCompose 版本支持列表
Compose file formatDocker Engine release
Compose specification19.03.0+
3.819.03.0+
3.718.06.0+
3.618.02.0+
3.517.12.0+
3.417.09.0+
3.317.06.0+
3.217.04.0+
3.11.13.1+
3.01.13.0+
2.417.12.0+
2.317.06.0+
2.21.13.0+
2.11.12.0+
2.01.10.0+

关于 dockercompose 支持矩阵更多信息,请查看官方文档 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

首次登陆需要修改初始密码,修改后再次登录即可进入系统。

在这里插入图片描述

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

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

相关文章

Linux--进程等待

1.什么是进程等待 1.通过系统调用wait/waitid,来对子进程进行进行检测和回收的功能。 2.为什么有进程等待 1.对于每个进程来说&#xff0c;如果子进程终止&#xff0c;父进程没有停止&#xff0c;就会形成僵尸进程&#xff0c;导致内存泄露&#xff0c;为了防止僵尸进程的形成…

GIT在window是 配置SSHKEY

1、打开你得命令行工具&#xff0c;输入&#xff1a; cd ~/.ssh2、生成密钥 #设置自己的邮箱&#xff0c;随意设置 $ ssh-keygen -t rsa -C "wqzbxh163.com"#输入保存密钥的文件名字 Enter file in which to save the key (/c/Users/dahai/.ssh/id_rsa): wqzbxh剩下…

SpringBoot集成Redis Cluster集群(附带Linux部署Redis Cluster高可用集群)

目录 一、前言二、集成配置2.1、POM2.2、添加配置文件application.yml2.3、编写配置文件2.4、编写启动类2.5、编写测试类测试是否连接成功 一、前言 这里会使用到spring-boot-starter-data-redis包&#xff0c;spring boot 2的spring-boot-starter-data-redis中&#xff0c;默…

域名系统 DNS

DNS 概述 域名系统 DNS(Domain Name System)是因特网使用的命名系统&#xff0c;用来把便于人们使用的机器名字转换成为 IP 地址。域名系统其实就是名字系统。为什么不叫“名字”而叫“域名”呢&#xff1f;这是因为在这种因特网的命名系统中使用了许多的“域(domain)”&#x…

2023年最受欢迎的11个UI设计师网站,助你成为行业翘楚

作为一名优秀的UI设计师&#xff0c;快速寻找灵感&#xff0c;保持审美在线&#xff0c;了解行业动态绝对是一项职业必备技能。 今天小编为各位小伙伴整理了一些UI设计师必看的绝佳网站。你可以从这些网站中了解行业最新动态&#xff0c;寻找创意灵感、学习优秀作品&#xff0…

ModbusTCP 转 Profinet 主站网关控制汇川伺服驱动器配置案例

ModbusTCP Client 通过 ModbusTCP 控制 Profinet 接口设备&#xff0c;Profinet 接口设备接入 DCS/工控机等 兴达易控ModbusTCP转Profinet主站网关&#xff08;XD-ETHPNM20&#xff09;采用数据映射方式进行工作。 使用设备&#xff1a;兴达易控ModbusTCP 转 Profinet 主站网关…

DeOldify 接口化改造 集成 Flask

类似的图片修复项目 GFPGAN 的改造见我另一篇文 https://blog.csdn.net/weixin_43074462/article/details/132497146 DeOldify 是一款开源软件&#xff0c;用于给黑白照片或视频上色&#xff0c;效果还不错。 安装部署教程请参考别的文章&#xff0c;本文基于你给项目跑通&…

【MySQL索引与优化篇】索引的数据结构

文章目录 1. 概述2. 常见索引结构2.1 聚簇索引2.2 二级索引(辅助索引、非聚簇索引)2.3 联合索引 3. InnoDB的B树索引的注意事项3.1 根页面位置万年不动3.2 内节点中目录项记录的唯一性 4. MyISAM中的索引方案5. InnoDB和MyISAM对比6. 小结7. 补充&#xff1a;MySQL数据结构的合…

JavaWeb——关于servlet种mapping地址映射的一些问题

6、Servlet 6.4、Mapping问题 一个Servlet可以指定一个映射路径 <servlet-mapping><servlet-name>hello</servlet-name><url-pattern>/hello</url-pattern> </servlet-mapping>一个Servlet可以指定多个映射路径 <servlet-mapping>&…

JAVA-编程基础-11-04-java IO 字符流

Lison <dreamlison163.com>, v1.0.0, 2023.05.07 JAVA-编程基础-11-04-java IO 字符流 文章目录 JAVA-编程基础-11-04-java IO 字符流字符流Reader 和 Writer字符输入流&#xff08;Reader&#xff09;**FileReader构造方法****FileReader读取字符数据** 字符输出流&am…

信道数据传输速率、信号传播速度——参考《天勤计算机网络》

一、缘起题目 二、解析 三、总结 信道数据传输速率和信号传播速度是两个不同的概念。 3.1 信道数据传输速率&#xff08;Channel Data Transfer Rate&#xff09; 指的是在通信系统中&#xff0c;通过信道传输的数据量&#xff0c;通常以 比特率&#xff08;bits per second…

RPA厂商大比拼,哪家才更适合您?

引言&#xff1a;随着数字化时代的到来&#xff0c;自动化已成为推动企业数字化发展的关键举措之一&#xff0c;RPA作为自动化中的重要技术之一&#xff0c;可为企业提供了实现业务流程自动化的强大工具。然而&#xff0c;如何选择适合自己的RPA厂商也是各大企业现在面临的难题…

Use nvidia card in docker

1.确保在宿主机上已经安装了nvidia 显卡的驱动 $ nvidia-smi 2.准备Nvidia-docker的环境 $ distribution$(. /etc/os-release;echo $ID$VERSION_ID) && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/k…

用爬虫代码爬取高音质音频示例

目录 一、准备工作 1、安装Python和相关库 2、确定目标网站和数据结构 二、编写爬虫代码 1、导入库 2、设置代理IP 3、发送HTTP请求并解析HTML页面 4、查找音频文件链接 5、提取音频文件名和下载链接 6、下载音频文件 三、完整代码示例 四、注意事项 1、遵守法律法…

22年上半年下午题

第一大题题目 第一大题解答 第一小问 看加工交互和说明来得出实体的名字。如果不太确定&#xff0c;可以多去看几条数据流来确认答案。仔细一点&#xff0c;这分稳啦。 第二小问 需要对应加工结合说明得出数据存储的名称。 一般可以在后面加上表字或者加上信息表。自拟&…

vscode推送gitee方法

有一套uni-app代码需要修改&#xff0c;版本控制使用vscode的git功能&#xff0c;远程库在gitee上。 1、设置vscode中git.exe路径 由于git使用了绿色便携版&#xff08;PortableGit-2.42.0.2-64-bit.7z.exe&#xff09;&#xff0c;vscode未识别到git安装路径&#xff0c;需要…

私有云:架构图

私有云&#xff1a;架构图 1、架构图2、服务器分配及配置3、本地物理机hosts文件配置4、相关软件包5、本地物理机电脑配置参考【内存最好20G往上】 机缘巧合之下突然想玩玩虚拟化&#xff0c;然后就查资料本地自己搭建一套私有云 使用【VMware Workstation】这个虚拟化软件来进…

爬虫采集如何解决ip被限制的问题呢?

在进行爬虫采集的过程中&#xff0c;很多开发者会遇到IP被限制的问题&#xff0c;这给采集工作带来了很大的不便。那么&#xff0c;如何解决这个问题呢&#xff1f;下面我们将从以下几个方面进行探讨。 一、了解网站的反爬机制 首先&#xff0c;我们需要了解目标网站的反爬机制…

基于 ARM+FPGA+AD平台的多类型同步信号采集仪开发及试验验证(二)板卡总体设计

2.2 板卡总体设计 本章开发了一款基于 AD7193RJ45 的多类型传感信号同步调理板卡&#xff0c;如图 2.4 所 示&#xff0c;负责将传感器传来的模拟电信号转化为数字信号&#xff0c;以供数据采集系统采集&#xff0c;实现了 单通道自由切换传感信号类型与同步采集多类型传…

Qt之彻底解决QSpinBox限定范围无效的问题

QSpinBox有个比较啃爹的问题,不管取值范围设置为多少,都能一直输入0,如下图所示: 当取值范围包含负数时,负号后也可以一直输入0,如下图所示: 还有就是当取值范围设置为10以上时,比如10~100,却可以输入1~9 虽然上述非法输入最终都未生效,当QSpinBox失去焦点时会显示为…