研究室のSolarisサーバ設定覚書part 1

研究室のSun X4100 ServerSolaris 10 11/06をクリーンインストールした手順の記録です。
なお、X4100はDVD-ROMドライブつきのモデルです。
JavaRConsoleを用いたリモートでのグラフィカルログインとILOMのシリアルコンソールに両方アクセスできるようにします。
Xをインストール時に設定させてしまいたいために、グラフィカルにインストールします。

DVDから起動する前

  1. Oracle and Sun Microsystems | Strategic Acquisitions | Oracleからメディアをダウンロード
  2. 適当にDVDを焼いて、とりあえず電源を入れてマシンに挿入
  3. Web ILOMからjavaRConsoleを開く
  4. ILOMから再起動
  5. F2(ssh ILOMからならCtrl+E)を押してBIOS setupに入る
  6. Boot -> Boot Device Priorityで次の順番にする*1
    1. [Hard Drive]
    2. [ATAPI CDROM]
    3. [Removal Dev.]
  7. 保存して再起動後F8(ssh ILOMからならCtrl+P)を押してBBS Popup Menuに入る
  8. 「ATAPI CDROM」を選択して起動

OSのインストール

  1. この起動手順の際はとりあえず自動選択に任せればよい
  2. 言語は「4. Japanese」を選択
  3. ネットワーク「利用する」
  4. 構成「e1000g0」
  5. DHCP「いいえ」
  6. マシンごとのIP設定
  7. IPv6「設定する」
  8. Kerberos「いいえ」
  9. ネームサービス「DNS
  10. タイムゾーン、rootパスワードは適当に
  11. リモートサービスの有効化「いいえ」
  12. 自動リブート「はい」
  13. DVD取り出し「いいえ」
  14. 媒体「DVD」
  15. インストール形式「カスタム」(ディスク構成の変更のため)
  16. ロケール「en_US, en_US.UTF-8, ja, ja_JP.PCK, ja_JP.UTF-8
  17. システムロケール「ja_JP.UTF-8
  18. インストールソフトウェア「全体ディストリビューション+OEM
  19. ディスクc0t2d0のパーティション

スライス 容量 シリンダ マウントポイント
0 20G 2550 /
1 500M 66 swap
2 20G 2550 unused(for Solaris live upgrade)
3 0
4 0
5 0
6 0
7 28G 3705 unused(for ZFS home)

スライス 容量 シリンダ マウントポイント
0 7G 900 /
1
2 7G 900 unused(for Solaris live upgrade)
3 0
4 0
5 0
6 0
7 55G 7071 unused(for ZFS home)

(この変更は、後にswapをZFSで設定するため)

リブート後の初期設定

  1. NFS「no」
  2. consoleでログイン*2
  3. 「eeprom console=ttya」とする
  4. 再起動
  5. rootのhome directoryをrootにする*3
# mkdir /root
# chmod 700 /root
# chown root:root /root
# ex /etc/passwd <<EOF
/^root/s/:\/:/:\/root:/
w
EOF
  1. /etc/ssh/sshd_configを編集して、rootでのsshアクセスを許可
# ex /etc/ssh/sshd_config <<EOF
g/^PermitRootLogin no/s//PermitRootLogin yes/g
w
EOF
# svcadm restart ssh
  1. (2台目以降)この段階でautomountはできるようになっているので、profileの設定
# echo ". /net/firstnode/export/site-init-files/SunOS.profile" >> /etc/profile
  1. コンソールはそのままで、外部からsshでアクセス*4

Solaris Registration

# /usr/bin/updatemanager
  1. Registration「continue」
  2. Sun Online Account
  3. Activation「Use Sun Update Manager and Sun Update Connections」
  4. Service Plan Number
  5. Auto registration「no」
  6. Contact

OSのアップグレード

基本的に

# init S
# smpatch update -i ######-##

を行うだけですが、118855-36のパッチが鬼門です。何はともあれ、最初にこれだけ入れて再起動することが必須。

# smpatch update -i 118855-36
# cd /var/sadm/spool
# patchadd -n -i 118855-36

blastwaveのインストール

Solarisにはtopも存在しないので、インストールします。
http://www.blastwave.org/howto.htmlの手順に従います。

  1. top
  2. emacs_gtk
  3. subversion

最後に以下を実行して、インストールの際の質問をなくします。

# cp -p /var/pkg-get/admin-fullauto /var/pkg-get/admin

Java Web Consoleの自動起動の設定

マシン起動時に自動的に起動するようにします。
ネットワークサービスを制限中(netservices limited)ですが、外部からWeb Consoleにアクセスするために次の設定をします。

# smcwebserver enable
# svcadm enable system/webconsole:console
# svccfg -s system/webconsole:console setprop options/tcp_listen = true

