Thursday, 4 July 2013

Creating and Installing zones

Creating and installing zones

Please note that going forward we can use the “clone” command to replicate zones once we have made one non-global zone.

bash-3.00# zonecfg -z zone1
ts04_zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:ts04_zone1> create -b
zonecfg:ts04_zone1> info
zonename: zone1
zonepath: 
brand: native
autoboot: false
bootargs: 
pool: 
limitpriv: 
scheduling-class: 
ip-type: shared
zonecfg:ts04_zone1> set zonepath=/zones/zone1
zonecfg:ts04_zone1> set autoboot=true
zonecfg:ts04_zone1> set zonename=slurm1
zonecfg:ts04_zone1> add net
zonecfg:ts04_zone1:net> set address=xx.xx.xx.xx
zonecfg:ts04_zone1:net> set physical=hme0
zonecfg:ts04_zone1:net> end
zonecfg:ts04_zone1> add capped-memory
zonecfg:ts04_zone1:capped-memory> set physical=1792m
zonecfg:ts04_zone1:capped-memory> set swap=2048m
zonecfg:ts04_zone1:capped-memory> end
zonecfg:ts04_zone1> verify
zonecfg:ts04_zone1> export
create -b
set zonepath=/zones/zone1
set autoboot=true
set ip-type=shared
add net
set address=xx.xx.xx.xx
set physical=hme0
end
add capped-memory
set physical=1.8G
end
zonecfg:ts04_zone1> commit
zonecfg:ts04_zone1> export -f /zones/config_zones/slurm.cfg
zonecfg:ts04_zone1> exit
bash-3.00#
bash-3.00# chmod 700 /zones/zone1
bash-3.00# zoneadm -z zone1 verify
bash-3.00# zoneadm -z zone1 install


Next Step:

Then create the sysidcfg file: 


hostA-global# cat > /zones/zone1/root/etc/sysidcfg 

name_service=NONE

network_interface=primary {
        netmask=xx.xx.xx.xx
        default_route=xx.xx.xx.xx
        protocol_ipv6=no
}

security_policy=NONE

root_password=xxxxxxxxxxx

system_locale=en_IE

timezone=Eire

timeserver=xx.xx.xx.xx

terminal=vt100



Next step:

touch /zones/zone1/root/etc/.NFS4inst_state.domain

Once the zones are installed run the following commands:


zoneadm -z zone1 boot

Do the above for all new zones

Login to console of global zone and do the following:
zlogin -C zone1 

Then install the OS

Wednesday, 3 July 2013

Core file administration Linux and Solaris

Setting up the core file processes on solaris

Perform the following commands at command line:

To view current config:

coreadm 

To configure:

coreadm-e global -e process -e global-setid -e proc-setid -e log
coreadm-g /disk0/core/core.%f.%p.%t -i /disk0/core/core.%f.%p.%t

Setting up cores on linux

Step 1
Edit the file
vi /etc/sysctl.conf

and add the following line to it:

kernel.suid_dumpable= 1

Re-load the file /etc/sysctl.conf by executing the following command:

/sbin/sysctl-p /etc/sysctl.conf

Step 2
/usr/sbin/getenforce
/usr/sbin/setenforcePermissive

Step 3
As user root
ulimit-c unlimited

Run 

ulimit -a 

and ensure the following is true:

ulimit -a corefile size (blocks, -c) unlimited

dataseg size (kbytes, -d) unlimited
filesize (blocks, -f) unlimited
pendingsignals (-i) 1024
maxlocked memory (kbytes, -l) 32
maxmemory size (kbytes, -m)unlimited
openfiles (-n) 1024
pipesize (512 bytes, -p) 8
POSIXmessage queues (bytes, -q) 819200
stacksize (kbytes, -s) 10240
cputime (seconds, -t) unlimited
maxuser processes (-u) 32764
virtualmemory (kbytes, -v) unlimited
file locks (-x) unlimited

Sendmail listen on all interfaces

Listen on all interfaces

vi /etc/mail/sendmail.mc

Put a dnl in front of this section:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Comment out

dnl # define(`SMART_HOST', `smtp.your.provider')dnl

Rebuild

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Restart

/etc/init.d/sendmail stop/ start

Monday, 11 February 2013

Solaris Networking

I tend to do a lot of work with Solaris machines so first post will be a Solaris one.

So some useful files to know for networking:

Solaris 10

Add an /etc/resolv.conf file as its not there by default

Change the hosts lookup to have dns in /etc/nsswitch.conf

Edit the following files and update as required:

/etc/hosts

/etc/hostname

/etc/nodename

/etc/netmasks

ifconfig –a

/etc/defaultrouter

/etc/inet/ipnodes

To bring the interface up

ifconfig hme0:1 plumb
ifconfig hme0:1 10.X.X.X netmask X.X.X.X up

To make permanent

Add IP to /etc/hosts and more importantly

echo 10.X.X.X  > /etc/hostname.hme0:1

To bring it down

ifconfig hme0 unplumb