naotottyのはてなブログ

仕事とか技術調べでヤッてみたことを書く

Dockerなどこっかー DockerHackDayやっているらしい

以下、twitterより




CentOS 6.4でvault.centos.orgのSRPMSリポジトリを設定する

下記のように /etc/yum.repos.d/ 以下にファイルを置く






[root@dev-dhcp0001 ~]# cat /etc/yum.repos.d/CentOS-SRPMS.repo | head -22

#-----------------
#
[SRPMS-base]
name=SRPMS CentOS-$releasever - Base
# baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
#baseurl=http://vault.centos.org/6.4/os/Source/SPackages/
baseurl=http://vault.centos.org/6.4/os/Source/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

[SRPMS-updates]
name=SRPMS CentOS-$releasever - Updates
## baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
#baseurl=http://vault.centos.org/6.4/updates/Source/SPackages/
baseurl=http://vault.centos.org/6.4/updates/Source/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1




yumdownloaderコマンドに"--source"オプションを付けてダウンロード






[root@dev-dhcp0001 ~]# yumdownloader dhcp --source
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Enabling epel-source repository
dhcp-4.1.1-34.P1.el6.centos.src.rpm


| 1.2 MB 00:02



yumdownloaderは yum-utils パッケージに入っている





[root@dev-dhcp0001 ~]# rpm -qif /usr/bin/yumdownloader
Name : yum-utils Relocations: (not relocatable)
Version : 1.1.30 Vendor: CentOS
Release : 14.el6 Build Date: 2012年06月22日 21時23分05秒
Install Date: 2013年02月27日 20時44分01秒 Build Host: c6b8.bsys.dev.centos.org
Group : Development/Tools Source RPM: yum-utils-1.1.30-14.el6.src.rpm
Size : 308503 License: GPLv2+
Signature : RSA/SHA1, 2012年06月25日 07時19分08秒, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem http://bugs.centos.org
URL : http://yum.baseurl.org/download/yum-utils/
Summary : Utilities based around the yum package manager
Description :
yum-utils is a collection of utilities and examples for the yum package
manager. It includes utilities by different authors that make yum easier and
more powerful to use. These tools include: debuginfo-install,
find-repos-of-install, needs-restarting, package-cleanup, repoclosure,
repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync,
repotrack, show-installed, show-changed-rco, verifytree, yumdownloader,
yum-builddep, yum-complete-transaction, yum-config-manager, yum-debug-dump,
yum-debug-restore and yum-groups-manager.

ipmitoolでMC(管理プロセッサ)の時刻を確認、設定する

時間がずれていると、alertのログ表示などがへんな時間で表示されるので、修正する。



確認するコマンド

root@kvm-storage:~# ipmitool sel time get
08/17/2012 18:02:06


設定するコマンド

root@kvm-storage:~# ipmitool sel time set "08/17/2012 18:02:00"
08/17/2012 18:02:00

MegaRAID系でRAID HDDのトラブル時にAlarm音が鳴るのを停止する (MegaCLI)

unconfiguredなステータスのディスクがでた時にAlarm音が鳴り響いてちょっとディスク交換までうるさいので、
コマンドで止めることに。


以下の様な感じで、アダプターにパラメータをセットします(-AdpSetProp)。


root@kvm-storage:~# /opt/MegaRAID/CLI/MegaCli -AdpSetProp AlarmSilence -aALL
Adapter 0: Set alarm to Silenced success.
Adapter 1: Set alarm to Silenced success.
Exit Code: 0x00



このあたりのコマンド

MegaCli -AdpSetProp {CacheFlushInterval -val} | { RebuildRate -val}
| {PatrolReadRate -val} | {BgiRate -val} | {CCRate -val}
| {ReconRate -val} | {SpinupDriveCount -val} | {SpinupDelay -val}
| {CoercionMode -val} | {ClusterEnable -val} | {PredFailPollInterval -val}
| {BatWarnDsbl -val} | {EccBucketSize -val} | {EccBucketLeakRate -val}
| {AbortCCOnError -val} | AlarmEnbl | AlarmDsbl | AlarmSilence
| {SMARTCpyBkEnbl -val} | {SSDSMARTCpyBkEnbl -val} | NCQEnbl | NCQDsbl
| {MaintainPdFailHistoryEnbl -val} | {RstrHotSpareOnInsert -val}
| {DisableOCR -val} | {BootWithPinnedCache -val}
| AutoEnhancedImportEnbl | AutoEnhancedImportDsbl
| {EnblSpinDownUnConfigDrvs -val}|{UseDiskActivityforLocate -val} -aN|-a0,1,2|-aALL
| {ExposeEnclDevicesEnbl -val} | {SpinDownTime -val}
| {SpinUpEncDrvCnt -val} | {SpinUpEncDelay -val} -aN|-a0,1,2|-aALL

Mac OS X 10.8 Mountain Lionにbrewでlibvirtインストール

Mac OS X 10.8にしてから(upgradeで)ちょっとnetworkとか調子悪いんだけど、いろいろ環境整備。

まずは、Xcodeまわりはすべてインストールし直し。
homebrewをインストール。

OSX serverも数千円なんでポチッとインストール。



server:~ chroum$ brew search libvirt
libvirt


erver:~ chroum$ brew install libvirt
==> Installing libvirt dependency: cmake
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.8.mountainlion.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring cmake-2.8.8.mountainlion.bottle.3.tar.gz
/usr/local/Cellar/cmake/2.8.8: 653 files, 31M
==> Installing libvirt dependency: yajl
==> Downloading http://github.com/lloyd/yajl/tarball/2.0.4
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/yajl/2.0.4
==> make install
/usr/local/Cellar/yajl/2.0.4: 14 files, 228K, built in 35 seconds
==> Installing libvirt
==> Downloading http://libvirt.org/sources/stable_updates/libvirt-0.9.11.4.tar.gz
######################################################################## 100.0%^@
==> ./configure --prefix=/usr/local/Cellar/libvirt/0.9.11.4 --localstatedir=/usr/local/var --mandir=/usr/local/Cellar/l
^@==> make
^@==> make install
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/libvirt/0.9.11.4: 236 files, 24M, built in 3.0 minutes
server:~ chroum$

これで、virshコマンドとか使えるようになります。


server:~ chroum$ virsh
virsh にようこそ、仮想化対話式ターミナルです。

入力方法: 'help' コマンドに関するヘルプ
'quit' 終了します

virsh # quit

server:~ chroum$

bashの補完で表示されるコマンドはこんな感じ


server:~ chroum$ vir
virsh virt-host-validate virt-pki-validate virt-xml-validate