Showing posts with label Solaris. Show all posts
Showing posts with label Solaris. Show all posts

2009-07-21

How to do Create a Virtual IP in Solaris

1. create /etc/hostname.: containing the hostname of the virtual IP

/etc/hostname.ce0:1

2. add the hostname and virtual IP to /etc/hosts

reboot or Sol10 restart service by # svcadm restart svc:/network/physical



3. or by Command

ifconfig : plumb

ex :  ifconfig ce0:1 plumb

ifconfig : netmask broadcast + up

ex : ifconfig ce0:1 10.67.1.141 netmask 255.255.255.0 broadcast + up

2009-06-25

How to disable users for SSH

you can disable root and deny some user for SSH by edit /etc/ssh/sshd_config

#vi /etc/ssh/sshd_config
....
PermitRootLogin no
....
DenyUsers oracle

-----------
and restart service
for solaris10
#svcadm restart ssh

or solaris9
#/etc/init.d/sshd restart

2009-06-18

HOW to do MPXIO on your solaris 10


You can use command #stmsboot -e this command will be reboot you system but it not work in case your internal disk is fiber disk.
You can config by edit file

Before to config MPXIO you must get detial about hba card on your hosts
#cfgadm -alv
...
unavailable fc-private n /devices/pci@9,600000/SUNW,qlc@2/fp@0,0:fc
c1::500000e0155bc3d1 connected configured unknown FUJITSU MAX3147FCSUN146G
.....

c2 connected unconfigured unknown
unavailable fc-fabric n /devices/pci@8,600000/SUNW,qlc@1/fp@0,0:fc
c2::201400a0b8325c58 connected unconfigured unknown
unavailable disk n /devices/pci@8,600000/SUNW,qlc@1/fp@0,0:fc::201400a0b8325c58
...

c3 connected unconfigured unknown
unavailable fc-fabric n /devices/pci@8,600000/SUNW,qlc@2/fp@0,0:fc
c3::201500a0b8325c58 connected unconfigured unknown
unavailable disk n /devices/pci@8,600000/SUNW,qlc@2/fp@0,0:fc::201500a0b8325c58

this information is mean
c1 is a internal disk
c2 is disk from SAN
c3 is disk from SAN


next step edit file fp.conf remark in line mpxio-disable=? and config mpxio-disable on your hba card
#vi /kernel/drv/fp.conf
....
...
...
# mpxio-disable="no";
# mpxio-disable="yes";
....
....
name="fp" parent="/pci@8,600000/SUNW,qlc@1" port=0 mpxio-disable="no";
name="fp" parent="/pci@8,600000/SUNW,qlc@2" port=0 mpxio-disable="no";
..

save file and reboot

**************** ************

2009-06-17

How to do mirror on Solaris

How to do mirror OS on Solaris


Example Information:

Harddisk1 = Harddisk2
/ /dev/dsk/c1t0d0s0 size 30Gb
Swap /dev/dsk/c1t0d0s1 size 16GB #### about 2 x RAM size ####
Replica /dev/dsk/c1t0d0s7 size 30MB ### for save metadb

# prtvtoc /dev/rdsk/c1t0d0s2 fmthard -s - /dev/rdsk/c1t1d0s2
this command is copy layout Harddisk1 to Harddisk2


Step:
backup important file :
# cp /etc/system /etc/system.org
# cp /etc/vfstab /etc/vfstab.org

create metadb on replica
# metadb -a -c 3 -f c1t0d0s7 <-- the root disk
# metadb -a -c 3 -f c1t1d0s7 <-- rootmirror disk

create one way sub mirror for root disk
# metainit -f d10 1 1 c1t0d0s0 <-- the root partition

‘d10’ = sub mirror name

create raid 1 ( mirror )
# metainit d0 -m d10

‘d0’ = mirror name
‘d10’ = sub mirror name

edit /etc/vfstab and /etc/system by command.
# metaroot d0

If more file /etc/vfstab you’ll see.
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -

If more file /etc/system you’ll see.
forceload: misc/md_trans
forceload: misc/md_raid
…
forceload: misc/md_mirror
forceload: drv/pcisch
forceload: drv/qlc
…
rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)
Reboot
# init 6

After system boot up create another sub mirror
# metainit d20 1 1 c1t1d0s0

‘d20’ = sub mirror name

put new sub mirror into mirror
# metattach d0 d20

Put submirror ‘d20’ into mirror ‘d0’

Mirror for swap

Stop used swap.
# swap –l
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 85,1 16 16780208 16779760

# swap –d /dev/dsk/c1t0d0s1


create raid0 (concat) on swap for both disk
# metainit -f d11 1 1 c1t0d0s1
# metainit d21 1 1 c1t0d0s1

create raid1 (mirror) for swap
# metainit d1 –m d11
# metattach d1 d21

enable use swap
# swap –a /dev/md/dsk/d1


edit /etc/vfstab for automount next booting
/dev/md/dsk/d1 - - swap - no -

2009-06-16

how to config SC on SUN

or SunFire xxx can set sc by OS
#scadm show
#scadm usershow
#scadm userpassword admin
#scadm set if_connection ssh
#scadm set if_network true
#scadm set netsc_ipaddr 10.7.0.31
#scadm set netsc_ipgateway 10.7.0.1
#scadm show
#scadm resetrsc

=========for Sun Txxx (Ex. T2000,T5220)
cannot set by OS must connect serial port
sc> showsc
sc> setsc if_network true
sc> setsc if_connection ssh
sc> setsc netsc_ipaddr 10.7.0.175
sc> setsc netsc_ipgateway 10.7.0.1
sc> userpassword admin
sc> resetsc
can resetsc without reboot

how to show WWN on Solaris

########### on Solaris 10 ############
# fcinfo hba-port


################# or Solaris 9###################
#prtconf -vp grep -i wwn
# /usr/sbin/prtpicl -v -c scsi-fcp grep wwn

2009-06-15

How to NTP Client

=========== Configure ================
# vi /etc/inet/ntp.conf
server (IP of NTP Server) prefer
driftfile /var/ntp/ntp.drift

============ Start NTP Daemon =========
# /usr/lib/inet/xntpd
or
# svcadm -v enable svc:/network/ntp #######
========== Test ==============
# ntpq
ntpq> peers
remote refid st t when poll reach delay offset disp
===================================================
* (IP of NTP Server) 10.216.13.50 2 u 786 1024 377 5.97 1.607 3.45

how to IPMP one IP

for Solaris 10 u3 (11/06) or later
#cat  /etc/netmasks
192.168.109.0 255.255.255.0
#cat /etc/hosts
192.168.109.101 testsol10
#cat /etc/hostname.bge0
testsol10 netmask + broadcast + group ipmp0 up
#cat /etc/hostname.bge2
group ipmp0 up
..........