« 2011年3月 | メイン | 2014年3月 »

2012年2月27日

Solaris11 のホスト名変更方法

Solaris11 ではホスト名が SMF で管理されている。
変更するにはsvccfg コマンドを使用。

# svccfg -s svc:/system/identity:node setprop config/nodename=HOSTNAME
# svcadm refresh svc:/system/identity:node ^^^^^^^^ ホスト名
# svcadm restart svc:/system/identity:node


▽ 設定例

< 変更前 >

root@sun1:/# svccfg -s svc:/system/identity:node listprop config
config application
config/nodename astring sun1
config/loopback astring sun1

root@sun1:/# hostname
sun1

root@sun1:/# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 sun1 localhost
127.0.0.1 sun1 localhost loghost

< 変更 >

root@sun1:/# svccfg -s svc:/system/identity:node setprop config/nodename=test1
root@sun1:/# svcadm refresh svc:/system/identity:node
root@sun1:/# svcadm restart svc:/system/identity:node

< 変更後 >

root@sun1:/# svccfg -s svc:/system/identity:node listprop config
config application
config/nodename astring test1
config/loopback astring test1

root@sun1:/# hostname
test1

root@sun1:/# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 test1 localhost
127.0.0.1 test1 localhost loghost

※ /etc/hosts をループバック ( 127.0.0.1 ) 以外の IP アドレスに自身の
ホスト名を記載していても書き換えの対象とならない。
手動での編集が必要。

投稿者 AJ : 10:08トラックバック (0)

 
Powered by Movable Type 4.27-ja | RSS1.0 | RSS2.0 | ATOM