在Linux和Windows上安装seata-1.6.0
记录:381
场景:在CentOS 7.9操作系统上,安装seata-1.6.0。在Windows上操作系统上,安装seata-1.6.0。Seata,一款开源的分布式事务解决方案,致力于提供高性能和简单易用的分布式事务服务。
版本:
JDK 1.8
seata-1.6.0
CentOS 7.9
官网地址:https://seata.io/
源码地址:https://github.com/seata/seata
官网手册:https://seata.io/zh-cn/docs/ops/deploy-guide-beginner.html
Seata,一款开源的分布式事务解决方案,致力于提供高性能和简单易用的分布式事务服务。
Three roles in Seata Framework:
Transaction Coordinator(TC): Maintain status of global and branch transactions, drive the global commit or rollback.
Transaction Manager(TM): Define the scope of global transaction: begin a global transaction, commit or rollback a global transaction.
Resource Manager(RM): Manage resources that branch transactions working on, talk to TC for registering branch transactions and reporting status of branch transactions, and drive the branch transaction commit or rollback.
一、在Linux上安装seata
安装Seata,存储模式使用MySQL,服务发现和配置使用Nacos。
1.下载Seata
版本:v1.6.0
发布日期:Dec 17, 2022
下载地址:wget https://github.com/seata/seata/releases/download/v1.6.0/seata-server-1.6.0.tar.gz
下载包:seata-server-1.6.0.tar.gz
2.解压Seata
解压命令:tar -zxvf seata-server-1.6.0.tar.gz -C /opt/seata-1.6.0
解析:把seata-server-1.6.0.tar.gz解压到/opt/seata-1.6.0。在seata下的目录。bin目录是启动脚本。conf目录是配置文件。ext目录下是skywalking插件相关内容。lib目录是全量jar包。logs目录是日志包。script目录是脚本目录。target目录是seata-server.jar包。
3.初始化数据库脚本
本例存储模式使用MySQL数据库。
3.1创建数据库和用户
用户名/口令:hub_seata/12345678
数据库名称:hub_seatadb
登录控制台:mysql -u root -p
在MySQL命令行控制台执行脚本。
USE mysql;
CREATE DATABASE hub_seatadb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER hub_seata@'%' IDENTIFIED BY '12345678';
GRANT ALL ON hub_seatadb.* TO 'hub_seata'@'%' IDENTIFIED BY '12345678';
FLUSH PRIVILEGES;
3.2初始化seata数据库
脚本目录:/opt/seata-1.6.0/script/server/db/mysql.sql
初始化表:branch_table、distributed_lock、global_table、lock_table。
4.启动Nacos
启动脚本目录:/opt/nacos-2.1.1/bin
4.1启动Nacos
启动命令:sh startup.sh -m standalone
地址:http://127.0.0.1:18848/nacos
用户名/口令:nacos/nacos
4.2创建seata命名空间
命名空间名称:hub_seata
命名空间ID:142eba5f-a7b5-4a83-85bb-663c582c8ef1
5.配置seata
在/opt/seata-1.6.0/conf目录下,application.example.yml是配置文件的模板,包含全量配置。application.yml是应用启动时加载配置,根据实际情况按需从application.example.yml中拷贝添加就行
5.1修改application.yml配置
修改文件:/opt/seata-1.6.0/conf/application.yml
修改内容:
server:port: 7091
spring:application:name: seata-server
logging:config: classpath:logback-spring.xmlfile:path: ${user.home}/logs/seataextend:logstash-appender:destination: 127.0.0.1:4560kafka-appender:bootstrap-servers: 127.0.0.1:9092topic: logback_to_logstash
console:user:username: seatapassword: seata
seata:config:type: nacosnacos:server-addr: 192.168.19.203:18848namespace: 142eba5f-a7b5-4a83-85bb-663c582c8ef1group: SEATA_GROUPusername: nacospassword: nacoscontext-path:data-id: seataServer.propertiesregistry:type: nacosnacos:application: seata-serverserver-addr: 192.168.19.203:18848group: SEATA_GROUPnamespace: 142eba5f-a7b5-4a83-85bb-663c582c8ef1cluster: defaultusername: nacospassword: nacoscontext-path:store:mode: dbdb:datasource: druiddb-type: mysqldriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://192.168.19.202:3306/hub_seatadb?rewriteBatchedStatements=trueuser: hub_seatapassword: 12345678min-conn: 5max-conn: 100global-table: global_tablebranch-table: branch_tablelock-table: lock_tabledistributed-lock-table: distributed_lockquery-limit: 100max-wait: 5000 security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
5.2在Nacos新建seataServer.properties
5.2.1页面配置
在Nacos页面中,选择
命名空间:hub_seata。命名空间ID:142eba5f-a7b5-4a83-85bb-663c582c8ef1。创建配置seataServer.properties。
Data ID:seataServer.properties。
Group:SEATA_GROUP
配置格式:Properties
配置内容:从/opt/seata-1.6.0/script/config-center\config.txt文件中拷贝需求的配置。
本例从config.txt摘取的配置修改过的配置。
service.vgroupMapping.hub_tx_group=default
store.mode=db
store.lock.mode=db
store.session.mode=db
store.publicKey=123456
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://192.168.19.203:3306/hub_seatadb?useUnicode=true&rewriteBatchedStatements=true
store.db.user=hub_seata
store.db.password=12345678
解析:config.txt配置内容在源码包../seata-1.6.0/config/seata-config-core/src/main/resources/config.txt和安装包/opt/seata-1.6.0/script/config-center/config.txt两处位置都可以找到。
5.2.2配置生效
在Nacos中配置已经生效。
![](https://img-blog.csdnimg.cn/img_convert/a368d55951876009b0a8a485c8485069.png)
6启动seata
6.1启动seata
操作目录:/opt/seata-1.6.0/bin
启动命令:sh seata-server.sh
6.2查看seata日志
日志:/opt/seata-1.6.0/logs/start.out
命令:tail -f -n 300 /opt/seata-1.6.0/logs/start.out
6.3查看seata已注册
在Nacos已经注册了seata-server服务。
![](https://img-blog.csdnimg.cn/img_convert/1ec907c513a37ca30e728833e38a6971.png)
7基于普通用户使用seata
在启动seata时,不使用root用户直接启动,建议使用普通用户。
改变安装目录赋权给一个普通用户就可以。
7.1创建普通用户操作
创建用户命令:useradd learn
修改密码命令:passwd
解析:在执行passwd时,提示输入密码。可以查看用户信息:cat /etc/passwd。
7.2普通用户信息
用户名称/口令:learn/12345678
7.3把seata的安装目录赋权给普通用户
命令:chown -R learn:learn /opt/seata-1.6.0
7.4启动seata
切换用户:su learn
操作目录:/opt/seata-1.6.0/bin
启动命令:sh seata-server.sh
8.使用nacos-config.sh脚本加载配置
使用nacos-config.sh脚本加载config.txt配置到nacos。
脚本目录:/opt/seata-1.6.0/script/config-center/nacos
命令:sh nacos-config.sh -h 192.168.19.203 -p 18848 -g SEATA_GROUP -t 142eba5f-a7b5-4a83-85bb-663c582c8ef1 -u nacos -w nacos
解析:本例没有使用这种方式。
二、在Windows上安装seata
安装Seata,存储模式使用MySQL,服务发现和配置使用Nacos。
1.下载Seata
版本:v1.6.0
发布日期:Dec 17, 2022
下载地址:https://github.com/seata/seata/releases/download/v1.6.0/seata-server-1.6.0.zip
下载包:seata-server-1.6.0.zip
2.解压Seata
seata-server-1.6.0.zip包解压到D:\dev\hub\ali\seata-1.6.0。
在seata-1.6.0下的目录。bin目录是启动脚本。conf目录是配置文件。ext目录下是skywalking插件相关内容。lib目录是全量jar包。logs目录是日志包。script目录是脚本目录。target目录是seata-server.jar包。
3.初始化数据库脚本
本例存储模式使用MySQL数据库。
3.1创建数据库和用户
用户名/口令:hub_seata/12345678
数据库名称:hub_seatadb
登录控制台:mysql -u root -p
在MySQL命令行控制台执行脚本。
USE mysql;
CREATE DATABASE hub_seatadb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER hub_seata@'%' IDENTIFIED BY '12345678';
GRANT ALL ON hub_seatadb.* TO 'hub_seata'@'%' IDENTIFIED BY '12345678';
FLUSH PRIVILEGES;
3.2初始化seata数据库
脚本目录:seata\script\server\db\mysql.sql
初始化表:branch_table、distributed_lock、global_table、lock_table。
4.启动Nacos
启动脚本目录:D:\dev\hub\ali\nacos-2.1.1\nacos\bin
4.1启动Nacos
启动命令:sh startup.sh -m standalone
地址:http://192.168.19.203:18848/nacos
用户名/口令:nacos/nacos
4.2创建seata命名空间
命名空间名称:hub_seata
命名空间ID:142eba5f-a7b5-4a83-85bb-663c582c8ef1
5.配置seata
在..\seata\conf目录下,application.example.yml是配置文件的模板,包含全量配置。application.yml是应用启动时加载配置,根据实际情况按需从application.example.yml中拷贝添加就行
5.1修改application.yml配置
修改文件:application.yml
修改内容:
server:port: 7091
spring:application:name: seata-server
logging:config: classpath:logback-spring.xmlfile:path: ${user.home}/logs/seataextend:logstash-appender:destination: 127.0.0.1:4560kafka-appender:bootstrap-servers: 127.0.0.1:9092topic: logback_to_logstash
console:user:username: seatapassword: seata
seata:config:type: nacosnacos:server-addr: 127.0.0.1:18848namespace: 142eba5f-a7b5-4a83-85bb-663c582c8ef1group: SEATA_GROUPusername: nacospassword: nacoscontext-path:data-id: seataServer.propertiesregistry:type: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:18848group: SEATA_GROUPnamespace: 142eba5f-a7b5-4a83-85bb-663c582c8ef1cluster: defaultusername: nacospassword: nacoscontext-path:store:mode: dbdb:datasource: druiddb-type: mysqldriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/hub_seatadb?rewriteBatchedStatements=trueuser: hub_seatapassword: 12345678min-conn: 5max-conn: 100global-table: global_tablebranch-table: branch_tablelock-table: lock_tabledistributed-lock-table: distributed_lockquery-limit: 100max-wait: 5000 security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
5.2在Nacos新建seataServer.properties
5.2.1页面配置
在Nacos页面中,选择
命名空间:hub_seata。命名空间ID:142eba5f-a7b5-4a83-85bb-663c582c8ef1。创建配置seataServer.properties。
Data ID:seataServer.properties。
Group:SEATA_GROUP
配置格式:Properties
配置内容:从seata\script\config-center\config.txt文件中拷贝需求的配置。
本例从config.txt摘取的配置修改过的配置。
service.vgroupMapping.hub_tx_group=default
store.mode=db
store.lock.mode=db
store.session.mode=db
store.publicKey=123456
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/hub_seatadb?useUnicode=true&rewriteBatchedStatements=true
store.db.user=hub_seata
store.db.password=12345678
解析:config.txt配置内容在源码包seata-1.6.0\config\seata-config-core\src\main\resources\config.txt和编译包seata\script\config-center\config.txt两处位置都可以找到。
5.2.2配置生效
在Nacos中配置已经生效。
![](https://img-blog.csdnimg.cn/img_convert/c94081de3e4d0474a2a0a46facd289dd.png)
6启动seata
6.1启动seata
操作目录:..\seata\bin
双击seata-server.bat启动。
6.2查看seata已注册
在Nacos已经注册了seata-server服务。
![](https://img-blog.csdnimg.cn/img_convert/8a4b7bb4ba3f0c5b8000ace24e91cfb5.png)
三、官方配置和SQL脚本
配置文件均是官网原件。
1.mysql.sql
文件目录:/opt/seata-1.6.0/script/server/db
文件内容:
CREATE TABLE IF NOT EXISTS `global_table`
(`xid` VARCHAR(128) NOT NULL,`transaction_id` BIGINT,`status` TINYINT NOT NULL,`application_id` VARCHAR(32),`transaction_service_group` VARCHAR(32),`transaction_name` VARCHAR(128),`timeout` INT,`begin_time` BIGINT,`application_data` VARCHAR(2000),`gmt_create` DATETIME,`gmt_modified` DATETIME,PRIMARY KEY (`xid`),KEY `idx_status_gmt_modified` (`status` , `gmt_modified`),KEY `idx_transaction_id` (`transaction_id`)
) ENGINE = InnoDBDEFAULT CHARSET = utf8mb4;-- the table to store BranchSession data
CREATE TABLE IF NOT EXISTS `branch_table`
(`branch_id` BIGINT NOT NULL,`xid` VARCHAR(128) NOT NULL,`transaction_id` BIGINT,`resource_group_id` VARCHAR(32),`resource_id` VARCHAR(256),`branch_type` VARCHAR(8),`status` TINYINT,`client_id` VARCHAR(64),`application_data` VARCHAR(2000),`gmt_create` DATETIME(6),`gmt_modified` DATETIME(6),PRIMARY KEY (`branch_id`),KEY `idx_xid` (`xid`)
) ENGINE = InnoDBDEFAULT CHARSET = utf8mb4;-- the table to store lock data
CREATE TABLE IF NOT EXISTS `lock_table`
(`row_key` VARCHAR(128) NOT NULL,`xid` VARCHAR(128),`transaction_id` BIGINT,`branch_id` BIGINT NOT NULL,`resource_id` VARCHAR(256),`table_name` VARCHAR(32),`pk` VARCHAR(36),`status` TINYINT NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking',`gmt_create` DATETIME,`gmt_modified` DATETIME,PRIMARY KEY (`row_key`),KEY `idx_status` (`status`),KEY `idx_branch_id` (`branch_id`),KEY `idx_xid` (`xid`)
) ENGINE = InnoDBDEFAULT CHARSET = utf8mb4;CREATE TABLE IF NOT EXISTS `distributed_lock`
(`lock_key` CHAR(20) NOT NULL,`lock_value` VARCHAR(20) NOT NULL,`expire` BIGINT,primary key (`lock_key`)
) ENGINE = InnoDBDEFAULT CHARSET = utf8mb4;INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0);
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0);
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0);
INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0);
2.config.txt
文件目录:/opt/seata-1.6.0/script/config-center
文件内容:
#For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html
#Transport configuration, for client and server
transport.type=TCP
transport.server=NIO
transport.heartbeat=true
transport.enableTmClientBatchSendRequest=false
transport.enableRmClientBatchSendRequest=true
transport.enableTcServerBatchSendResponse=false
transport.rpcRmRequestTimeout=30000
transport.rpcTmRequestTimeout=30000
transport.rpcTcRequestTimeout=30000
transport.threadFactory.bossThreadPrefix=NettyBoss
transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker
transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler
transport.threadFactory.shareBossWorker=false
transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector
transport.threadFactory.clientSelectorThreadSize=1
transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread
transport.threadFactory.bossThreadSize=1
transport.threadFactory.workerThreadSize=default
transport.shutdown.wait=3
transport.serialization=seata
transport.compressor=none#Transaction routing rules configuration, only for the client
service.vgroupMapping.default_tx_group=default
#If you use a registry, you can ignore it
service.default.grouplist=127.0.0.1:8091
service.enableDegrade=false
service.disableGlobalTransaction=false#Transaction rule configuration, only for the client
client.rm.asyncCommitBufferLimit=10000
client.rm.lock.retryInterval=10
client.rm.lock.retryTimes=30
client.rm.lock.retryPolicyBranchRollbackOnConflict=true
client.rm.reportRetryCount=5
client.rm.tableMetaCheckEnable=true
client.rm.tableMetaCheckerInterval=60000
client.rm.sqlParserType=druid
client.rm.reportSuccessEnable=false
client.rm.sagaBranchRegisterEnable=false
client.rm.sagaJsonParser=fastjson
client.rm.tccActionInterceptorOrder=-2147482648
client.tm.commitRetryCount=5
client.tm.rollbackRetryCount=5
client.tm.defaultGlobalTransactionTimeout=60000
client.tm.degradeCheck=false
client.tm.degradeCheckAllowTimes=10
client.tm.degradeCheckPeriod=2000
client.tm.interceptorOrder=-2147482648
client.undo.dataValidation=true
client.undo.logSerialization=jackson
client.undo.onlyCareUpdateColumns=true
server.undo.logSaveDays=7
server.undo.logDeletePeriod=86400000
client.undo.logTable=undo_log
client.undo.compress.enable=true
client.undo.compress.type=zip
client.undo.compress.threshold=64k
#For TCC transaction mode
tcc.fence.logTableName=tcc_fence_log
tcc.fence.cleanPeriod=1h#Log rule configuration, for client and server
log.exceptionRate=100#Transaction storage configuration, only for the server. The file, db, and redis configuration values are optional.
store.mode=file
store.lock.mode=file
store.session.mode=file
#Used for password encryption
store.publicKey=#If `store.mode,store.lock.mode,store.session.mode` are not equal to `file`, you can remove the configuration block.
store.file.dir=file_store/data
store.file.maxBranchSessionSize=16384
store.file.maxGlobalSessionSize=512
store.file.fileWriteBufferCacheSize=16384
store.file.flushDiskMode=async
store.file.sessionReloadReadSize=100#These configurations are required if the `store mode` is `db`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `db`, you can remove the configuration block.
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=username
store.db.password=password
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.distributedLockTable=distributed_lock
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000#These configurations are required if the `store mode` is `redis`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `redis`, you can remove the configuration block.
store.redis.mode=single
store.redis.single.host=127.0.0.1
store.redis.single.port=6379
store.redis.sentinel.masterName=
store.redis.sentinel.sentinelHosts=
store.redis.maxConn=10
store.redis.minConn=1
store.redis.maxTotal=100
store.redis.database=0
store.redis.password=
store.redis.queryLimit=100#Transaction rule configuration, only for the server
server.recovery.committingRetryPeriod=1000
server.recovery.asynCommittingRetryPeriod=1000
server.recovery.rollbackingRetryPeriod=1000
server.recovery.timeoutRetryPeriod=1000
server.maxCommitRetryTimeout=-1
server.maxRollbackRetryTimeout=-1
server.rollbackRetryTimeoutUnlockEnable=false
server.distributedLockExpireTime=10000
server.xaerNotaRetryTimeout=60000
server.session.branchAsyncQueueSize=5000
server.session.enableBranchAsyncRemove=false
server.enableParallelRequestHandle=false#Metrics configuration, only for the server
metrics.enabled=false
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheusPort=9898
以上,感谢。
2023年2月19日
相关文章:
![](https://img-blog.csdnimg.cn/img_convert/8a4b7bb4ba3f0c5b8000ace24e91cfb5.png)
在Linux和Windows上安装seata-1.6.0
记录:381场景:在CentOS 7.9操作系统上,安装seata-1.6.0。在Windows上操作系统上,安装seata-1.6.0。Seata,一款开源的分布式事务解决方案,致力于提供高性能和简单易用的分布式事务服务。版本:JDK…...
![](https://img-blog.csdnimg.cn/img_convert/b3bf60e51e99c9772e5b8065181dc363.jpeg)
兼职任务平台收集(二)分享给有需要的朋友们
互联网时代,给人们带来了很大的便利。信息交流、生活缴费、足不出户购物、便捷出行、线上医疗、线上教育等等很多。可以说,网络的时代会一直存在着。很多人也在互联网上赚到了第一桶金,这跟他们的努力和付出是息息相关的。所谓一份耕耘&#…...
![](https://img-blog.csdnimg.cn/a822ed4da8864c01baa5809e97cda394.png)
目标检测三大数据格式VOC,YOLO,COCO的详细介绍
注:本文仅供学习,未经同意请勿转载 说明:该博客来源于xiaobai_Ry:2020年3月笔记 对应的PDF下载链接在:待上传 目录 目标检测常见数据集总结 V0C数据集(Annotation的格式是xmI) A. 数据集包含种类: B. V0C2007和V0C2012的区别…...
![](https://img-blog.csdnimg.cn/ffde03220a884be5ad765210536b916f.png)
SpringBoot实现统一返回接口(除AOP)
起因 关于使用AOP去实现统一返回接口在之前的博客中我们已经实现了,但我突然突发奇想,SpringBoot中异常类的统一返回好像是通过RestControllerAdvice 这个注解去完成的,那我是否也可以通过这个注解去实现统一返回接口。 正文 这个方法主要…...
![](https://www.ngui.cc/images/no-images.jpg)
ChatGpt - 基于人工智能检索进行论文写作
摘要 ChatGPT 是一款由 OpenAI 训练的大型语言模型,可用于各种自然语言处理任务,包括论文写作。使用 ChatGPT 可以帮助作者提高论文的语言流畅度、增强表达能力和提高文章质量。在写作过程中,作者可以使用 ChatGPT 生成自然语言的段落、句子、单词或者短语,作为启发式的写…...
![](https://img-blog.csdnimg.cn/img_convert/1b3ea23a7bf105ebaa0cc48157b6117d.png)
实例三:MATLAB APP design-多项式函数拟合
一、APP 界面设计展示 注:在左侧点击数据导入,选择自己的数据表,如果数据导入成功,在右侧的空白框就会显示数据导入成功。在多项式项数右侧框中输入项数,例如2、3、4等,点击计算按钮,右侧坐标框就会显示函数图像,在平均相对误差下面的空白框显示平均相对误差。...
![](https://www.ngui.cc/images/no-images.jpg)
springboot多种方式注入bean获取Bean
springboot动态注入bean1、创建Bean(demo)2、动态注入Bean3、通过注解注入Bean4、通过config配置注入Bean5、通过Import注解导入6、使用FactoryBean接口7、实现BeanDefinitionRegistryPostProcessor接口1、创建Bean(demo) Data public class Demo(){private String name;publi…...
![](https://img-blog.csdnimg.cn/img_convert/03c34b0ef08fcf773f62436d4527073b.png)
Markdown及其语法详细介绍(全面)
文章目录一、基本语法1.标题2.段落和换行3.强调4.列表5.链接6.图片7.引用8.代码9.分割线10表格二、扩展语法1.标题锚点标题 {#anchor}2.脚注3.自动链接4.任务列表5.删除线6.表情符号7.数学公式三、Markdown 应用1.文档编辑2.博客写作3.代码笔记四、常见的工具和平台支持 Markdo…...
![](https://img-blog.csdnimg.cn/img_convert/f1ac9f49e401671fe687b5f8b351e47e.png)
在Linux和Windows上安装sentinel-1.8.5
记录:380场景:在CentOS 7.9操作系统上,安装sentinel-1.8.5。在Windows上操作系统上,安装sentinel-1.8.5。Sentinel是面向分布式、多语言异构化服务架构的流量治理组件。版本:JDK 1.8 sentinel-1.8.5 CentOS 7.9官网地址…...
![](https://www.ngui.cc/images/no-images.jpg)
面试攻略,Java 基础面试 100 问(十)
StringBuffer、StringBuilder、String区别 线程安全 StringBuffer:线程安全,StringBuilder:线程不安全。 因为 StringBuffer 的所有公开方法都是 synchronized 修饰的,而 StringBuilder 并没有 synchronized 修饰。 StringBuf…...
![](https://img-blog.csdnimg.cn/4faeb281d50d49878b3ceccc8fbad66c.png)
Zero-shot(零次学习)简介
zero-shot基本概念 首先通过一个例子来引入zero-shot的概念。假设我们已知驴子和马的形态特征,又已知老虎和鬣狗都是又相间条纹的动物,熊猫和企鹅是黑白相间的动物,再次的基础上,我们定义斑马是黑白条纹相间的马科动物。不看任何斑…...
![](https://img-blog.csdnimg.cn/img_convert/db0ad53298bd140736b6b9f22c70206c.png)
51单片机简易电阻电感电容RLC测量仪仿真设计
51单片机简易电阻电感电容RLC测量仪仿真( proteus仿真程序讲解视频) 仿真图proteus7.8及以上 程序编译器:keil 4/keil 5 编程语言:C语言 设计编号:S0040 51单片机简易电阻电感电容RLC测量仪仿真51单片机最小系统的相关知识复位…...
![](https://img-blog.csdnimg.cn/1d263870538948119a178c4e90c60202.png)
[软件工程导论(第六版)]第6章 详细设计(课后习题详解)
文章目录1 假设只有SEQUENCE和DO-WHILE两种控制结构,怎样利用它们完成 IF THEN ELSE操作?2 假设只允许使用SEQUENCE和IF-THEN-ELSE两种控制结构,怎样利用它们完成DO WHILE操作?3 画出下列伪码程序的程序流程图和盒图:4…...
![](https://img-blog.csdnimg.cn/img_convert/aca738e3197c44c8bfee5453d88ed2cd.png)
【2.19】算法题2:贪心算法、动态规划、分治
题目:给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。子数组 是数组中的一个连续部分。方法一:贪心算法原理:若当前指针所指元素之前的和小…...
![](https://img-blog.csdnimg.cn/0ca47fe9a69d48af89f61117b80c1aa7.png)
【Redis】Redis 发布订阅通信模式 ( 发布订阅模式 | 订阅频道 | 发布消息 | 接收消息 )
文章目录一、发布订阅模式二、订阅频道三、发布消息四、接收消息一、发布订阅模式 Redis 中 存在一种 发布订阅 消息通信模式 : 消息发布者 : 负责发送消息 , 订阅者需要订阅该发布者频道 ;消息订阅者 : 负责接收消息 ; 订阅者 先 订阅 发布者频道 , 当 发布者 发布消息时 , …...
![](https://img-blog.csdnimg.cn/img_convert/be9371af6a559b24dfbe0f10be84c644.png)
VNCTF 2023复现
文章目录象棋王子电子木鱼BabyGo象棋王子 签到题,直接在源码中找就ok。 找到一处编码,在控制台输出。 flag为:flag{w3lc0m3_t0_VNCTF_2023~~~} 电子木鱼 需要先理清代码逻辑。 存在三个路由。 一:/路由用来查看当前的功德数量…...
![](https://img-blog.csdnimg.cn/img_convert/c2ea81d9b359a44ffff8b61f3d35a149.jpeg)
python基础知识有哪些需要背(记住是基础知识)我是初学者
大家好,小编来为大家解答以下问题,一个有趣的事情,一个有趣的事情,今天让我们一起来看看吧! 1、python基础知识有哪些需要背(记住是基础知识)我是初学者 或看好Python的广阔前景,或…...
![](https://www.ngui.cc/images/no-images.jpg)
Linux下TCP连接断开后不释放的解决办法
问题:在开发测试时发现断开与服务器端口后再次连接时拒绝连接。 分析:服务器上查看端口占用情况,假设端口为8888。 netstat -anp |grep 8888 发现端口8888端口显示被占用(ip为本机ip确定是上次连接)且状态为ESTABLI…...
![](https://www.ngui.cc/images/no-images.jpg)
1.关于嵌入式开发软件工程师的理解
学习嵌入式软件开发,首先要学会使用工具, 包括各种语言,C语言、FPGA、C等各种工具软件,各种芯片开发的IDE环境各种操作系统,Vxworks、Linux、Freertos等计算机基础,基本的框架结构,网络通信等编…...
![](https://www.ngui.cc/images/no-images.jpg)
1760字,让你拿捏 [‘列表‘]
如约而至,紧接着第一篇文章,小编将会陆续把自己精心做的全套Python笔记依次发放给大家,便于大家学习Python、期末备考、巩固基础等(这几期是公众号小插曲,后期发放编程技术的话主要还是会围绕Java来展开,感谢小伙伴们的…...
![](https://www.ngui.cc/images/no-images.jpg)
A562基于android的养老APP
需求信息: 1:家庭信息管理,包括家庭成员基本情况、性别、年龄、关系、工作单位、联系方式(手机号码、微信等); 2:个人健康数据管理,包括姓名、性别、年龄、关系、原工作单位、联系方式(手机号码…...
![](https://img-blog.csdnimg.cn/img_convert/27043b1d759ab08c72e163d174c9d0de.png)
java面试题-并发基础
1.多线程的出现是要解决什么问题的? 本质什么?提高程序性能:单线程程序只能按照固定的顺序依次执行每个任务,无法同时处理多个任务。多线程技术可以在同一时间内执行多个任务,从而提高程序的运行效率和响应速度。提高程序的并发性ÿ…...
![](https://www.ngui.cc/images/no-images.jpg)
用纯C语言实现3D空间中的点坐标转化为屏幕二维点坐标,包含主视图、侧视图、俯视图、正等轴投影
要实现3D空间中的点坐标转换为屏幕二维点坐标,需要进行透视变换和投影变换。以下是一些基本的思路和示例代码,可以用于实现主视图、侧视图、俯视图、正等轴投影。 1. 主视图投影 主视图投影是指以一个点作为视点,从一个方向观察物体&#x…...
![](https://www.ngui.cc/images/no-images.jpg)
.sh脚本文件的执行方式
方法1: ./xxx.sh方法2: source xxx.sh方法3: bash xxx.sh方法4: sh xxx.sh初识shell,学习并记录...
![](https://img-blog.csdnimg.cn/2021072514364380.png)
Android 基础知识4-2.5View与VIewGroup的概念、关系与区别
1.概念: Android里的图形界面都是由View和ViewGroup以及他们的子类构成的: View:所有可视化控件的父类,提供组件描绘和时间处理方法 ViewGroup: View类的子类,可以拥有子控件,可以看作是容器 Android UI中的控件都是…...
![](https://www.ngui.cc/images/no-images.jpg)
【ESP 保姆级教程】玩转巴法云篇① ——初识巴法云
忘记过去,超越自己 ❤️ 博客主页 单片机菜鸟哥,一个野生非专业硬件IOT爱好者 ❤️❤️ 本篇创建记录 2023-02-19 ❤️❤️ 本篇更新记录 2023-02-19 ❤️🎉 欢迎关注 🔎点赞 👍收藏 ⭐️留言📝🙏 此博客均由博主单独编写,不存在任何商业团队运营,如发现错误,请…...
![](https://img-blog.csdnimg.cn/4170c114015940b0acf1c1ab81f42270.png)
Python学习-----模块3.0(正则表达式-->re模块)
目录 前言: 导入模块 1.re.match() 函数 (1)匹配单个字符 (2)匹配多个字符 (3) 匹配开头和结尾 2.re.search() 函数 3.re.findall() 函数 4.re.finditer() 函数 5.re.split() 函数 6.re.sub() 函数 7.re.sub…...
![](https://img-blog.csdnimg.cn/40074eed0a7c47bea384eed43c0deef2.png)
JSP中http与内置对象学习笔记
本博文讲述jsp客户端与服务器端的http、jsp内置对象与控制流和数据流实现 1.HTTP请求响应机制 HTTP协议是TCP/IP协议中的一个应用层协议,用于定义客户端与服务器之间交换数据的过程 1.1 HTTP请求 HTTP请求由请求行、消息报头、空行和请求数据4部分组成。 请求行…...
![](https://img-blog.csdnimg.cn/img_convert/7829dfacca75fa0192455ebd1d2a3e9d.jpeg)
Windows Server 2016远程桌面配置全过程
镜像下载 系统镜像网址 本次下载的是 Windows Server 2016 (Updated Feb 2018) (x64) - DVD (Chinese-Simplified) 远程桌面配置 Step 1 在开始菜单搜索服务,打开服务器管理器,点击右上角的管理按钮 Step 2 添加角色控制,点击下一步 S…...
![](https://img-blog.csdnimg.cn/dbab8b9a9f3f40d99f98d2b4cc289845.png)
SPI通讯简介
一、基本概念 SPI是串行外设接口(Serial Peripheral Interface)的缩写,是一种高速的,全双工,同步的通信总线,主要应用在EEPROM,FLASH,实时时钟,AD转换器,多MCU间通讯等等,SPI端口可以在多主器件…...
![](/images/no-images.jpg)
wordpress编辑器富文本/电商运营主要负责什么
在asp.net core中则可以使用BuildBundlerMinifier来进行css,js的压缩合并 1、使用NuGet安装 BuildBundlerMinifier(也可以在vs中下载安装扩展Bundler & Minifier,手动压缩文件) 2、新建:bundleconfig.json 绑定和缩…...
![](/images/no-images.jpg)
宁波营销型网站建设优化建站/上海百度公司总部
经常遇到这样的情况,要取得所有客户的最新交易记录,读取网站所有浏览者最后一次访问时间。一个客户只读取最新的一次记录,相同,大部分的人首先想到的就是排除所有记录,相同的只取一条。用distint,但是distint只能取到一…...
![](/images/no-images.jpg)
做网站的电话号码/网络营销岗位描述的内容
Thread.sleep(long millis),一定是当前线程调用此方法,当前线程进入阻塞,但不释放对象锁,millis后线程自动苏醒进入可运行状态。Thread.yield(),一定是当前线程调用此方法,当前线程放弃获取的cpu时间片&…...
![](/images/no-images.jpg)
莱州网站开发/app拉新推广
php中$_FIELS函数在php中上传一个文件建一个表单要比ASP中灵活的多。具体的看代码。然后upload.php中可以直接用$_FIELS,$_POST,$_GET等函数获取表单内容。当客户端提交后,我们获得了一个$_FILES数组$_FILES数组内容如下:$_FILES[‘myFile’][‘name’]:…...
![](/images/no-images.jpg)
中国体育直播在线观看斯诺克赛/西安seo网站关键词
AngularJS 1.2版本中提供了Controller As语法,简单说就是可以在Controller中使用this来替代$scope,使得Controller更像一个传统的JS类,相对于$scope的继承树要理解上要简单一些。 基础用法 传统的Controller是这样写的: app.contr…...
![](/images/no-images.jpg)
做网站后台系统的规范/宁波seo外包费用
182. 删除数字 给出一个字符串 A, 表示一个 n 位正整数, 删除其中 k 位数字, 使得剩余的数字仍然按照原来的顺序排列产生一个新的正整数。 找到删除 k 个数字之后的最小正整数。 N < 240, k < N 样例给出一个字符串代表的正整数 A 和一个整数 k, 其中 A 178542, k 4 返…...