CB4 試す2

イメージが新しいのが出ていたので linaro-server をインストール

micro SD にイメージ展開

http://dl.cubieboard.org/model/cc-a80/Image/ubuntu-linaro/

# 7za e linaro-server-cb4-card-vga-v2.0.img.7z

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=ja_JP.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Processing archive: linaro-server-cb4-card-vga-v2.0.img.7z

Extracting  linaro-server-cb4-card-vga-v2.0.img

Everything is Ok

Size:       889192448
Compressed: 188975205
# dd if=./linaro-server-cb4-card-vga-v2.0.img of=/dev/sde

USB Mouse(はいらないけど)、USB Keyboard、VGAをCB4に挿して、micro sdを差し込んでブート

コンソールが現れる。

http://dl.cubieboard.org/model/cc-a80/Image/ubuntu-linaro-server/v2.0/README

  • DHCPでふられてるIPアドレス確認
  • linaro/linaroでSSHログイン
  • rootパスワード変更(デフォルト cubieboard)
  • /etc/network/interface の eth0 分を編集
  • auto eth0
    iface eth0 inet static
    # allow-hotplug eth0 ここコメントアウト
    address 192.168.0.50
    netmask 255.255.255.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
  • apache2, mysql , irqbalance サービス止める(# update-rc.d -f <service name> remove)
  • wlan の設定
  • #this is open wifi setting."your-ssid-here" and "your-passwd-here" should been replase with yours and remove the annotation
    
    auto wlan0
    iface wlan0 inet dhcp
    #pre-up ip link set wlan0 up
    #pre-up iwconfig wlan0 essid 12345-SSID
    wpa-ssid 12345-SSID
    wpa-psk MYPASSWORD
    
    #auto br0
    #iface br0 inet dhcp
    #bridge_ports eth0 wlan0
    
  • ifup eth0 や ifup wlan0 で有効化
  • mysql-server-core.5.5 , mysql-server-5.5 を apt-get remove , dpkg –purge
  • apache2 , apache2-bin , apache2-data も apt-get remove , dpkg –purge
  • apt-get install git

 

WiFi

The name of WIFI drive module is bcmdhd ,you can use command "lsmod " see that it has been loading .
Use command "iwlist wlan0 scan" can find the WIFI hotspot you want to connect .
Add the ssid and passwd into /etc/network/interfaces .

Beacuse first connect ,after reboot the board ,maybe need type:

#ifconfig wlan0 down
#ifconfig wlan0 up
#/etc/init.d/networking restart

Zabbix on a docker container (Inside CoreOS) .. setup log

  • CoreOS:607.0.0 (/etc/os-release)
  • Docker:version 1.5.0, build a8a31ef-dirty
  • Image:phusion/baseimage   0.9.16
  • Zabbix 2.4
core@coreos0 ~ $ docker run -itd --name zabbix -p 8081:80 phusion/baseimage:latest /bin/bash
58e286c670b84e57ecb6eca767d061f7b738940359c03cbcfe9b11f032dee4ad

core@coreos0 ~ $ docker exec -it zabbix bash

root@58e286c670b8:/# dpkg-reconfigure tzdata

Current default time zone: 'Asia/Tokyo'
Local time is now:      Sun Apr  5 11:45:31 JST 2015.
Universal Time is now:  Sun Apr  5 02:45:31 UTC 2015.

# apt-get update
# apt-get install wget
# wget http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.4-1+trusty_all.deb
# dpkg -i zabbix-release_2.4-1+trusty_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 16802 files and directories currently installed.)
Preparing to unpack zabbix-release_2.4-1+trusty_all.deb ...
Unpacking zabbix-release (2.4-1+trusty) ...
Setting up zabbix-release (2.4-1+trusty) ...

# apt-get update

# apt-get install zabbix-server-mysql zabbix-frontend-php

* Input MySQL Admin root/root
* Input for zabbix-server-mysql root/root
* 途中アボートするので、MySQLを手動で立ち上げ(service mysql start)て、retry

root@58e286c670b8:/etc/apache2/conf-available# cd
root@58e286c670b8:~# ls -ltr /etc/apache2/conf-available/
total 24
-rw-r--r-- 1 root root 2190 Jan 3 2014 security.conf
-rw-r--r-- 1 root root 189 Jan 3 2014 other-vhosts-access-log.conf
-rw-r--r-- 1 root root 3224 Jan 3 2014 localized-error-pages.conf
-rw-r--r-- 1 root root 315 Jan 3 2014 charset.conf
-rw-r--r-- 1 root root 455 Jan 7 2014 serve-cgi-bin.conf
lrwxrwxrwx 1 root root 23 Apr 5 02:15 zabbix.conf -> /etc/zabbix/apache.conf

-rw-r--r-- 1 root root 2190 Jan 3 2014 security.conf
-rw-r--r-- 1 root root 189 Jan 3 2014 other-vhosts-access-log.conf
-rw-r--r-- 1 root root 3224 Jan 3 2014 localized-error-pages.conf
-rw-r--r-- 1 root root 315 Jan 3 2014 charset.conf
-rw-r--r-- 1 root root 455 Jan 7 2014 serve-cgi-bin.conf
lrwxrwxrwx 1 root root 23 Apr 5 02:15 zabbix.conf -> /etc/zabbix/apache.conf
root@58e286c670b8:/etc/apache2/conf-available# more zabbix.conf
# Define /zabbix alias, this is the default
<IfModule mod_alias.c>
Alias /zabbix /usr/share/zabbix
</IfModule>

<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Tokyo
</Directory>

<Directory "/usr/share/zabbix/conf">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>

<Directory "/usr/share/zabbix/api">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>

<Directory "/usr/share/zabbix/include">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>

<Directory "/usr/share/zabbix/include/classes">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>

service mysql start
service mysql status
service apache2 start
service apache2 status

root@58e286c670b8:~# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 02:17 ? 00:00:00 /bin/bash
root 19 0 0 02:18 ? 00:00:00 bash
root 93 0 0 02:19 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 443 93 1 02:19 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --l
root 511 0 0 02:19 ? 00:00:00 [debian-start] <defunct>
root 649 0 1 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 653 649 0 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 654 649 0 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 655 649 0 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 656 649 0 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 657 649 0 02:19 ? 00:00:00 /usr/sbin/apache2 -k start
root 661 19 0 02:19 ? 00:00:00 ps -ef

http://coreos.tk.net:8081/
Access      http://coreos.tk.net:8081/zabbix

    • Pre-Requisites => all ok
    • DB connection => ok

Zabbix server name “empty”

  • Pre-Installation sumary
  • Install => OK => Finish

 

Login : Admin/zabbix

root@58e286c670b8:/# service zabbix-server start

ここまで、docker commit しておく

あとは、/etc/my_init.d 以下にスクリプト用意

 

::::::::::::::
01_mysqld
::::::::::::::
#!/bin/sh
exec /usr/bin/mysqld_safe > /dev/null 2>&1 &
::::::::::::::
02_apache2
::::::::::::::
#!/bin/sh
exec apache2ctl start
::::::::::::::
03_zabbix-server
::::::::::::::
#!/bin/sh
exec  /usr/sbin/zabbix_server

docker run 時に /sbin/my_init 指定してオシマイ。

UIを日本語にしたいなら、 apt-get install language-pack-ja しとく
ロケール変更は、右上のProfileから。

Fedora 18 を HP ProLiant ML110 G6に入れてみる

いきなりインストーラでこけます。

  • 「Install Fedora」を選んだあと画面が乱れているようだった
  • 「resolution=解像度」や「nofb」など試したがだめ

 

ProLiantに特有の問題のようでした。しかもFedora 16から・・・

回避方法:起動パラメータに「nomodeset」を付けて起動。

参考:Fedora Documentation

そうとう久々にインストールしてみたが、インストールがおもちゃっぽくなってるし。

インストール後

実はインストールの前にも以下のような出力が出ていたが、インストール後も出ていた。

Mar 23 22:56:07 localhost kernel: [ 0.000000] ACPI: ERST 00000000bf7acc3c 00270 (v01 HP ProLiant 06040000 PTL 00000001)
Mar 23 22:56:07 localhost kernel: [ 0.826291] ERST: Can not request iomem region <0x bf7ff000-0x bf800000> for ERST.

 

回避策としては、起動時のパラメータに「erst_disable」をつければよい。grub2になってどのファイルを編集すればよいのか迷ったが探して下記のように追記した。

対象ファイル:/boot/grub2/grub.cfg (/etc/grub2.cfg はリンク)

107         linux   /vmlinuz-3.6.10-4.fc18.x86_64 root=UUID=3201cb8f-d110-4535-a9bd-84e29cf8f51e ro rootflags=subvol=root nomodeset rd.md=0 rd.lvm=0 rd.dm=0  rd.luks=0 vconsole.keymap=us rhgb quiet erst_disable

 

起動時に、一瞬画面左上に

GRUB Loading. 
Welcom to GRUB!

 

と出る

 

 

 

 

だいぶおくれてOracle Database 11g R2入れる

なぐりがきメモ

目標

Oracle Database 11g R2をPacemakerでHA冗長化

環境

RHEL5.6 x86_64

インストール前

片方セットアップ

[root@rhel5-1 ~]# groupadd oinstall
[root@rhel5-1 ~]# groupadd dba
[root@rhel5-1 ~]# useradd -g oinstall -G dba oracle
[root@rhel5-1 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@rhel5-1 ~]# vi /etc/sysctl.conf
# Oracle Database 11g R2
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
[root@rhel5-1 ~]# vi /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240
[oracle@rhel5-1 ~]$ ulimit -Sn
1024
[oracle@rhel5-1 ~]$ ulimit -Hn
65536
[oracle@rhel5-1 ~]$ ulimit -Su
2047
[oracle@rhel5-1 ~]$ ulimit -Hu
16384
[oracle@rhel5-1 ~]$ ulimit -Ss
10240
[oracle@rhel5-1 ~]$ ulimit -Hs
unlimited
[root@rhel5-1 ~]# cd /opt/
[root@rhel5-1 opt]# mkdir app
[root@rhel5-1 opt]# cd
[root@rhel5-1 ~]# chown -R oracle:oinstall /opt/app
[root@rhel5-1 ~]# chmod -R 755 /opt/app
[root@rhel5-1 ~]#
[oracle@rhel5-1 ~]$ vi .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
# User specific aliases and functions
# Oracle Database 11g R2
ORACLE_BASE=/opt/app/oracle
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_SID

Pacemakerを試す。

興味のわいたものはためしておく。

環境

  • VMwre vSphere 4.1 の上にVMを2つ
  • RHEL5.6 x85_64
  • eth0,eth1を用意
  • 2ノードクラスタ(Active/Standby)とする

目標

Apacheを普通にHAシステムとする。紐付けるリソースはVIPアドレス。クラスタ制御部はheartbeat3とする。

手順(ハートビート、ノード参加まで)

以下を2つのサーバで実施

  1. RHELインストール
  2. Pacemakeインストール(参考:http://linux-ha.sourceforge.jp/wp/dl/pminstall_cent5)
  3. リポジトリからpm_extrasをインストール
  4. ha.cfの設定
  5. authkeysの設定
  6. Pacemaker機動(service heartbeat start)
  7. rcの設定はonにしとく(chkconfig –level 345 heartbeat on )
  8. Pacemakerはログが大量なのでsyslog.confで他のログにでるように設定
  9. crm_mon -A で状態確認

MEMO:インストールでは、RHELのCD-ROMをマウントしておき、yumでPacemakerをインストールするときには依存関係があった場合そこから解決するようにした。大まかに2の手順は、

  • epalをwgetでおとし、インストール
  • clusterlabs.repoをwgetでおとして、/etc/yum.repos.d配下へ
  • RHELメディアをマウントし、適当に作ったrepoファイル(参考:rhelmedia.repo)を/etc/yum.repos.d配下へ

[rhel-DVD]
name=RHEL
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  • yum install corosync.x86_64 heartbeat.x86_64 pacemaker.x86_64 を実行

クラスタ全体、およびリソース(RA)設定

クラスタ全体の設定、VIPアドレスとApache、またネットワークの設定

全体

# crm configure property no-quorum-policy=”ignore” stonith-enabled=”false”
# crm configure rsc_defaults resource-stickiness=”INFINITY” migration-threshold=”1″

Apache

# crm configure primitive httpd ocf:heartbeat:apache params configfile=”/etc/httpd/conf/httpd.conf” statusurl=”http://localhost/” testregex=”service” op monitor interval=”10s”

VIPアドレス

# crm configure primitive vip ocf:heartbeat:IPaddr2 params ip=”192.168.0.20″ nic=”eth0″ cidr_netmask=”24″ op monitor interval=”10s”

ApacheとVIPアドレスを1つのグループに

# crm configure group web vip httpd

サービス側ネットワークの監視

# crm configure primitive ping ocf:pacemaker:pingd params name=”default_ping_set” host_list=”192.168.68.2″multiplier=”100″ dampen=”1″ op monitor interval=”10s”
# crm configure clone clone_ping ping

試験

手動切り替え試験のコマンドは:crm resource migrate <resource name>

migrate後は、unmigrateでモードを元に戻す。

プライマリのサーバー側を強制ダウンさせ、セカンダリ側に切り替える。

参考

  • http://linux-ha.sourceforge.jp/wp/dl/pminstall_cent5
  • http://gihyo.jp/admin/serial/01/pacemaker/0002?page=1

 

ちょいハマりと感想

リソース障害を起こした後には、リソースがそのままでは回復しないようになっている。failcountをクリアしてやれば、直った。そういった解説がないと把握できない挙動には注意。

 

 

 

 

iscs-initiator on CentOS 5.5 x86

[root@lk1 etc]# yum -y install iscsi-initiator-utils


[root@lk1 iscsi]# chkconfig --level 345 iscsi on
[root@lk1 iscsi]# service iscsi status
iscsid は停止しています
[root@lk1 iscsi]# service iscsi start
iscsid は停止しています
Starting iSCSI daemon:                                     [  OK  ]
                                                           [  OK  ]
iSCSI ターゲットを設定中: iscsiadm: No records found!
                                                           [  OK  ]
[root@lk1 iscsi]# iscsiadm -m discovery -t sendtargets -p 192.168.0.100
192.168.0.100:3260,1 iqn.2011-02.net.tk:storage.disk

[root@lk1 iscsi]# service iscsi restart
Stopping iSCSI daemon:
iscsid が停止していますが PID ファイルが残っています       [  OK  ]
Starting iSCSI daemon:                                     [  OK  ]
                                                           [  OK  ]
iSCSI ターゲットを設定中: Logging in to [iface: default, target: iqn.2011-02.net.tk:storage.disk, portal: 192.168.0.100,3260]
Login to [iface: default, target: iqn.2011-02.net.tk:storage.disk, portal: 192.168.0.100,3260]: successful
                                                           [  OK  ]
[root@lk1 iscsi]# more /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IET      Model: VIRTUAL-DISK     Rev: 0
  Type:   Direct-Access                    ANSI SCSI revision: 04
[root@lk1 iscsi]#

 

Vine Linux 4.1でiscsiイニシエータ設定(駄目)

v4.1ではソフトウェアイニシエータパッケージが見つからなかったのでv5.2から持ってきた。
# rpm -ivh open-iscsi-2.0.870.3-1vl5.i386.rpm
これはだめ。
open-iscsiをソース(http://www.open-iscsi.org/)から落として入れなおし。
カーネルモジュールビルドのとこで失敗。ちょっちkernelアップグレードしてみる。
といっても、v4.2レベル。
でもだめー

Vine Linux 5.1 でiSCSIターゲット設定

/etc/ietd.conf  設定

Target iqn.2011-02.net.tk:storage.disk
        Lun 0 Path=/dev/sda4,Type=blockio
        Alias tkiscsi
とだけ設定ひとまず。
iscsi-targetサービス起動
[root@ryu etc]# /etc/init.d/iscsi-target start
Starting iSCSI target service:                                  [  OK  ]
[root@ryu etc]#
[root@ryu etc]# lsmod|grep iscsi
iscsi_trgt             64352  4
[root@ryu ~]# chkconfig --level 345 iscsi-target on

procで状態確認

[root@ryu ~]# more /proc/net/iet/volume
tid:1 name:iqn.2011-02.net.tk:storage.disk
        lun:0 state:0 iotype:blockio iomode:wt path:/dev/sda4
[root@ryu ~]#
イニシエータが接続されると以下のようにわかる。
tid:1 name:iqn.2011-02.net.tk:storage.disk
        sid:281475899523136 initiator:iqn.1991-05.com.microsoft:acer
                cid:1 ip:192.168.0.27 state:active hd:none dd:none
[root@ryu ~]#

/var/log/messages

Feb 13 15:20:36 ryu kernel: iSCSI Enterprise Target Software - version 0.4.17
Feb 13 15:20:36 ryu kernel: iscsi_trgt: Registered io type fileio
Feb 13 15:20:36 ryu kernel: iscsi_trgt: Registered io type blockio
Feb 13 15:20:36 ryu kernel: iscsi_trgt: Registered io type nullio

Vine Linux 5.1 で iscsitarget追加

apt-getでインストール

[root@ryu data]# apt-get install iscsitarget
パッケージリストを読みこんでいます... 完了
依存情報ツリーを作成しています... 完了
以下の追加パッケージがインストールされます:
  dkms-iscsitarget
以下のパッケージが新たにインストールされます:
  dkms-iscsitarget iscsitarget
アップグレード: 0 個, 新規インストール: 2 個, 削除: 0 個, 保留: 102 個
124kB のアーカイブを取得する必要があります。
展開後に 335kB のディスク容量が追加消費されます。
続行しますか? [Y/n]y
取得:1 http://updates.vinelinux.org 5.1/i386/main dkms-iscsitarget 0.4.17.211-2vl5 [54.8kB]
取得:2 http://updates.vinelinux.org 5.1/i386/plus iscsitarget 0.4.17.211-2vl5 [69.2kB]
124kB を 0s 秒で取得しました (344kB/s)
変更を適用しています...
準備中                                ############################## [100%]
更新/インストール中
  dkms-iscsitarget-0.4.17.211-2vl5.i386  ############################## [100%]
Creating symlink /var/lib/dkms/iscsitarget/0.4.17.211-2vl5/source ->
                 /usr/src/iscsitarget-0.4.17.211-2vl5
DKMS: add Completed.
Using /var/lib/dkms/iscsitarget/0.4.17.211-2vl5/source/iscsitarget-kmp.spec
Kernel preparation unnecessary for this kernel.  Skipping...
applying patch compat-2.6.28.patch...patching file kernel/conn.c
applying patch compat-2.6.25-2.6.27.patch...patching file kernel/block-io.c
rpmbuild...
cleaning build area....
KMP SRPM location: `/var/lib/dkms/iscsitarget/0.4.17.211-2vl5/rpm/kmod-iscsitarget-source-0.4.17.211-2vl5.src.rpm'
DKMS: mkkmp Completed.
Kernel preparation unnecessary for this kernel.  Skipping...
applying patch compat-2.6.28.patch...patching file kernel/conn.c
applying patch compat-2.6.25-2.6.27.patch...patching file kernel/block-io.c
Building module:
cleaning build area....
make KERNELRELEASE=2.6.27-52vl5 -C /lib/modules/2.6.27-52vl5/build SUBDIRS=/var/lib/dkms/iscsitarget/0.4.17.211-2vl5/build/kernel modules...............
cleaning build area....
DKMS: build Completed.
iscsi_trgt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/2.6.27-52vl5/extra/iscsi/
Adding any weak-modules
depmod.......
DKMS: install Completed.
  iscsitarget-0.4.17.211-2vl5.i386       ############################## [100%]
完了

iscsi_trgtモジュールも入った

[root@ryu data]# modinfo iscsi_trgt
filename:       /lib/modules/2.6.27-52vl5/extra/iscsi/iscsi_trgt.ko
license:        GPL
srcversion:     3C79AF64A007A5007B81BDD
depends:
vermagic:       2.6.27-52vl5 SMP mod_unload modversions 686
parm:           worker_thread_pool_size:Size of the worker thread pool (0 = dedicated threads per target (default)) (ulong)
parm:           debug_enable_flags:debug bitmask, low bits (0 ... 8) used, see iscsi_dbg.h (ulong)
[root@ryu data]#