Oracle and Sun Microsystems | Strategic Acquisitions | Oracleの導入

Oracle and Sun Microsystems | Strategic Acquisitions | OracleからDSEE 6.1 packageをダウンロードしインストールします。
設定はほぼデフォルトのままで、インスタンスも作成します。
DSEE 6.1にするために、

# smpatch update -i 125278-02
# smpatch update -i 125938-02

を行います。

次にDSEEをSMFで管理するようにします。

# /opt/SUNWdsee/ds6/bin/dsadm enable-service -T SMF /var/opt/SUNWdsee/dsins1
# cacaoadm enable
# svcadm enable application/sun/ds:ds--var-opt-SUNWdsee-dsins1

LDAPネームサービスの設定

この節はdeprecatedです。idsconfigは使わずに後で設定します。
idsconfigスクリプトを用いるのですが、DSEE6.1で動かすにはちょっとした変更が必要です。

# chmod u+w /usr/lib/ldap/idsconfig
# vi /usr/lib/ldap/idsconfig

として、IDS_MAJVERを検索して、6.1でも動くようにします。

#!/bin/sh
# 中略
chk_ids_version()
{
    [ $DEBUG -eq 1 ] && ${ECHO} "In chk_ids_version()"

    # check iDS version number.
    eval "${LDAPSEARCH} ${SERVER_ARGS} -b cn=monitor -s base \"objectclass=*\" version | ${GREP} \"^version=\" | cut -f2 -d'/' | cut -f1 -d' ' > ${TMPDIR}/checkDSver 2>&1"
    if [ $? -ne 0 ]; then
        ${ECHO} "ERROR: Can not determine the version number of iDS!"
        exit 1
    fi
    IDS_VER=`cat ${TMPDIR}/checkDSver`
    IDS_MAJVER=`${ECHO} ${IDS_VER} | cut -f1 -d.`
    IDS_MINVER=`${ECHO} ${IDS_VER} | cut -f2 -d.`
    if [ "${IDS_MAJVER}" != "5" ]; then
        ${ECHO} "ERROR: $PROG only works with iDS version 5.x, not ${IDS_VER}."
        #exit 1 <-- ここをコメントアウト
    fi
    if [ $DEBUG -eq 1 ]; then
        ${ECHO} "  IDS_MAJVER = $IDS_MAJVER"
        ${ECHO} "  IDS_MINVER = $IDS_MINVER"
    fi
}
# 後略

あとは/usr/lib/ldap/idsconfigを実行してサーバを設定します。詳しくは、Directory Server 6.0 and idsconfigを参照してください。
設定内容は、Directory Servicesを参照しました。

Do you wish to continue with server setup (y/n/h)? [n] y
Enter the iPlanet Directory Server's (iDS) hostname to setup: example
Enter the port number for iDS (h=help): [389]
Enter the directory manager DN: [cn=Directory Manager]
Enter passwd for cn=Directory Manager :
Enter the domainname to be served (h=help): [example.com] example.com
Enter LDAP Base DN (h=help): [dc=examplle,dc=com]
Enter the profile name (h=help): [default] 
Default server list (h=help): [192.168.0.1]
Preferred server list (h=help):
Choose desired search scope (one, sub, h=help): [one] sub
Choose Credential level [h=help]: [1] 2
Choose Authentication Method (h=help): [1] 4
Do you want to add another Authentication Method? n
Do you want the clients to follow referrals (y/n/h)? [n] y
Do you want to modify the server timelimit value (y/n/h)? [n] y
Enter the time limit for iDS (current=3600): [-1]
Do you want to modify the server sizelimit value (y/n/h)? [n]
Enter the size limit for iDS (current=2000): [-1]
Do you want to store passwords in "crypt" format (y/n/h)? [n] y
Do you want to setup a Service Authentication Methods (y/n/h)? [n]
Client search time limit in seconds (h=help): [30] 
Profile Time To Live in seconds (h=help): [43200]
Bind time limit in seconds (h=help): [10]
Do you wish to setup Service Search Descriptors (y/n/h)? [n]
Enter config value to change: (1-19 0=commit changes) [0]
Enter DN for proxy agent: [cn=proxyagent,ou=profile,dc=example,dc=com]
Enter passwd for proxyagent:
Re-enter passwd:
WARNING: About to start committing changes. (y=continue, n=EXIT) y


d:id:rigarash:20070809に続きます。2台目以降のクライアントの設定のみであれば、d:id:rigarash:20070816に続きます。

*1:これは再起動後にHDDから起動させるため。CDから起動したい場合はBIOSから明示的に指定すればよいとの考え

*2:gdmのプルダウンメニューで設定

*3:http://www.blastwave.org/howto.htmlのStep 4を参照

*4:Solaris Update ManagerはGUIしかないから