AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-264818

igal's questions

Martin Hope
igal
Asked: 2017-02-27 19:14:02 +0800 CST

MegaCli 报告物理磁盘数量不一致

  • 1

首先,这是我的问题的精简版。我在 RAID 阵列中的驱动器上有一个闪烁的红灯,虽然 MegaCli 没有报告任何磁盘故障或警告,但一些 MegaCli 命令显示 24 个磁盘,而其他只显示 23 个。我还看到每天重复出现以下错误:

Event Description: Controller encountered a fatal error and was reset

这些东西有关系吗?这里有问题吗?

现在这是更长的版本。我继承了对托管在数据中心的服务器(我们称之为服务器my_server)的责任,并且我相信它具有具有 RAID 50/RAID 5+0 配置的 LSI MegaRAID SAS 9265-8i。我收到了一封来自数据中心的电子邮件,表明此服务器的一个硬盘上的红灯正在闪烁。不幸的是,我对 RAID 阵列几乎一无所知,所以我必须通过MegaRAID SAS 软件用户指南和各种在线教程来摸索。

我 ssh 进入服务器以尝试诊断问题。下面是一个示例 shell 会话,它展示了我的努力并提供了一些有关系统的相关信息。

首先我检查一些基本的系统信息:

$ cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

$ uname -a
Linux my_server 2.6.32-358.11.1.el6.x86_64 #1
SMP Wed Jun 12 03:34:52 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

接下来我验证 RAID 阵列和 MegaCli 版本:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -adpallinfo -aALL | grep "Product Name"
Product Name    : LSI MegaRAID SAS 9265-8i

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -a0 | grep 'RAID Level'
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -v

      MegaCLI SAS RAID Management Tool  Ver 8.04.07 May 28, 2012

    (c)Copyright 2011, LSI Corporation, All Rights Reserved.

Exit Code: 0x00

现在一些关于阵列中驱动器的摘要信息:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -adpallinfo -a0 | grep -A8 "Device Present"

                    Device Present
                    ================
    Virtual Drives    : 1
      Degraded        : 0
      Offline         : 0
    Physical Devices  : 27
      Disks           : 24
      Critical Disks  : 0
      Failed Disks    : 0

在这里看起来一切都很好。然后我检查 SMART 警报:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep 'S.M.A.R.T.'
Drive has flagged a S.M.A.R.T alert : No
Drive has flagged a S.M.A.R.T alert : No
[...]
Drive has flagged a S.M.A.R.T alert : No
Drive has flagged a S.M.A.R.T alert : No

没有 SMART 警报,所以在阅读了一些教程之后,我运行了一些其他命令:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -a0 | grep Drives
Number Of Drives    : 23

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -aALL | grep -Pi 'SPAN|Span\ Ref|Number\ of'
Number of DISK GROUPS: 1
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 23
Number of VDs: 1
Number of dedicated Hotspares: 0
Number Of Drives    : 23
Span Depth          : 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 2
Drive's postion: DiskGroup: 0, Span: 0, Arm: 3
[...]
Drive's postion: DiskGroup: 0, Span: 0, Arm: 20
Drive's postion: DiskGroup: 0, Span: 0, Arm: 21
Drive's postion: DiskGroup: 0, Span: 0, Arm: 22

现在我有点困惑,因为一些命令(例如 adpallinfo 和 pdlist)显示存在 24 个磁盘,而其他命令(例如 ldinfo 和 CfgDsply)只显示 23 个。

最后我生成了一个事件日志文件并寻找问题的迹象:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -adpeventlog -getevents -f lsi-events.log -a0 -nolog
$ cat lsi-events.log | grep -P -i 'fail|error|warn'

[...]
Event Description: Controller encountered a fatal error and was reset
Event Description: Controller encountered a fatal error and was reset
Event Description: Controller encountered a fatal error and was reset
Event Description: Controller encountered a fatal error and was reset
Event Description: Controller encountered a fatal error and was reset


$ cat lsi-events.log | grep -B6 -A3 -P -i 'fail|error|warn'

[...]
seqNum: 0x000f8644
Time: Sun Feb 26 07:32:16 2017

Code: 0x00000159
Class: 2
Locale: 0x20
Event Description: Controller encountered a fatal error and was reset
Event Data:
===========
None

并查找与插槽 23 相关的消息:

$ cat lsi-events.log | grep -P -i 's23' | tail -30

