Dell R730XD服务器如何确定是哪块硬盘坏了

公司的Dell R720XD服务器是用来做Hadoop大数据的。 其中有两块300G的硬盘做Raid1,作为系统盘。 剩下3块硬盘是4TB,都是独立的,没有做任何Raid,单独做数据盘。 但是,这三块硬盘都被 Dell H330 的Raid控制器控制,于是3块硬盘呢,其实每个都是个单独的 Raid0 去机房巡检的过程中,发现一个硬盘亮黄灯。 从idrac口可以看到坏了个硬盘 问题来了,三块啊,到底是哪块坏了呢? 注意上图,修订是:GS0F,序列号是:Z1Z83DXH 我了个擦,所有硬盘都被h330接管,所以lspci什么也看不出来,只能看出是个lsi的MegaRAID!!! lspci|grep Mega 02:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS-3 3008 [Fury] (rev 02) 没办法,先去下个MegaCLI吧: MegaCli.tgz cd /opt/MegaRAID tar zxvf MegaCli.tgz 再下个python, mega-status.py chmod 755 mega-status.py ./mega-status.py 注意这个脚本是引用了64位的megacli def_megaclipath = "/opt/MegaRAID/MegaCli/MegaCli64" 看运行结果啊 这里把修订和序列号连在一起了: GS0FZ1Z83DXH 对应c0u2p0,对应上面的c0u2,对应右边的/dev/sdc 所以是/dev/sdc坏掉了。 搞定。 这样就可以先卸载/dev/sdc,然后换盘了。

2024年01月23日 · 1 分钟 · 55 字 · 八戒

小微vps下运行nodejs需要注意的gc

NodeJS默认64位机器GC是有1.4G内存,所以,如果是512或者128兆内存的小vps,立时就不灵了。 需要加参数 --max_old_space_size=128 --optimize_for_size 一句话搞定。

2024年01月23日 · 1 分钟 · 5 字 · 八戒

在linux下用SSD盘来加速HDD硬盘

如上图,数据写到硬盘有两种方式,一种是Bcache用SSD做缓冲,加速最后的硬盘读写。另一种是直接读写硬盘,bypass模式。我们用的是第一种Bcache。 安装: $ yum install bcache-tools /dev/sda是硬盘,/dev/sdb是ssd, 首先把两个盘的数据都擦干净了 $ wipefs -a /dev/sda1 ; wipefs -a /dev/sdb1 格式化hdd和ssd,注意参数不同 $ make-bcache -B /dev/sda1 ; make-bcache -C /dev/sdb1 挂接bcache0 $ echo C_Set_UUID_VALUE > /sys/block/bcache0/bcache/attach $ mkfs.ext4 /dev/bcache0 $ mount /dev/bcache0 /mnt 修改硬盘写的方法,改成writeback(原来是writethrough) 1.临时生效的方法(重启失效) $ echo writeback > /sys/block/bcache0/bcache/cache_mode 2.永久生效的方法 $ echo /dev/sda1 > /sys/fs/bcache/register 最后查看一下状态: $ bcache-status -s

2024年01月23日 · 1 分钟 · 55 字 · 八戒

如何禁止libvirtd自带的dnsmasq启动

服务器要跑dnsmasq,同时机器还跑着kvm,和libvirtd自带dnsmasq的冲突了,需要禁掉libvirtd的。 方法很简单,如下: virsh net-list Name State Autostart Persistent -------------------------------------------------- default active yes yes virsh net-autostart --disable default virsh net-destroy default 搞定.

2024年01月23日 · 1 分钟 · 21 字 · 八戒

Nginx下lua根据客户端ip进行分发

