Mongodb数据库之主从复制配置实战

news2024/11/27 18:43:48

Mongodb数据库之主从复制配置实战

  • 一、本次实践环境规划
    • 1.环境规划
    • 2.副本集介绍
  • 二、检查本地Mongodb状态
    • 1.检查主节点Mongodb状态
    • 2.查看从节点mongodb状态
  • 三、创建mongodb用户
    • 1.进入主节点mongodb
    • 2.创建admin账号
    • 3.创建root账号
  • 四、全部节点的统一配置
    • 1.在主节点创建key文件
    • 2.将key文件发送两个从节点
    • 3.对相关目录及文件授权
    • 4.编辑/etc/mongod.conf文件
    • 5.重启mongodb服务
  • 五、配置一主两从副本集
    • 1.用户认证
    • 2.配置副本集
  • 六、查看mongodb主从状态
    • 1.主库查看副本集配置
    • 2.查看副本集状态
    • 3.判断主从节点
  • 七、测试mongodb主从切换
    • 1.停止主库
    • 2.查看从库状态

一、本次实践环境规划

1.环境规划

hostnameIP地址系统版本角色
k8s-master192.168.3.201centos 7.6主节点
k8s-node01192.168.3.202centos 7.6从节点
k8s-node02192.168.3.203centos 7.6从节点

2.副本集介绍

1.副本集在mongodb中是是一组 mongod保持相同的数据集过程,副本集提供冗余和高可用性,并且是所有生产部署的基础。

2.复制提供冗余并增加数据可用性,在不同数据库服务器上具有多个数据副本,复制可以提供一个级别的单一数据库服务器丢失的容错能力。

3.副本集至少需要3个成员,可以是一主两从,也可以是一主一从一仲裁节点,如果主节点挂掉,两个从节点会重新选举,找到一个从节点,将其提升为主。

二、检查本地Mongodb状态

1.检查主节点Mongodb状态

[root@k8s-master ~]# systemctl status mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-11-25 16:49:07 CST; 12min ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 51072 (mongod)
   CGroup: /system.slice/mongod.service
           └─51072 /usr/bin/mongod -f /etc/mongod.conf

Nov 25 16:49:06 k8s-master systemd[1]: Starting MongoDB Database Server...
Nov 25 16:49:06 k8s-master mongod[51069]: about to fork child process, waiting until server is ready for connections.
Nov 25 16:49:06 k8s-master mongod[51069]: forked process: 51072
Nov 25 16:49:07 k8s-master systemd[1]: Started MongoDB Database Server.


2.查看从节点mongodb状态

[root@k8s-node01 ~]# systemctl status mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-11-25 16:47:32 CST; 14min ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 47580 (mongod)
   CGroup: /system.slice/mongod.service
           └─47580 /usr/bin/mongod -f /etc/mongod.conf

Nov 25 16:47:31 k8s-node01 systemd[1]: Starting MongoDB Database Server...
Nov 25 16:47:31 k8s-node01 mongod[47577]: about to fork child process, waiting until server is ready for connections.
Nov 25 16:47:31 k8s-node01 mongod[47577]: forked process: 47580
Nov 25 16:47:32 k8s-node01 mongod[47577]: child process started successfully, parent exiting
Nov 25 16:47:32 k8s-node01 systemd[1]: Started MongoDB Database Server.



三、创建mongodb用户

1.进入主节点mongodb


[root@k8s-master ~]# mongo
MongoDB shell version v5.0.14
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("ff641498-a8f5-4ce4-bca4-1bb79fe06e37") }
MongoDB server version: 5.0.14
================
Warning: the "mongo" shell has been superseded by "mongosh",
which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in
an upcoming release.
For installation instructions, see
https://docs.mongodb.com/mongodb-shell/install/
================
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
	https://community.mongodb.com
---
The server generated these startup warnings when booting: 
        2022-11-25T16:49:07.312+08:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
        2022-11-25T16:49:07.312+08:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
        2022-11-25T16:49:07.312+08:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never'
