Ubuntu-22.04安装MegaCLI并查看MegaRAID的配置

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言
  • 一、MegaRAID
  • 二、安装MegaCLI
    • 1.Ubuntu-18.04
    • 2.Ubuntu-22.04
    • 3.Ubuntu-20.04
    • 4.CentOS-7
    • 5.其它发行版
  • 三、使用MegaCLI
    • 1.查看所有适配器信息
    • 2.查看所有物理磁盘信息
  • 四、方便的脚本
  • 五、配置方法
  • 总结


前言

经常使用服务器的都知道RAID的重要性,现代的服务器基本都是基于RAID部署的。举个例子,基于RAID 1部署的磁盘阵列互为镜像,只要不是两块盘同时坏,数据一定不会丢,只需要替换掉故障的盘,什么都不用做,RAID会自动重建的。还有RAID 0RAID 5RAID 10等这里就不赘述了,不是本篇讨论的重点,今天我们只讨论怎么查看服务器的RAID配置。

本篇基于MegaRAID,不涉及其它RAID。


一、MegaRAID

MegaRAID是一种常用于服务器和高端存储设备的RAID(冗余阵列)控制器技术。通过MegaRAID,用户可以配置和管理硬盘驱动器(HDD)或固态硬盘(SSD)的RAID阵列,以提供数据冗余、提高性能和增加存储容量。

MegaRAID是LSI公司的产品,LSI后来被Avago公司收购。
LSI公司

我们面临的问题是在Linux系统里面没有办法直接看到硬RAID信息(通过BIOS创建),只能看到软RAID信息(通过软件创建)。所以各家厂商提供了专门的工具帮助开发者或运维者查看和管理RAID。我们讲的MegaRAID就是这样的,我所使用的RAID就是在BIOS里面设置的。

二、安装MegaCLI

MegaRAID提供了一个工具管理RAID叫MegaCLI,这个工具在博通网站就能下载到,支持多种Linux发行版(Ubuntu、CentOS、RedHat…),今天主要讲Ubuntu上的MegaCLI安装。

注意:Ubuntu-18.04和以上版本安装方式不一样,后面会细讲!

1.Ubuntu-18.04

这个版本比较容易,使用APT就可以安装了。以下方法按照顺序执行,我经过多方认证确定不会出现问题,如果发生冲突大概率是你的环境有问题。

#/etc/apt/sources.list末尾添加源
sudo sed -i '$a\deb http://hwraid.le-vert.net/ubuntu precise main' /etc/apt/sources.list
#添加验证密钥
wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -
#更新源
sudo apt update
#安装
sudo apt-get install megacli megactl megaraid-status

2.Ubuntu-22.04

这个版本不能用上面的方式安装,因为megacli依赖Python2,而22.04已经移除了Python2,强行安装或许可以,但不是最好的方法。

这里我自己上传了个MegaRAID.tar,这是我从CentOS7中提取的可执行文件+库,因为官方只提供了.rpm的包,没有提供.deb的包,所以我用这种方法移植到Ubuntu了。
资源链接

下载完成之后是MegaRAID.tar,执行下面的命令:

解压
sudo tar -xmf MegaRAID.tar移动
sudo mv MegaRAID /opt创建软链
sudo ln -s /opt/MegaRAID/MegaCli/MegaCli64 /usr/sbin/megacli缺少依赖库就安装,不缺少就跳过
sudo apt install libncurses5

这个时候就可以开始使用了。

3.Ubuntu-20.04

放在22.04后面是因为我手上没有20.04的版本,APT方式安装的megacli依赖Python2,我也忘了20.04是不是阉割了Python2,使用which python2来测试是不是预装了python2.7,如果有按照18.04的方式安装,没有的话就按照22.04的方式安装。

4.CentOS-7

实测可以按照22.04的方式安装。

5.其它发行版

我常用的就这些发行版,需要其它版本请下载下面的多版本试试。
MegaCLI

三、使用MegaCLI

确保已经安装完成了。

注意:需要sudo权限或者切换root用户!