Event Description: Power state change on PD 1f(e0x21/s23) from POWERSAVE(1) to TRANSITION(ff)
Event Description: Power state change on PD 1f(e0x21/s23) from TRANSITION(ff) to ON(0)
Event Description: Power state change on PD 1f(e0x21/s23) from ON(0) to POWERSAVE(1)
Event Description: Inserted: PD 1f(e0x21/s23)
Event Description: Inserted: PD 1f(e0x21/s23) Info: enclPd=21, scsiType=0, portMap=10, sasAddr=5000c50034366199,5000c5003436619a
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: Power state change on PD 1f(e0x21/s23) from ON(0) to POWERSAVE(1)
Event Description: Power state change on PD 1f(e0x21/s23) from POWERSAVE(1) to TRANSITION(ff)
Event Description: Power state change on PD 1f(e0x21/s23) from TRANSITION(ff) to ON(0)
Event Description: Inserted: PD 1f(e0x21/s23)
Event Description: Inserted: PD 1f(e0x21/s23) Info: enclPd=21, scsiType=0, portMap=10, sasAddr=5000c50034366199,5000c5003436619a
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: Inserted: PD 1f(e0x21/s23)
Event Description: Inserted: PD 1f(e0x21/s23) Info: enclPd=21, scsiType=0, portMap=10, sasAddr=5000c50034366199,5000c5003436619a
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: Power state change on PD 1f(e0x21/s23) from ON(0) to POWERSAVE(1)
Event Description: Inserted: PD 1f(e0x21/s23)
Event Description: Inserted: PD 1f(e0x21/s23) Info: enclPd=21, scsiType=0, portMap=10, sasAddr=5000c50034366199,5000c5003436619a
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: Inserted: PD 1f(e0x21/s23)
Event Description: Inserted: PD 1f(e0x21/s23) Info: enclPd=21, scsiType=0, portMap=10, sasAddr=5000c50034366199,5000c5003436619a
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: Power state change on PD 1f(e0x21/s23) from ON(0) to POWERSAVE(1)
Event Description: Global Hot Spare PD 1f(e0x21/s23) (global,rev) disabled
Event Description: State change on PD 1f(e0x21/s23) from HOT SPARE(2) to UNCONFIGURED_GOOD(0)
Event Description: Power state change on PD 1f(e0x21/s23) from POWERSAVE(1) to TRANSITION(ff)
Event Description: Global Hot Spare created on PD 1f(e0x21/s23) (global,rev)
Event Description: State change on PD 1f(e0x21/s23) from UNCONFIGURED_GOOD(0) to HOT SPARE(2)
Event Description: Power state change on PD 1f(e0x21/s23) from TRANSITION(ff) to ON(0)
Event Description: Power state change on PD 1f(e0x21/s23) from ON(0) to POWERSAVE(1)

我联系了数据中心,并被告知驱动器 10 上出现了闪烁的灯,因此我查看了该驱动器:

$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDInfo -PhysDrv [33:10] -a0