---
---
        Enable MongoDB's free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc).

        The monitoring data will be available on a MongoDB website with a unique URL accessible to you
        and anyone you share the URL with. MongoDB may use this information to make product
        improvements and to suggest MongoDB products and deployment options to you.

        To enable free monitoring, run the following command: db.enableFreeMonitoring()
        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
> 


2.创建admin账号

use admin; 
db.createUser({
  user: "admin",
  pwd: "admin",
  roles: [
  {role: "userAdminAnyDatabase",db: "admin"}
  ]
}
)

image.png

3.创建root账号

>  use admin;
switched to db admin
> db.auth("admin", "admin")
1


db.createUser({
  user: "root",
  pwd: "redhat",
  roles: [   "root" ]
}
)


image.png

四、全部节点的统一配置

1.在主节点创建key文件


[root@k8s-master ~]# mkdir -p /data/mongodb/
[root@k8s-master ~]# openssl rand -base64 666 > /data/mongodb/mongodb.key
[root@k8s-master ~]# 


2.将key文件发送两个从节点

[root@k8s-master ~]# scp  /data/mongodb/mongodb.key root@192.168.3.203:/data/mongodb/
mongodb.key                                                                                                        100%  902     1.3MB/s   00:00    
[root@k8s-master ~]# scp  /data/mongodb/mongodb.key root@192.168.3.202:/data/mongodb/
mongodb.key                                                                                                        100%  902   936.6KB/s   00:00    
[root@k8s-master ~]# 


3.对相关目录及文件授权

3个节点都要进行授权操作

chown mongod:mongod -R /data/mongodb/
chmod 600 /data/mongodb/mongodb.key


4.编辑/etc/mongod.conf文件

修改/etc/mongod.conf 文件,3个节点全部都要配置。


[root@k8s-master ~]# cat /etc/mongod.conf 
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log
storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
  timeZoneInfo: /usr/share/zoneinfo
net:
  port: 27017
  bindIp: 0.0.0.0  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
security:
  authorization: enabled
  keyFile: /data/mongodb/mongodb.key
  clusterAuthMode: keyFile
replication:
  replSetName: rs0
  oplogSizeMB: 5000



5.重启mongodb服务


[root@k8s-master ~]# systemctl restart mongod
[root@k8s-master ~]# systemctl status  mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-11-25 19:25:17 CST; 6s ago
     Docs: https://docs.mongodb.org/manual
  Process: 71895 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 71893 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 71892 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 71889 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
 Main PID: 71898 (mongod)
    Tasks: 48
   Memory: 163.5M
   CGroup: /system.slice/mongod.service
           └─71898 /usr/bin/mongod -f /etc/mongod.conf

Nov 25 19:25:17 k8s-master systemd[1]: Starting MongoDB Database Server...
Nov 25 19:25:17 k8s-master mongod[71895]: about to fork child process, waiting until server is ready for connections.
Nov 25 19:25:17 k8s-master mongod[71895]: forked process: 71898
Nov 25 19:25:17 k8s-master mongod[71895]: child process started successfully, parent exiting
Nov 25 19:25:17 k8s-master systemd[1]: Started MongoDB Database Server.
[root@k8s-master ~]# 


五、配置一主两从副本集

1.用户认证

> use admin; 
switched to db admin
> db.auth("root", "redhat")
1
> 


2.配置副本集

rs.initiate({
   _id : "rs0",
   members: [
      { _id: 0, host: "192.168.3.201:27017" },
      { _id: 1, host: "192.168.3.202:27017" },
      { _id: 2, host: "192.168.3.203:27017" }
   ]
})




image.png

六、查看mongodb主从状态

1.主库查看副本集配置