查看机器型号    
dmidecode | grep "Product" 
查看厂商     
dmidecode| grep  "Manufacturer" 
查看序列号     
dmidecode | grep  "Serial Number" 
查看CPU信息     
dmidecode | grep  "CPU" 
查看CPU个数     
dmidecode | grep  "Socket Designation: CPU" |wc –l 
查看出厂日期     
dmidecode | grep "Date" 
查看充电状态     
megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Charger Status" 
显示BBU状态信息     
megacli -AdpBbuCmd -GetBbuStatus –aALL 
显示BBU容量信息     
megacli -AdpBbuCmd -GetBbuCapacityInfo –aALL 
显示BBU设计参数     
megacli -AdpBbuCmd -GetBbuDesignInfo –aALL 
显示当前BBU属性     
megacli -AdpBbuCmd -GetBbuProperties –aALL 
查看充电进度百分比     
megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Relative State of Charge" 
查询Raid阵列数     
megacli -cfgdsply -aALL |grep "Number of DISK GROUPS:" 
显示Raid卡型号,Raid设置,Disk相关信息       
megacli -cfgdsply –aALL 
显示所有物理信息     
megacli -PDList -aALL 
显示所有逻辑磁盘组信息     
megacli -LDInfo -LALL –aAll 
查看物理磁盘重建进度(重要)     
megacli -PDRbld -ShowProg -PhysDrv [1:5] -a0 
查看适配器个数    
megacli –adpCount 
查看适配器时间    
megacli -AdpGetTime –aALL 
显示所有适配器信息    
megacli -AdpAllInfo –aAll 
查看Cache 策略设置     
megacli -cfgdsply -aALL |grep Polic

简单说下常用的两个命令,第一个是查看RAID配置,第二个是查看物理磁盘。

1.查看所有适配器信息

没错,MegaRAID称所有的RAID组合为适配器(Adapter),每个适配器都有一个唯一ID

sudo megacli -LDInfo -LALL –aAllAdapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 893.75 GB
Sector Size         : 512
Is VD emulated      : Yes
Mirror Data         : 893.75 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAheadNone, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Encryption Type     : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: No
LD has drives that support T10 power conditions: No
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Is VD Cached: No

RAID Level:就是配置的RAID方式,我这里是RAID 1

RAID Level对应关系:
RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0 #RAID 1
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0 #RAID 0
RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 #RAID 5

Size:逻辑磁盘容量,就是组成RAID之后你在系统里看到的可用容量

Sector Size:镞大小,不细讲了,你可以自行研究下。

Number Of Drives:多少个物理磁盘参与了这个RAID,这里显示是2个。

注:关于RAID 1支持的硬盘数,我查了好久,可以确认的是Intel的RAID是仅限2个磁盘,Wiki上说至少2块,我见过的都是2块,大于2块的我没见过。因为2块其实已经很安全了,2块磁盘同时坏的可能性很低。所以似乎也没多少必要用3块乃至更多的磁盘,毕竟成本在那里,服务器磁盘可不便宜!

2.查看所有物理磁盘信息

这才是我真正想看到的,从Linux系统层面无法看到插了几块硬盘,每块硬盘都插在了哪个槽位,每块硬盘属于哪个RAID,这都是很重要的信息。虽然从BIOS可以看到,但是我总没有必要去重启服务器吧,有些服务器可是24小时运行的呢!