Enclosure Device ID: 33
Slot Number: 10
Drive's postion: DiskGroup: 0, Span: 0, Arm: 10
Enclosure position: 1
Device Id: 18
WWN: 5000C500344D5940
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Emulated Drive: No
Firmware state: Online, Spun Up
Commissioned Spare : No
Emergency Spare : No
Device Firmware Level: 0006
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c500344d5941
SAS Address(1): 0x5000c500344d5942
Connected Port Number: 0(path0) 1(path1) 
Inquiry Data: SEAGATE ST32000444SS    00069WM6369D            
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: Hard Disk Device
Drive Temperature :26C (78.80 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Port-1 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Drive has flagged a S.M.A.R.T alert : No

Exit Code: 0x00

我也尝试使用 smartctl:

$ sudo smartctl -a -d megaraid,18 /dev/sdc

smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.11.1.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor:               SEAGATE 
Product:              ST32000444SS    
Revision:             0006
User Capacity:        2,000,398,934,016 bytes [2.00 TB]
Logical block size:   512 bytes
Logical Unit id:      0x5000c500344d5943
Serial number:        9WM6369D0000914458SC
Device type:          disk
Transport protocol:   SAS
Local Time is:        Tue Feb 28 17:18:33 2017 CST
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK

Current Drive Temperature:     26 C
Drive Trip Temperature:        68 C
Manufactured in week 21 of year 2011
Specified cycle count over device lifetime:  10000
Accumulated start-stop cycles:  41
Specified load-unload count over device lifetime:  300000
Accumulated load-unload cycles:  41
Elements in grown defect list: 0
Vendor (Seagate) cache information
  Blocks sent to initiator = 3508224337
  Blocks received from initiator = 38846232
  Blocks read from cache and sent to initiator = 44013719
  Number of read and write commands whose size <= segment size = 2649500
  Number of read and write commands whose size > segment size = 4
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 45862.30
  number of minutes until next internal SMART test = 46

Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   22540834        0         0  22540834   22540834        230.346           0
write:         0        0         0         0          0         20.012           0
verify: 161330204        1         0  161330205   161330205       1896.577           0

Non-medium error count:        0

[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
No self-tests have been logged
Long (extended) Self Test duration: 18500 seconds [308.3 minutes]
linux raid hardware-raid lsi megacli
  • 1 个回答
  • 2166 Views
Martin Hope
igal
Asked: 2016-03-14 06:40:35 +0800 CST

僵尸 lxc 交换文件:文本文件忙但没有 pid

  • 1

我有一台运行 Ubuntu 12.04.5 LTS(Precise Pangolin)的服务器。在该服务器上,我创建了一个新的 Linux 容器:

$ sudo lxc-create -n mycontainer

过了一会儿,我决定摆脱这个容器:

$ sudo lxc-destroy -n mycontainer

但是我收到以下错误:

rm: cannot remove `/var/lib/lxc/mycontainer/rootfs/swapfile': Operation not permitted

我试图手动删除有问题的文件:

$ sudo rm /var/lib/lxc/mycontainer/rootfs/swapfile

但是,果然,这给了我同样的错误信息。

我用 lsattr 检查了扩展文件属性,以确保它不是不可变的:

$ sudo lsattr /var/lib/lxc/mycontainer/rootfs/swapfile
-------------e- /var/lib/lxc/mycontainer/rootfs/swapfile

作为一个实验,我试图覆盖文件:

$ echo '' > /var/lib/lxc/mycontainer/rootfs/swapfile

这给了我一个新的错误信息:

bash: /var/lib/lxc/mycontainer/rootfs/swapfile: Text file busy

所以我尝试使用 lsof 来获取正在使用该文件的进程的 pid:

$ sudo lsof /var/lib/lxc/mycontainer/rootfs/swapfile

这没有产生任何输出。我用定影器尝试了同样的事情:

$ sudo fuser /var/lib/lxc/mycontainer/rootfs/swapfile

再次,没有输出。

我还要提到我检查了文件的大小:

$ sudo du -h /var/lib/lxc/mycontainer/rootfs/swapfile
1.1G    /var/lib/lxc/mycontainer/rootfs/swapfile

这是怎么回事,我该如何摆脱这个文件?

ubuntu
  • 1 个回答
  • 834 Views
Martin Hope
igal
Asked: 2015-10-26 10:24:57 +0800 CST

在 Ubuntu 12.04 上检查 Apache 2.2 的健全性检查 mod_rewrite

  • 0

摘要:我正在测试一个简单的包罗万象的重写规则。它似乎没有生效,没有被记录,我也没有收到任何错误。


我是一名初级服务器管理员,试图更好地了解如何配置 Apache Web 服务器。现在我正在阅读一些文档并在 Ubuntu 12.04.5 LTS(Precise Pangolin)上试验 Apache/2.2.22。

我读过的一条建议是,使用 mod_rewrite 明确要求 HTTP/1.1 并拒绝 HTTP/1.0 请求是一个很好的策略。给出的示例代码如下:

RewriteEngine On
RewriteCond %{THE_REQUEST} !HTTP/1\.1$
RewriteRule .* - [F]

我尝试将此块添加到我的配置文件中:

/etc/apache2/conf.d/security

我还检查以确保 mod_rewrite 已启用并且没有其他冲突的重写规则,例如:

$ sudo a2enmod rewrite

>   Module rewrite already enabled

$ grep -Firl 'Rewrite' /etc/apache2/

>   /etc/apache2/conf.d/security
>   /etc/apache2/mods-enabled/rewrite.load
>   /etc/apache2/mods-available/rewrite.load

然后我重新启动 Apache 并使用 curl 测试了新配置:

curl --http1.0 127.0.0.1

不幸的是,我返回了默认的欢迎页面,而不是预期的 403 FORBIDDEN 响应。经过一番修改后,我最终得到了以下重写配置(在 /etc/apache2/conf.d/security 中):

RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 3
RewriteCond %{THE_REQUEST} ^.*$
RewriteRule ^.*$ - [F]

我再次得到 Apache 默认欢迎页面,而不是预期的 403 FORBIDDEN 响应。这是一个示例会话,我在其中使用 curl 测试服务器,然后检查日志文件(重写、错误和访问日志):

$ sudo service apache2 restart

>   * Restarting web server apache2
>   ... waiting .                           [OK ]

$ curl 127.0.0.1

>   <html><body><h1>It works!</h1>
>   <p>This is the default web page for this server.</p>
>   <p>The web server software is running but no content has been added, yet.</p>
>   </body></html>

$ sudo tail -1 /var/log/apache2/rewrite.log

>

$ sudo tail -2 /var/log/apache2/error.log

>   [Sun Oct 25 18:13:13 2015] [notice] caught SIGTERM, shutting down
>   [Sun Oct 25 18:13:13 2015] [notice] Apache/2.2.22 (Ubuntu) configured -- resuming normal operations

$ sudo tail -1 /var/log/apache2/access.log

>   127.0.0.1 - - [25/Oct/2015:18:13:16 +0000] "GET / HTTP/1.1" 200 402 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"

是什么赋予了?

apache-2.2
  • 1 个回答
  • 255 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve