如果服务器crash了或者就hang住了,我们不必要跑到机房去按电源键的,因为我们也想“运筹帷幄之中,决胜千里之外”嘛。我们可以用IPMI,它可以让我们远程用一条命令开启(关闭、重启)一台服务器,也可以检查服务器的状态。

IPMI简介:from wikipedia

The Intelligent Platform Management Interface (IPMI) is a standardized computer system interface used by system administrators to manage a computer system and monitor its operation.

The development of this interface specification was led by Intel Corporation and is supported by more than two hundred computer systems vendors.[1]. Dell, Hewlett-Packard, Intel, and NEC Corporation announced IPMI v1.0 on 1998-09-16, v1.5 on 2001-03-01, and v2.0 on 2004-02-14.

The baseboard management controller (BMC) is the intelligence in the IPMI architecture. It is a specialized microcontroller embedded on the motherboard of a computer, generally a server. The BMC manages the interface between system management software and platform hardware.

Different types of sensors built into the computer system report to the BMC on parameters such as temperature, cooling fan speeds, power status, operating system (OS) status, etc.

服务器端IPMI的配置:

我目前测试SNB-EP平台的机器,可以直接在BIOS中设置IPMI即可,都不必到OS中去进行设置了. (尽量将第一个网络接口插上网线,有人说是通过第一个网口来控制的,这个我不确定。)

开启服务器,按F2进入BIOS,选择:Server Management à BMC LAN Configuration  激活IPMI。

可以IP地址,比如改为192.168.111.111,子网掩码:255.255.0.0  (当然也可以设置为dynamic动态获取IP)。

在下面User configuration设置中Enable一些user,将有管理权限的用户enable起来,也可以设置管理密码、修改用户名等工作。

设置好后,就reboot系统,在局域网中另外的系统上ping一下刚才设置的IP 192.168.111.111,看看通不通,如果ping不通,可以试试去将server的电源线拔掉,并按开机安按钮让其放电,然后再重新插上电源线,开机。(我就遇到这样的问题)

对于不能再BIOS中直接enable BMC user的机器,可以先将BMC的IP什么的设好(这时在子网中应该能ping通BMC的IP了),然后到linux操作系统中进行一些额外的设置。

  1. load impi drivers:

modprobe ipmi_msghandler

modprobe ipmi_devintf

modprobe ipmi_si

  1. install ipmitool: maybe use rpm package to install
  2. ipmitool lan print 1   # to find the LAN channel
  3. configure IP address setting:

dynamic:  ipmitool lan set 1 ipsrc dhcp

static :

# ipmitool lan set 1 ipaddr 192.168.111.111

# ipmitool lan set 1 netmask 255.255.0.0

# ipmitool lan set 1 defgw ipaddr 192.168.0.1

  1. Establish an administration account with username and password.

Set BMC to require password authentication for ADMIN access over LAN. For example:

# ipmitool lan set 1 auth ADMIN MD5,PASSWORD

List the account slots on the BMC and identify an unused slot:

# ipmitool channel getaccess 1

Assign the administrator user name and password and enable messaging for the identified slot.

# ipmitool user set name 4 myuser

# ipmitool user set password 4 mypassword

# ipmitool user enable 4

# ipmitool channel setaccess 1 4 callin=off ipmi=on link=on privilege=4

  1. Verify the setup after you complete configuration using the command ipmitool lan print.

# ipmitool lan print 1

# ipmitool channel getaccess 1 4

在客户端的IPMI远程操作:

在远程操作的机器上也需要安装impitool,然后通过一些命令来操作被控制的机器。

# ipmitool -H yourIP -U myuser -P mypassword power status  (查看服务器的电源状态)

# ipmitool -H yourIP -U myuser -P mypassword power reset   (关闭电源并重启机器)

# ipmitool -H yourIP -U myuser -P mypassword power on   (开电源启动机器)

# ipmitool -H yourIP -U myuser -P mypassword power on   (关闭电源)

# ipmitool -H 192.168.12.84 -I lanplus -U test -P 123456 sdr type Temperature (服务器温度)

其他更多功能,可以man ipmitool

一些参考资料:

http://wiki.adamsweet.org/doku.php?id=ipmi_on_linux

http://www.6curl.com/ipmi-config-error/

http://www.ibm.com/developerworks/cn/linux/l-ipmi/index.html

http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaai%2Fipmi%2Fliaaiipmipassword.htm

IPMI设置与使用(远程控制服务器)的更多相关文章

  1. 分享一个小设置-项目启动时服务器指向本地IIS

    背景,在X公司做的一个网站登录时需要域名的支持,就是说浏览器地址栏在localhost+端口号的形式下无法实现登录(必须是xxxx域名的形式), 但是很多时候都会先在线下进行测试,既然本地没有线上的环 ...

  2. 通过设置代理,解决服务器禁止抓取,报“java.io.IOException: Server returned HTTP response code: 403 for URL”错误的方法

    java.io.IOException: Server returned HTTP response code: 403 for URL: http:// 这个是什么异常呢? 当你使用java程序检索 ...

  3. 设置 SSH Key 登录服务器和 Git 服务器

    设置 SSH Key 登录服务器 通过 ssh 登录服务器,一直都是用的账号和密码,今天看到一篇文章说这样不安全,使用 ssh key 的方式登录则是更好的选择,因此,研究实践了一下,并记录在这里. ...

  4. 如何设置Oracle客户端与服务器的字符集一致

    查看 Oracle 服务器字符集 select userenv('language') from dual; 设置Oracle客户端字符集 添加环境变量NLS_LANG 值与服务器的Oracle服务器 ...

  5. sql server service broker中调用存储过程执行跨库操作,不管怎么设置都一直提示 服务器主体 "sa" 无法在当前安全上下文下访问数据库 "dbname"。

    用sql server自带的消息队列service borker,调用存储过程中,执行了一个跨库的操作,先是用了一个用户,权限什么都给够了,但是一直提示 服务器主体 "user" ...

  6. tomcat6~7~8用户设置及一个独立服务器上跑多个tomcat配置JVM设置优化亲测

    tomcat6管理用户 在tomcat `安装根目录`/conf/tomcat-users.xml

  7. RHEL7 -- 使用Chrony设置时间与时钟服务器同步

    Chrony是一个开源的自由软件,它能保持系统时钟与时钟服务器(NTP)同步,让时间保持精确. 它由两个程序组成:chronyd和chronyc. chronyd是一个后台运行的守护进程,用于调整内核 ...

  8. 设置新时间校正服务器NTP SERVER

    时间校正服务器IP : 10.*.*.* 适用系统:windows server 2008/windows 7 net stop w32time net start w32time w32tm /qu ...

  9. 使用ipmitool 命令添加IPMI 界面的SMTP邮件服务器地址

    目前要通过ipmitool工具在IPMI的界面上添加邮件服务器地址,该脚本如下 SMTP.sh #!/bin/bash ipmitool raw 0x32 0x78 0x01 0x01 0x00 0x ...

随机推荐

  1. keras_基本网络层结构(1)_常用层

    参考文献: https://blog.csdn.net/sinat_26917383/article/details/72857454 http://keras-cn.readthedocs.io/e ...

  2. 关于C#引用dll动态链接库文件的注释问题

    1.dll动态库文件项目生成属性中要勾选"XML文档文件" 注意:1).要选中项目,查看项目属性,选中解决方案是找不到的.2).XML文件的名字不要修改. 2.添加引用时XML文件 ...

  3. HDU3861The King’s Problem

    HDU3861   kosaraju缩点+最小路径覆盖 为什么是最小路径覆盖呢,我们假设有一个如下DAG图 目前我们1出发到了3处,对于3的儿子4.5.6,肯定是不能彼此到达的.所以最好的情况3只能延 ...

  4. python 用 __all__ 暴露接口

    非常典型的python的用法 refer to : http://python-china.org/t/725

  5. LeetCode OJ - Best Time to Buy and Sell Stock

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/xiezhihua120/article/details/32939749 Say you have ...

  6. Swift学习——A Swift Tour 协议和扩展

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/zhenyu5211314/article/details/28854395 Protocols an ...

  7. 基于http协议的加密传输方案

    最近公司需要通过公网与其它平台完成接口对接,但是基于开发时间和其它因素的考虑,本次对接无法采用https协议实现.既然不能用https协议,那就退而求其次采用http协议吧! 那么问题来了!在对接的过 ...

  8. HDFS 和 YARN 的 HA 故障切换【转】

    来源:https://blog.csdn.net/u011414200/article/details/50336735 一 非 HDFS HA 集群转换成 HA 集群二 HDFS 的 HA 自动切换 ...

  9. UOJ 55 【WC2014】紫荆花之恋——点分治+平衡树

    题目:http://uoj.ac/problem/55 点分治.在点分树上每个点上用 splay 维护管辖的点的情况.做几次就重构点分树.TLE.只能过 20 分. #include<cstdi ...

  10. sublime text 2 卸载与重装

    很多同学使用 sublime text2 的时候,出现一些奇怪的bug,且重启无法修复. 于是,就会想到卸载 sublime text2 再重新安装. 然而,你会发现,重新安装后,这个bug任然存在, ...