sudo megacli -PDList -aALL Adapter #0Enclosure Device ID: 32
Slot Number: 0
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 0
WWN: **************
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATARaw Size: 894.252 GB [0x6fc81ab0 Sectors]
Non Coerced Size: 893.752 GB [0x6fb81ab0 Sectors]
Coerced Size: 893.75 GB [0x6fb80000 Sectors]
Sector Size:  512
Logical Sector Size:  512
Physical Sector Size:  4096
Firmware state: Online, Spun Up
Device Firmware Level: 0100
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x4433221104000000
Connected Port Number: 1(path0)
Inquiry Data: PHYF8454006A960CGN  INTEL SSDSC2KB960G8                     XCV10100
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive:  Not Certified
Drive Temperature :18C (64.40 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Drive's NCQ setting : N/A
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: 1
Device Id: 1
WWN: *************
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATARaw Size: 894.252 GB [0x6fc81ab0 Sectors]
Non Coerced Size: 893.752 GB [0x6fb81ab0 Sectors]
Coerced Size: 893.75 GB [0x6fb80000 Sectors]
Sector Size:  512
Logical Sector Size:  512
Physical Sector Size:  4096
Firmware state: Online, Spun Up
Device Firmware Level: 0100
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x4433221100000000
Connected Port Number: 0(path0)
Inquiry Data: PHYF845406QH960CGN  INTEL SSDSC2KB960G8                     XCV10100
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive:  Not Certified
Drive Temperature :19C (66.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Drive's NCQ setting : N/A
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No

Slot Number:槽位号

PD Type:物理接口,SATA就是SATA控制器

Device Speed:设备速度规格

Link Speed:连接速度规格,这个应该是如果SATA3的设备接SATA2的接口它俩可能不一样。

Media Type:磁盘物理材质,我只见过固态和机械,其它的请查询官方文档

Drive Temperature:硬盘温度,摄氏度/华氏度,一般50℃算偏高了,正常40℃左右差不多,太高了就检查下机器散热。

四、方便的脚本

我从网上找了一个方便的脚本,不用每次都输入那么多指令了。使用方式也很简单,复制保存为lsi.sh,你输入./lsi.sh会给出指示。

注意:这个脚本更适合运维场景,方便快速排查,毕竟这些命令记起来还挺头疼的,复杂用法还得参考官方文档。

#!/bin/bash
#
# Calomel.org
#     https://calomel.org/megacli_lsi_commands.html
#     LSI MegaRaid CLI
#     lsi.sh @ Version 0.05
#
# description: MegaCLI script to configure and monitor LSI raid cards.# Full path to the MegaRaid CLI binary
#MegaCli="/usr/local/sbin/MegaCli64"
MegaCli=`which megacli`# The identifying number of the enclosure. Default for our systems is "8". Use
# "MegaCli64 -PDlist -a0 | grep "Enclosure Device"" to see what your number
# is and set this variable.
ENCLOSURE="8"if [ $# -eq 0 ]thenecho ""echo "            OBPG  .:.  lsi.sh $arg1 $arg2"echo "-----------------------------------------------------"echo "status        = Status of Virtual drives (volumes)"echo "drives        = Status of hard drives"echo "ident \$slot   = Blink light on drive (need slot number)"echo "good \$slot    = Simply makes the slot \"Unconfigured(good)\" (need slot number)"echo "replace \$slot = Replace \"Unconfigured(bad)\" drive (need slot number)"echo "progress      = Status of drive rebuild"echo "errors        = Show drive errors which are non-zero"echo "bat           = Battery health and capacity"echo "batrelearn    = Force BBU re-learn cycle"echo "logs          = Print card logs"echo "checkNemail   = Check volume(s) and send email on raid errors"echo "allinfo       = Print out all settings and information about the card"echo "settime       = Set the raid card's time to the current system time"echo "setdefaults   = Set preferred default settings for new raid setup"echo ""exitfi# General status of all RAID virtual disks or volumes and if PATROL disk check
# is running.
if [ $1 = "status" ]then$MegaCli -LDInfo -Lall -aALL -NoLogecho "###############################################"$MegaCli -AdpPR -Info -aALL -NoLogecho "###############################################"$MegaCli -LDCC -ShowProg -LALL -aALL -NoLogexit
fi# Shows the state of all drives and if they are online, unconfigured or missing.
if [ $1 = "drives" ]then$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g'exit
fi# Use to blink the light on the slot in question. Hit enter again to turn the blinking light off.
if [ $1 = "ident" ]then$MegaCli  -PdLocate -start -physdrv[$ENCLOSURE:$2] -a0 -NoLoglogger "`hostname` - identifying enclosure $ENCLOSURE, drive $2 "read -p "Press [Enter] key to turn off light..."$MegaCli  -PdLocate -stop -physdrv[$ENCLOSURE:$2] -a0 -NoLogexit
fi# When a new drive is inserted it might have old RAID headers on it. This
# method simply removes old RAID configs from the drive in the slot and make
# the drive "good." Basically, Unconfigured(bad) to Unconfigured(good). We use
# this method on our FreeBSD ZFS machines before the drive is added back into
# the zfs pool.
if [ $1 = "good" ]then# set Unconfigured(bad) to Unconfigured(good)$MegaCli -PDMakeGood -PhysDrv[$ENCLOSURE:$2] -a0 -NoLog# clear 'Foreign' flag or invalid raid header on replacement drive$MegaCli -CfgForeign -Clear -aALL -NoLogexit
fi# Use to diagnose bad drives. When no errors are shown only the slot numbers
# will print out. If a drive(s) has an error you will see the number of errors
# under the slot number. At this point you can decided to replace the flaky
# drive. Bad drives might not fail right away and will slow down your raid with
# read/write retries or corrupt data.
if [ $1 = "errors" ]thenecho "Slot Number: 0"; $MegaCli -PDlist -aALL -NoLog | egrep -i 'error|fail|slot' | egrep -v ' 0'exit
fi# status of the battery and the amount of charge. Without a working Battery
# Backup Unit (BBU) most of the LSI read/write caching will be disabled
# automatically. You want caching for speed so make sure the battery is ok.
if [ $1 = "bat" ]then$MegaCli -AdpBbuCmd -aAll -NoLogexit
fi# Force a Battery Backup Unit (BBU) re-learn cycle. This will discharge the
# lithium BBU unit and recharge it. This check might take a few hours and you
# will want to always run this in off hours. LSI suggests a battery relearn
# monthly or so. We actually run it every three(3) months by way of a cron job.
# Understand if your "Current Cache Policy" is set to "No Write Cache if Bad
# BBU" then write-cache will be disabled during this check. This means writes
# to the raid will be VERY slow at about 1/10th normal speed. NOTE: if the
# battery is new (new bats should charge for a few hours before they register)
# or if the BBU comes up and says it has no charge try powering off the machine
# and restart it. This will force the LSI card to re-evaluate the BBU. Silly
# but it works.
if [ $1 = "batrelearn" ]then$MegaCli -AdpBbuCmd -BbuLearn -aALL -NoLogexit
fi# Use to replace a drive. You need the slot number and may want to use the
# "drives" method to show which drive in a slot is "Unconfigured(bad)". Once
# the new drive is in the slot and spun up this method will bring the drive
# online, clear any foreign raid headers from the replacement drive and set the
# drive as a hot spare. We will also tell the card to start rebuilding if it
# does not start automatically. The raid should start rebuilding right away
# either way. NOTE: if you pass a slot number which is already part of the raid
# by mistake the LSI raid card is smart enough to just error out and _NOT_
# destroy the raid drive, thankfully.
if [ $1 = "replace" ]thenlogger "`hostname` - REPLACE enclosure $ENCLOSURE, drive $2 "# set Unconfigured(bad) to Unconfigured(good)$MegaCli -PDMakeGood -PhysDrv[$ENCLOSURE:$2] -a0 -NoLog# clear 'Foreign' flag or invalid raid header on replacement drive$MegaCli -CfgForeign -Clear -aALL -NoLog# set drive as hot spare$MegaCli -PDHSP -Set -PhysDrv [$ENCLOSURE:$2] -a0 -NoLog# show rebuild progress on replacement drive just to make sure it starts$MegaCli -PDRbld -ShowProg -PhysDrv [$ENCLOSURE:$2] -a0 -NoLogexit
fi# Print all the logs from the LSI raid card. You can grep on the output.
if [ $1 = "logs" ]then$MegaCli -FwTermLog -Dsply -aALL -NoLogexit
fi# Use to query the RAID card and find the drive which is rebuilding. The script
# will then query the rebuilding drive to see what percentage it is rebuilt and
# how much time it has taken so far. You can then guess-ti-mate the
# completion time.
if [ $1 = "progress" ]thenDRIVE=`$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g' | egrep build | awk '{print $3}'`$MegaCli -PDRbld -ShowProg -PhysDrv [$ENCLOSURE:$DRIVE] -a0 -NoLogexit
fi# Use to check the status of the raid. If the raid is degraded or faulty the
# script will send email to the address in the $EMAIL variable. We normally add
# this method to a cron job to be run every few hours so we are notified of any
# issues.
if [ $1 = "checkNemail" ]thenEMAIL="raidadmin@localhost"# Check if raid is in good conditionSTATUS=`$MegaCli -LDInfo -Lall -aALL -NoLog | egrep -i 'fail|degrad|error'`# On bad raid status send email with basic drive informationif [ "$STATUS" ]; then$MegaCli -PDlist -aALL -NoLog | egrep 'Slot|state' | awk '/Slot/{if (x)print x;x="";}{x=(!x)?$0:x" -"$0;}END{print x;}' | sed 's/Firmware state://g' | mail -s `hostname`' - RAID Notification' $EMAILfi
fi# Use to print all information about the LSI raid card. Check default options,
# firmware version (FW Package Build), battery back-up unit presence, installed
# cache memory and the capabilities of the adapter. Pipe to grep to find the
# term you need.
if [ $1 = "allinfo" ]then$MegaCli -AdpAllInfo -aAll -NoLogexit
fi# Update the LSI card's time with the current operating system time. You may
# want to setup a cron job to call this method once a day or whenever you
# think the raid card's time might drift too much.
if [ $1 = "settime" ]then$MegaCli -AdpGetTime -aALL -NoLog$MegaCli -AdpSetTime `date +%Y%m%d` `date +%H:%M:%S` -aALL -NoLog$MegaCli -AdpGetTime -aALL -NoLogexit
fi# These are the defaults we like to use on the hundreds of raids we manage. You
# will want to go through each option here and make sure you want to use them
# too. These options are for speed optimization, build rate tweaks and PATROL
# options. When setting up a new machine we simply execute the "setdefaults"
# method and the raid is configured. You can use this on live raids too.
if [ $1 = "setdefaults" ]then# Read Cache enabled specifies that all reads are buffered in cache memory.$MegaCli -LDSetProp -Cached -LAll -aAll -NoLog# Adaptive Read-Ahead if the controller receives several requests to sequential sectors$MegaCli -LDSetProp ADRA -LALL -aALL -NoLog# Hard Disk cache policy enabled allowing the drive to use internal caching too$MegaCli -LDSetProp EnDskCache -LAll -aAll -NoLog# Write-Back cache enabled$MegaCli -LDSetProp WB -LALL -aALL -NoLog# Continue booting with data stuck in cache. Set Boot with Pinned Cache Enabled.$MegaCli -AdpSetProp -BootWithPinnedCache -1 -aALL -NoLog# PATROL run every 672 hours or monthly (RAID6 77TB @60% rebuild takes 21 hours)$MegaCli -AdpPR -SetDelay 672 -aALL -NoLog# Check Consistency every 672 hours or monthly$MegaCli -AdpCcSched -SetDelay 672 -aALL -NoLog# Enable autobuild when a new Unconfigured(good) drive is inserted or set to hot spare$MegaCli -AdpAutoRbld -Enbl -a0 -NoLog# RAID rebuild rate to 60% (build quick before another failure)$MegaCli -AdpSetProp \{RebuildRate -60\} -aALL -NoLog# RAID check consistency rate to 60% (fast parity checks)$MegaCli -AdpSetProp \{CCRate -60\} -aALL -NoLog# Enable Native Command Queue (NCQ) on all drives$MegaCli -AdpSetProp NCQEnbl -aAll -NoLog# Sound alarm disabled (server room is too loud anyways)$MegaCli -AdpSetProp AlarmDsbl -aALL -NoLog# Use write-back cache mode even if BBU is bad. Make sure your machine is on UPS too.$MegaCli -LDSetProp CachedBadBBU -LAll -aAll -NoLog# Disable auto learn BBU check which can severely affect raid speedsOUTBBU=$(mktemp /tmp/output.XXXXXXXXXX)echo "autoLearnMode=1" > $OUTBBU$MegaCli -AdpBbuCmd -SetBbuProperties -f $OUTBBU -a0 -NoLogrm -rf $OUTBBUexit
fi### EOF ###

五、配置方法

先空着吧,最好自行查询官方文档。没验证过的方法我不敢写在这里,操作错误被人喷死。操作硬盘毕竟不是闹着玩的。切记,数据无价!!!


总结

1、不是所有的MegaRAID硬件都支持,具体可以安装试试
2、没有提供配置RAID方法是因为有风险,我本身设备有限,很多东西不能实际测试,恐怕误导他人,导致数据丢失的惨剧发生。有需要的可以自行官方查阅指令。

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

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

相关文章

华为配置WLAN高密业务示例

配置WLAN高密业务示例 组网图形 图1 配置高密WLAN环境网络部署组网图 业务需求组网需求数据规划配置思路配置注意事项操作步骤配置文件 业务需求 体育场由于需要接入用户数量很大,AP间部署距离较小,因此AP间的干扰较大,可能导致用户上网网…

新王炸:文生视频Sora模型发布,能否引爆AI芯片热潮

前言 前方高能预警,Sora来袭! 浅析Sora的技术亮点 语言模型中构建关键词联系 视频素材分解为时空碎片 扩散模型DiT Not for play, But change world! OpenAI的宏大目标 未来已来,只是尚未流行 Sora的成本与OpenAI的7万亿美金豪赌 算…

【探索AI】人人都在讲AIGC,什么是AIGC?

AIGC 概述示例展示我们日常用到的一些工具/应用核心技术介绍核心技术的算法解析案例及部分代码实现1. 艺术作品2. 设计项目3. 影视特效4. 广告创意总结 一张图先了解下: 概述 "人工智能生成创造(Artificial Intelligence Generated Content&#x…

从CPU缓存结构到原子操作

一、CPU缓存结构 1.1 CPU的多级缓存 因为CPU的计算速度非常快,但内存的访问速度相对较慢。因此,如果CPU每次都要从内存读取数据,会造成大量的等待时间,降低整体性能。 通过引入多级缓存,可以在CPU和内存之间建立数据…

vue3中实现elementPlus表格选中行的上移下移

先看效果&#xff1a; 实现步骤&#xff1a; 1、给el-table添加current-change事件、高亮属性及ref属性 2、给上移下移按钮添加事件 // 定义当前选中的行参数 const currentRow ref<any>(null); // 定义表格的ref const singleTableRef ref(); // 行选中事件 const ha…

正信晟锦:借了钱的人一直不接电话不回信息咋办

在金钱往来中&#xff0c;遇到借出的钱款无法按时回收&#xff0c;且借款人如同人间蒸发一般不接电话、不回信息&#xff0c;确实让人焦虑。面对这种情形&#xff0c;我们需采取明智而有效的措施&#xff0c;以保护自身的权益。 首要策略是保持冷静&#xff0c;不要让情绪主导行…

四、《任务列表案例》后端程序实现和测试

本章概要 准备工作功能实现前后联调 4.1 准备工作 数据库脚本 CREATE TABLE schedule (id INT NOT NULL AUTO_INCREMENT,title VARCHAR(255) NOT NULL,completed BOOLEAN NOT NULL,PRIMARY KEY (id) );INSERT INTO schedule (title, completed) VALUES(学习java, true),(学…

【前端素材】推荐优质在线高端蜂蜜商城电商网页Beejar平台模板(附源码)

一、需求分析 1、系统定义 在线高端蜂蜜商城是指一个专门销售高品质、高端蜂蜜产品的电子商务平台。这种商城致力于向消费者提供各种经过精心挑选、具有高营养价值和健康功效的蜂蜜产品。 2、功能需求 在线高端蜂蜜商城是指一个专门销售高品质、高端蜂蜜产品的电子商务平台…

Go字符串实战操作大全!

目录 1. 引言文章结构概览 2. Go字符串基础字符串的定义与特性什么是字符串&#xff1f;Go字符串的不可变性原则 字符串的数据结构Go字符串的内部表达byte和rune的简介 3. 字符串操作与应用3.1 操作与应用字符串连接字符串切片字符串查找字符串比较字符串的替换字符串的大小写转…

vos3000外呼系统警告消除怎么设置

你有没有发现vos3000登陆时老是提示告警&#xff0c;消除一会又出现&#xff0c;那么又什么办法能解决呢&#xff1f;要彻底消除 VOS3000 系统的警告&#xff0c;一般需要通过以下步骤来进行排查和解决&#xff1a; 确认警告信息&#xff1a;首先要明确警告的具体内容和出现的条…

旧的Spring Security OAuth已停止维护,全面拥抱最新解决方案Spring SAS

Spring Authorization Server 替换 Shiro 指引 背景 Spring 团队正式宣布 Spring Security OAuth 停止维护&#xff0c;该项目将不会再进行任何的迭代 目前 Spring 生态中的 OAuth2 授权服务器是 Spring Authorization Server 已经可以正式生产使用作为 SpringBoot 3.0 的最新…

c++异常机制(3) -- 异常类型和生命周期

目录 抛出的异常类型大致可以分为三种。 第一种 基本类型 1. 可以直接抛出常量 2. 也可以抛出定义好的变量 3. 如果我们使用const&#xff0c;会不会影响到异常的匹配。 第二种 字符串类型以及指针类型 1. 使用字符指针 注意: 2. 使用string类型 第三种 …

计算机专业大学生的简历,为何会出现在垃圾桶

为什么校招过后垃圾桶里全是简历&#xff0c;计算机专业的学生找工作有多难&#xff1f; 空哥这么跟你说吧&#xff0c;趁现在还来得及&#xff0c;这些事情你一定要听好了。 第一&#xff0c;计算机专业在学校学的东西是非常有限的&#xff0c;985211的还好&#xff0c;如果…

GPS历史轨迹优化算法的研究与实现

GPS历史轨迹优化算法的研究与实现 摘要 本研究提出了一种综合利用数据清洗、密度聚类、卡尔曼滤波和地图匹配的新算法,命名为“DSKF-Match”。该算法旨在处理GPS轨迹数据,通过清洗、聚类、平滑和匹配等步骤,提高数据的质量和准确性。首先,算法利用时间窗口法进行数据清洗…

D365:LookUp

文章目录 前言一、复制onLookUp事件方法二、LookUp方法 前言 在Form的字段的onLookUp方法中&#xff0c;添加下拉框。 一、复制onLookUp事件方法 二、LookUp方法 [FormControlEventHandler(formControlStr(EcoResProductDetailsExtended, VyaKeyItemType_VyaMaterialSubCode…

Vue2:路由守卫实现权限管理之独享路由守卫

一、情景说明 单独给某个路由组件配置守卫 二、案例 给news路由配置独享路由守卫 在进入该路由组件前&#xff0c;会触发相关函数 函数内编写鉴权功能的相关代码即可 关键配置&#xff1a;beforeEnter {name:xinwen,path:news,component:News,meta:{isAuth:true,title:新闻}…

【PyTorch知识点汇总】

PyTorch是一个广泛使用的深度学习框架&#xff0c;它提供了许多功能强大的工具和函数&#xff0c;用于构建和训练神经网络。以下是一些PyTorch的常用知识点和示例说明&#xff1a; 张量&#xff08;Tensors&#xff09; 创建张量&#xff1a;使用torch.tensor()​、torch.Tenso…

面试经典150题——用最少数量的箭引爆气球

"The only person you are destined to become is the person you decide to be." - Ralph Waldo Emerson 1. 题目描述 2. 题目分析与解析 这个题目开始读题的时候是有点不好理解题意的&#xff0c;因此我先做个图让大家对于题意有更好更直观的理解再来分析题目。 …

如何使用Portainer创建Nginx容器并搭建web网站发布至公网可访问【内网穿透】

文章目录 前言1. 安装Portainer1.1 访问Portainer Web界面 2. 使用Portainer创建Nginx容器3. 将Web静态站点实现公网访问4. 配置Web站点公网访问地址4.1公网访问Web站点 5. 固定Web静态站点公网地址6. 固定公网地址访问Web静态站点 前言 Portainer是一个开源的Docker轻量级可视…

SQL 常见命令及规范

常见命令 1. 查看当前所有数据库 show databases; 2. 打开指定的库 use 库名 ; 3. 查看当前库的所有表 show tables; 4. 查看其他库的所有表 show tables from 库名 ; 5. 创建表 cerate table 表名 ( 列名 列类型&#xff0c; 列名 列类型&#xff0c; ..... …