rs0:PRIMARY> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
rs0:PRIMARY>
rs0:PRIMARY> rs.config()
{
	"_id" : "rs0",
	"version" : 1,
	"term" : 1,
	"members" : [
		{
			"_id" : 0,
			"host" : "192.168.3.201:27017",
			"arbiterOnly" : false,
			"buildIndexes" : true,
			"hidden" : false,
			"priority" : 1,
			"tags" : {
				
			},
			"secondaryDelaySecs" : NumberLong(0),
			"votes" : 1
		},
		{
			"_id" : 1,
			"host" : "192.168.3.202:27017",
			"arbiterOnly" : false,
			"buildIndexes" : true,
			"hidden" : false,
			"priority" : 1,
			"tags" : {
				
			},
			"secondaryDelaySecs" : NumberLong(0),
			"votes" : 1
		},
		{
			"_id" : 2,
			"host" : "192.168.3.203:27017",
			"arbiterOnly" : false,
			"buildIndexes" : true,
			"hidden" : false,
			"priority" : 1,
			"tags" : {
				
			},
			"secondaryDelaySecs" : NumberLong(0),
			"votes" : 1
		}
	],
	"protocolVersion" : NumberLong(1),
	"writeConcernMajorityJournalDefault" : true,
	"settings" : {
		"chainingAllowed" : true,
		"heartbeatIntervalMillis" : 2000,
		"heartbeatTimeoutSecs" : 10,
		"electionTimeoutMillis" : 10000,
		"catchUpTimeoutMillis" : -1,
		"catchUpTakeoverDelayMillis" : 30000,
		"getLastErrorModes" : {
			
		},
		"getLastErrorDefaults" : {
			"w" : 1,
			"wtimeout" : 0
		},
		"replicaSetId" : ObjectId("6380cfba32d52557ab398cd4")
	}
}
rs0:PRIMARY> 


2.查看副本集状态


s0:PRIMARY>  rs.status()
{
	"set" : "rs0",
	"date" : ISODate("2022-11-25T14:26:45.747Z"),
	"myState" : 1,
	"term" : NumberLong(1),
	"syncSourceHost" : "",
	"syncSourceId" : -1,
	"heartbeatIntervalMillis" : NumberLong(2000),
	"majorityVoteCount" : 2,
	"writeMajorityCount" : 2,
	"votingMembersCount" : 3,
	"writableVotingMembersCount" : 3,
	"optimes" : {
		"lastCommittedOpTime" : {
			"ts" : Timestamp(1669386401, 1),
			"t" : NumberLong(1)
		},
		"lastCommittedWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
		"readConcernMajorityOpTime" : {
			"ts" : Timestamp(1669386401, 1),
			"t" : NumberLong(1)
		},
		"appliedOpTime" : {
			"ts" : Timestamp(1669386401, 1),
			"t" : NumberLong(1)
		},
		"durableOpTime" : {
			"ts" : Timestamp(1669386401, 1),
			"t" : NumberLong(1)
		},
		"lastAppliedWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
		"lastDurableWallTime" : ISODate("2022-11-25T14:26:41.054Z")
	},
	"lastStableRecoveryTimestamp" : Timestamp(1669386341, 1),
	"electionCandidateMetrics" : {
		"lastElectionReason" : "electionTimeout",
		"lastElectionDate" : ISODate("2022-11-25T14:23:01.020Z"),
		"electionTerm" : NumberLong(1),
		"lastCommittedOpTimeAtElection" : {
			"ts" : Timestamp(1669386170, 1),
			"t" : NumberLong(-1)
		},
		"lastSeenOpTimeAtElection" : {
			"ts" : Timestamp(1669386170, 1),
			"t" : NumberLong(-1)
		},
		"numVotesNeeded" : 2,
		"priorityAtElection" : 1,
		"electionTimeoutMillis" : NumberLong(10000),
		"numCatchUpOps" : NumberLong(0),
		"newTermStartDate" : ISODate("2022-11-25T14:23:01.035Z"),
		"wMajorityWriteAvailabilityDate" : ISODate("2022-11-25T14:23:01.566Z")
	},
	"members" : [
		{
			"_id" : 0,
			"name" : "192.168.3.201:27017",
			"health" : 1,
			"state" : 1,
			"stateStr" : "PRIMARY",
			"uptime" : 1785,
			"optime" : {
				"ts" : Timestamp(1669386401, 1),
				"t" : NumberLong(1)
			},
			"optimeDate" : ISODate("2022-11-25T14:26:41Z"),
			"lastAppliedWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"lastDurableWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"syncSourceHost" : "",
			"syncSourceId" : -1,
			"infoMessage" : "",
			"electionTime" : Timestamp(1669386181, 1),
			"electionDate" : ISODate("2022-11-25T14:23:01Z"),
			"configVersion" : 1,
			"configTerm" : 1,
			"self" : true,
			"lastHeartbeatMessage" : ""
		},
		{
			"_id" : 1,
			"name" : "192.168.3.202:27017",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 235,
			"optime" : {
				"ts" : Timestamp(1669386401, 1),
				"t" : NumberLong(1)
			},
			"optimeDurable" : {
				"ts" : Timestamp(1669386401, 1),
				"t" : NumberLong(1)
			},
			"optimeDate" : ISODate("2022-11-25T14:26:41Z"),
			"optimeDurableDate" : ISODate("2022-11-25T14:26:41Z"),
			"lastAppliedWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"lastDurableWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"lastHeartbeat" : ISODate("2022-11-25T14:26:45.117Z"),
			"lastHeartbeatRecv" : ISODate("2022-11-25T14:26:44.113Z"),
			"pingMs" : NumberLong(0),
			"lastHeartbeatMessage" : "",
			"syncSourceHost" : "192.168.3.201:27017",
			"syncSourceId" : 0,
			"infoMessage" : "",
			"configVersion" : 1,
			"configTerm" : 1
		},
		{
			"_id" : 2,
			"name" : "192.168.3.203:27017",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 235,
			"optime" : {
				"ts" : Timestamp(1669386401, 1),
				"t" : NumberLong(1)
			},
			"optimeDurable" : {
				"ts" : Timestamp(1669386401, 1),
				"t" : NumberLong(1)
			},
			"optimeDate" : ISODate("2022-11-25T14:26:41Z"),
			"optimeDurableDate" : ISODate("2022-11-25T14:26:41Z"),
			"lastAppliedWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"lastDurableWallTime" : ISODate("2022-11-25T14:26:41.054Z"),
			"lastHeartbeat" : ISODate("2022-11-25T14:26:45.117Z"),
			"lastHeartbeatRecv" : ISODate("2022-11-25T14:26:44.113Z"),
			"pingMs" : NumberLong(0),
			"lastHeartbeatMessage" : "",
			"syncSourceHost" : "192.168.3.201:27017",
			"syncSourceId" : 0,
			"infoMessage" : "",
			"configVersion" : 1,
			"configTerm" : 1
		}
	],
	"ok" : 1,
	"$clusterTime" : {
		"clusterTime" : Timestamp(1669386401, 1),
		"signature" : {
			"hash" : BinData(0,"TkiPRtGCEbUH9TE/Ho9E14B6QNc="),
			"keyId" : NumberLong("7169959051789336581")
		}
	},
	"operationTime" : Timestamp(1669386401, 1)
}
rs0:PRIMARY> 


3.判断主从节点

“primary” : “192.168.3.201:27017”,显示192.168.3.201主机为主节点

rs0:PRIMARY> rs.isMaster()
{
	"topologyVersion" : {
		"processId" : ObjectId("6380c9ac32d52557ab398c3c"),
		"counter" : NumberLong(6)
	},
	"hosts" : [
		"192.168.3.201:27017",
		"192.168.3.202:27017",
		"192.168.3.203:27017"
	],
	"setName" : "rs0",
	"setVersion" : 1,
	"ismaster" : true,
	"secondary" : false,
	"primary" : "192.168.3.201:27017",
	"me" : "192.168.3.201:27017",
	"electionId" : ObjectId("7fffffff0000000000000001"),
	"lastWrite" : {
		"opTime" : {
			"ts" : Timestamp(1669386501, 1),
			"t" : NumberLong(1)
		},
		"lastWriteDate" : ISODate("2022-11-25T14:28:21Z"),
		"majorityOpTime" : {
			"ts" : Timestamp(1669386501, 1),
			"t" : NumberLong(1)
		},
		"majorityWriteDate" : ISODate("2022-11-25T14:28:21Z")
	},
	"maxBsonObjectSize" : 16777216,
	"maxMessageSizeBytes" : 48000000,
	"maxWriteBatchSize" : 100000,
	"localTime" : ISODate("2022-11-25T14:28:22.294Z"),
	"logicalSessionTimeoutMinutes" : 30,
	"connectionId" : 1,
	"minWireVersion" : 0,
	"maxWireVersion" : 13,
	"readOnly" : false,
	"ok" : 1,
	"$clusterTime" : {
		"clusterTime" : Timestamp(1669386501, 1),
		"signature" : {
			"hash" : BinData(0,"Sv8XmUFZHsjR0SbeOwNA29eggs4="),
			"keyId" : NumberLong("7169959051789336581")
		}
	},
	"operationTime" : Timestamp(1669386501, 1)



七、测试mongodb主从切换

1.停止主库


[root@k8s-master ~]# systemctl stop mongod.service 
[root@k8s-master ~]# 


image.png

2.查看从库状态


[root@k8s-node01 ~]# mongo
MongoDB shell version v5.0.14
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a204a521-8a32-43b1-bc4b-3197756c4a19") }
MongoDB server version: 5.0.14
================
Warning: the "mongo" shell has been superseded by "mongosh",
which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in
an upcoming release.
For installation instructions, see
https://docs.mongodb.com/mongodb-shell/install/
================
rs0:PRIMARY> 


image.png

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

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

相关文章

抢订单,稳增长!道可云元宇宙平台助力企业竞逐海外市场

受新冠肺炎疫情和国际政治经济形势错综复杂的不利影响,我国的外贸企业普遍面临订单下滑、供应链不畅、经营压力大等困难,国际需求大幅萎缩。随着后疫情时代的来临,我国的疫情防控政策不断优化调整,市场对企业出海抢占商机的关注度…

node只能以管理员的身份运行才能正常使用

node只能以管理员的身份运行才能正常使用,解决办法 下载node后,默认下载包安装在c盘中, 修改方式: npm config set prefix “D:\Program Files\nodejs\node_global” npm config set cache “D:\Program Files\nodejs\node_cache…

Java+SSM客户信息管理系统(含源码+论文+答辩PPT等)

项目功能简介: 该项目采用的技术实现如下: 后台框架:Spring、SpringMVC、MyBatis UI界面:JSP、jQuery 、BootStrap 数据库:MySQL 该客户信息管理系统以实际运用为开发背景,Java开发语言,使用JSP设计页面&am…

Geoserver中预览图层时放大到某一层级不显示(样式Styles中未设置对应比例尺的样式)

场景 GeoServer简介、下载、配置启动、发布shapefile全流程(图文实践): GeoServer简介、下载、配置启动、发布shapefile全流程(图文实践)_霸道流氓气质的博客-CSDN博客_geoserver简介 geoserver在预览图层时,当发大图层时内容不显示。 比如文字text图…

智能门驱动光耦合器与集成的反馈控制器

介绍 新的ACPL-302J是一种改进的智能门驱动光耦合器隔离电源和简化门驱动的设计。 ACPL-302J具有一个集成的反控制器为DC-DC转换器和一个完整一套故障安全的IGBT诊断、保护和故障报告,提供一个完整的成本有效的门驱动解决方案(图1)。带2.5A…

网络工程毕业设计题目100例

文章目录0 简介1 如何选题2 最新网络工程选题2.1 Java web - SSM 系统2.2 大数据方向2.3 人工智能方向2.4 其他方向4 最后0 简介 丹成学长,搜集分享最新的网络工程专业毕设毕设选题,难度适中,适合作为毕业设计,大家参考。 学长整…

Cuda __CUDA_ARCH__宏

__CUDA_ARCH__属于NVCC的宏 5.7.4. Virtual Architecture Macros 给出说明 The architecture identification macro __CUDA_ARCH__ is assigned a three-digit value string xy0 (ending in a literal 0) during each nvcc compilation stage 1 that compiles for compute_xy…

多标签分类怎么做?教你4招

首先简单介绍下,多标签分类与多分类、多任务学习的关系: 多分类学习(Multi-class):分类器去划分的类别是多个的,但对于每一个样本只能有一个类别,类别间是互斥的。例如:分类器判断这…

在vue的v-for中,key为什么不能用index?

写在前面 在前端中,主要涉及的基本上就是 DOM的相关操作 和 JS,我们都知道 DOM 操作是比较耗时的,那么在我们写前端相关代码的时候,如何减少不必要的 DOM 操作便成了前端优化的重要内容。 虚拟DOM(virtual DOM) 在 jQuery 时代…

Yolov3目标检测BS交互式框架——火焰识别为例

每个模块都具有可扩展性,可以根据需求自行扩展。本例子仅用火焰识别,可以自行训练新的权重实现检测不同目标。可以进行内网搭建,无需要安装程序 B/S模式 VS B/S模式: /B/SC/S跨平台√(要写多种)维护成本低…

51单片机点亮LED灯

LED 灯 发光二极管(Light Emitting Diode),主要用于照明、广告灯、指引灯、屏幕等场景。 LED 原理图 VCC 表示电源正极,当二极管的正极对应电源的正极,并且二极管的负极对应电源的负极时,二极管就会亮灯。…

反义寡核苷酸/司盘修饰/载米铂与核酸miR-34a/冰片修饰的丹参酮ⅡA阳离子脂质体的合成

小编今天这里分享的内容是反义寡核苷酸/司盘修饰/载米铂与核酸miR-34a/冰片修饰的丹参酮ⅡA阳离子脂质体的合成方法,一起来看! 冰片(BO)修饰的丹参酮ⅡA(TA)阳离子脂质体TA-BCLPs方法: 采用乙醇注入法制备阳离子脂质体,通过正交设计,以粒径,…

SpringSecurity[5]-基于表达式的访问控制/基于注解的访问控制/Remember Me功能实现

上一篇:SpringSecurity[4]-访问控制url匹配/内置访问控制方法介绍/角色权限判断 链接:SpringSecurity[4]-访问控制url匹配/内置访问控制方法介绍/角色权限判断_豆虫儿的博客-CSDN博客 十一、基于表达式的访问控制 1.access()方法使用 之前学习的登录用户权限判断实际上底层…

Spring Security进阶学习

Spring Security整体架构 认证 认证核心组件的大体关系如下: Spring Security 中的认证工作主要由 AuthenticationManager 接口来负责,它处理来自框架其他部分的身份验证请求。其中还涉及到一些关键类,比如:AuthenticationProvi…

同城预约小程序上门服务上门理疗推拿按摩系统养生美容行业程序源码

在这个工作生活压力巨大的社会,大家恨不得一分钟掰成两半过,别提什么休闲娱乐了,能睡个饱觉就已经是奢侈了!工作固然重要,身心的放松也需要重视,好在随着互联网+的发展,越来越多的行…

PMO在企业项目管理中的五个重要作用

PMO项目管理办公室是成功企业的关键管理工具。它对于推动项目的发展至关重要,以下是PMO的五个重要作用: 1、项目管理过程的标准化 PMO的主要目标在于方法、流程和工具的创建和标准化。 PMO 可能创建的模板包括: • 项目建议书模板。这有…

Java Optional 实用判空实用实战,优雅永不过时

平时我们很多实体类里面会嵌套实体类,实体里面还嵌套实体。 那么我们有时为了取出最里面的实体的某个值的时候,我们就不得不一层层剥开这个 让人流泪的洋葱, 一层层判断。 举例(随便举的): 就像这么一个…

关于迭代器遍历及auto关键词

在使用vector容器或者字符串时,很经常会用到一些遍历操作,除了使用下标遍历之外,使用迭代器遍历也是超级方便,但是迭代器也有有一些小坑,一不注意就会编译出错,所以特意总结一下。 迭代器 迭代器很很多接口…

性能测试之nginx监控系统搭建

不同tomcat服务器的负载均衡 在Nginx服务器192.168.43.138上安装Nginx,(安装教程在前几篇文章有详细描述 )实现反向代理tomcat负载均衡 执行一下命令,关闭防火墙 systemctl disable firewalld.service systemctl stop firewall…

[附源码]Node.js计算机毕业设计防疫科普微课堂Express

项目运行 环境配置: Node.js最新版 Vscode Mysql5.7 HBuilderXNavicat11Vue。 项目技术: Express框架 Node.js Vue 等等组成,B/S模式 Vscode管理前后端分离等等。 环境需要 1.运行环境:最好是Nodejs最新版,我…