公司的线上环境分为预发布和正式两个部分。 其实两个部分是公用一个Nginx前端的。 这样怎么分发呢? 用lua即可,如果是公司来的某个固定ip,则分发到预发布,如果不是,就走正式环境。这样测试就简单多了,运维统一设置一个无线wifi,接入这个wifi就走某个固定ip,到的全是预发布环境,不用这个wifi就走正式环境,非常方便测试。 用lua进行分发: location / { content_by_lua ' myIP = ngx.req.get_headers()["X-Real-IP"] if myIP == nil then myIP = ngx.req.get_headers()["x_forwarded_for"] end if myIP == nil then myIP = ngx.var.remote_addr end if myIP == "公司出口IP" then ngx.exec("@client") else ngx.exec("@client_test") end '; } location @client{ proxy_next_upstream error timeout; proxy_redirect off; proxy_set_header Host $host; #proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 256k; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; proxy_buffer_size 8k; proxy_buffers 8 64k; proxy_busy_buffers_size 128k; proxy_temp_file_write_size 128k; proxy_pass http://client; } location @client_test{ proxy_next_upstream error timeout; proxy_redirect off; proxy_set_header Host $host; #proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $http_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 100m; client_body_buffer_size 256k; proxy_connect_timeout 180; proxy_send_timeout 180; proxy_read_timeout 180; proxy_buffer_size 8k; proxy_buffers 8 64k; proxy_busy_buffers_size 128k; proxy_temp_file_write_size 128k; proxy_pass http://client_test; }

2024年01月23日 · 1 分钟 · 124 字 · 八戒

lua与redis结合应用于nginx的动态upstream

技术要求很简明: nginx分发请求的时候,upstream是由lua从redis中读取配置动态生成的,这样便于用程序动态修改。 装好nginx+lua,过程不表。 把lua redis的模块配到路径中 wget https://raw.github.com/nrk/redis-lua/version-2.0/src/redis.lua nginx配置如下: server { listen 80; server_name _; server_name_in_redirect off; port_in_redirect off; root /root/html; location / { set $upstream ""; rewrite_by_lua ' -- load global route cache into current request scope -- by default vars are not shared between requests local routes = _G.routes -- setup routes cache if empty if routes == nil then routes = {} ngx.log(ngx.ALERT, "Route cache is empty.") end -- try cached route first local route = routes[ngx.var.http_host] if route == nil then local redis = require "redis" local client = redis.connect("localhost", 6379) route = client:get(ngx.var.http_host) end -- fallback to redis for lookups if route ~= nil then ngx.var.upstream = route routes[ngx.var.http_host] = route _G.routes = routes else ngx.exit(ngx.HTTP_NOT_FOUND) end '; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; proxy_connect_timeout 10; proxy_send_timeout 30; proxy_read_timeout 30; proxy_pass http://$upstream; } } 送进redis一些数据 ...

2024年01月23日 · 1 分钟 · 165 字 · 八戒

kvm的虚机中如何在线挂接一块新网卡

比较古怪的需求,公司拉了根专线到机房。 而使用专线的机器是一台kvm虚机,实体机有自己的路由,实体机的前两个网卡做了双网卡bonding。 那虚机就只能使用实机的第三块网卡连出去了,而且必须制定host的路由,这里给的子网掩码是255.255.255.252,只有2个ip可以用,所以只能虚机有ip,实机根本不能配ip地址!!! 首先把实机dell r720的第三块网卡em3改一下,连接到网桥br1 cat /etc/sysconfig/network-scripts/ifcfg-em3 DEVICE=em3 HWADDR=XX:XX:XX:XX:XX:XX TYPE=Ethernet UUID=6b68220d-d5ed-496f-b8d1-4c6d9cbb1234 ONBOOT=yes NM_CONTROLLED=no BRIDGE=br1 再做个网桥br1 cat /etc/sysconfig/network-scripts/ifcfg-br1 DEVICE=br1 BOOTPROTO=none ONBOOT=yes TYPE=Bridge 注意,这个物理机网卡和网桥都没有IP地址,实在是可怜,ip不够用 然后启动他们: ifup em3 ifup br1 虚机挂接新设备: virsh attach-interface --domain vis-16-13-28 \ --type bridge \ --source br1 --model virtio \ --mac f0:00:ac:30:2d:1d --config 然后ssh登录虚机,配置好虚机中eth1的ip/mask,不要配gateway啊 最后直接加主机路由: route add -host 172.17.11.182 dev eth1 ping一下对端172.17.11.182,通就搞定了。

2024年01月23日 · 1 分钟 · 53 字 · 八戒

mvn build的时候控制日志输出

最近在弄jenkins的自动打包部署 出现个问题,项目是用的mvn,打包的时候,如果是在控制台下还好。 如果是在jenkins下,看console output,往中心仓库artifactory提交包的时候,会显示下面一堆: Uploaded: http://xxx:8081/artifactory/libs-release-local/abc/maven-metadata.xml (315 B at 17.1 KB/sec) Uploading: http://xxx:8081/artifactory/libs-release-local/abc/d/admin-9.1.war 20000/21969 KB 20002/21969 KB 20004/21969 KB 20006/21969 KB 20008/21969 KB 20010/21969 KB 20012/21969 KB 20014/21969 KB 20016/21969 KB 20018/21969 KB 20020/21969 KB 20022/21969 KB 20024/21969 KB 20026/21969 KB 20028/21969 KB 20030/21969 KB 20032/21969 KB 20034/21969 KB 20036/21969 KB 20038/21969 KB 20040/21969 KB 20042/21969 KB 20044/21969 KB ...... 长度无比长,垃圾东西。如何将之屏蔽呢? 首先去修改mvn的日志级别,缺省是INFO,提高到WARN: MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn mvn -ff clean install 我去,INFO是都没了,但是这个居然还在!!!! 查了下java的日志优先级: ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF 上面只有FATAL和OFF了,说明这个是个副产品,不是mvn控制的,而是上传的时候产生的。 ...

2024年01月23日 · 1 分钟 · 137 字 · 八戒

syslog级别详解

首先是: [facility].[priority] facility表示设备、设施,特别装置: auth # 认证相关的 authpriv # 权限,授权相关的 cron # 任务计划相关的 daemon # 守护进程相关的 kern # 内核相关的 lpr # 打印相关的 mail # 邮件相关的 mark # 标记相关的 news # 新闻相关的 security # 安全相关的,与auth 类似 syslog # syslog自己的 user # 用户相关的 uucp # unix to unix cp 相关的 local0 到 local7 # 用户自定义使用 * # *表示所有的facility 一定要注意上面的,local0 到 local7 # 用户自定义使用 priority表示优先权,日志优先权(log level),一般有以下几种优先权(从低到高): debug # 程序或系统的调试信息 info # 一般信息, notice # 不影响正常功能,需要注意的消息 warning/warn # 可能影响系统功能,需要提醒用户的重要事件 err/error # 错误信息 crit # 比较严重的 alert # 必须马上处理的 emerg/oanic # 会导致系统不可用的 * # 表示所有的日志级别 none # 跟* 相反,表示啥也没有 syslog的日志优先权默认是info,这时候用syslog为debug(最低日志优先权)来写日志,syslog服务是不会写入日志的。

2024年01月23日 · 1 分钟 · 94 字 · 八戒

Xpath金手指

最近在搞puppeteer的自动化,有很多地方需要用到CSS Selector,但是某些地方又是用Xpath方便,金手指放一下,备查: Test queries in the Xpath test bed: Xpath test bed (whitebeam.org) Browser console $x("//div") Works in Firefox and Chrome. #Selectors Descendant selectors h1 //h1 div p `//div//p ul > li `//ul/li ul > li > a //ul/li/a div > * //div/* :root `/ :root > body /body Attribute selectors #id //*[@id="id"] .class //*[@class="class"] …kinda input[type="submit"] //input[@type="submit"] a#abc[for="xyz"] `//a[@id=“abc”][@for=“xyz”] a[rel] //a[@rel] a[href^='/'] `//a[starts-with(@href, ‘/’)] a[href$='pdf'] //a[ends-with(@href, '.pdf')] a[href*='://'] //a[contains(@href, '://')] a[rel~='help'] //a[contains(@rel, 'help')] …kinda Order selectors ul > li:first-of-type `//ul/li[1] ul > li:nth-of-type(2) //ul/li[2] ul > li:last-of-type //ul/li[last()] li#id:first-of-type `//li[1][@id=“id”] a:first-child //*[1][name()="a"] a:last-child //*[last()][name()="a"] Siblings h1 ~ ul `//h1/following-sibling::ul h1 + ul //h1/following-sibling::ul[1] h1 ~ #id //h1/following-sibling::[@id="id"] jQuery $('ul > li').parent() `//ul/li/.. $('li').closest('section') //li/ancestor-or-self::section $('a').attr('href') `//a/@href $('span').text() //span/text() Other things h1:not([id]) `//h1[not(@id)] Text match `//button[text()=“Submit”] Text match (substring) //button[contains(text(),"Go")] Arithmetic //product[@price > 2.50] Has children //ul[*] Has children (specific) //ul[li] Or logic `//a[@name or @href] Union (joins results) `//a | //div Class check //div[contains(concat(' ',normalize-space(@class),' '),' foobar ')] Xpath doesn’t have the “check if part of space-separated list” operator, so this is the workaround (source). ...

2024年01月22日 · 4 分钟 · 740 字 · 八戒