Damn !! my vim color is ugly, but there is a solution:
export TERM=xtermc, it also exists on Mac and Linux so you can change your term to announce this terminal.
Don’t forget the :syntax enable in your .vimrc
God bless coloring !
Archives for solaris category
Damn !! my vim color is ugly, but there is a solution:
export TERM=xtermc, it also exists on Mac and Linux so you can change your term to announce this terminal.
Don’t forget the :syntax enable in your .vimrc
God bless coloring !
Cool Stack Installation on Solaris 10
You must be ‘root’ to install the packages. Download the packages you are interested in into any directory. For each of the downloaded packages, run the following bunzip2 and pkgadd commands:
bunzip2 [package.pkg.bz2]
For example: bunzip2 CSKmysql_1.3RC1_sparc.pkg.bz2
pkgadd -d [package.pkg]
For example: pkgadd -d CSKmysql_1.3RC1_sparc.pkg
This process will install the package in /opt/coolstack, along with all dependent libraries.
After installation, please refer to the README file included in each of the application’s directories. The README includes detailed information on the following:
how the application was built
Solaris-specific configuration and tuning notes.
Pointers to other relevant documentation.
Instructions for setting up SMF service (if applicable).
7 Apr
Hello,
If your network card is supported in Solaris, you can reset the configuration of solaris logging as a root and typing sys-unconfig. System will reboot and ask you some questions, the first will be: networked? if you answer yes, the card will be on.
With this command you have to specify net card, video driver, etc..
http://cooltools.sunsource.net/coolstack/
1) bash-3.00#pkgadd -d CSKruntime
2) bash-3.00#pkgadd -d CSKamp_1.2_x86.pkg
#### Solaris Zones #####
Features:
1. Virtualization
2. Solaris Zones can host only instances of Solaris. Not other OSs.
3. Limit of 8192 zones per Solaris hosts.
4. Primary zone (global) has access to All zones
5. Non-global zones, do NOT have access to other non-global zones.
6. Default non-global zones derive packages from global zones.
7. Program isolation – zone 1 ( Apache ), zone 2 ( MySQL ), zone 3 ( DNS )
8. Provides ‘z’ commands to manage zones: zlogin, zonename, zoneadm, zonecfg
bash-3.00# which zonename
/usr/bin/zonename
bash-3.00# zonename
global
#### Features of GLOBAL zone #####
1. Solaris ALWAYS boots (cold/warm) to the global zone
2. Knows about ALL hardware devices attached to the system
3. Knows about ALL non-global zones
#### Features of NON-GLOBAL zones #####
1. Installed at a location on the filesystem of the Global Zone ‘zone root path’ /export/home/zones/{zone1, zone2,zone3…}
2. Share packages with GLOBAL zone
3. Manage distinct hostname and tables files
4. Cannot communicate with other non-global zones by default. NIC must be used, which means, use standard network API ( TCP )
5. GLOBAL zone admin. can delegate non-global zone administration
#####Zone Configuration##############
Use: zonecfg – to configure zones
Note: zonecfg can be run: interactive, non-interactively, command-file modes.
Requirements for non.global zones:
1. hostname
2. zone root path. i.e. /export/home/zones/testzone1
3. IP address – bound to logical or physical interface
( 100 MB minimum configuration )
Zone types:
1. Sparse Root Zones – share key files with global zone
2. Whole Root Zones ( Totally independed, require more storage)
Steps for configuring non-global zone:
1. mkdir
bash-3.00# mkdir /export/home/zones
bash-3.00# mkdir /export/home/zones/testzone1 && chmod 700 /export/home/zones/testzone1
2. zonecfg -z testzone1
3. create
4. set zonepath=/export/home/zones/testzone1 – sets roots zone
5. add net
6. set address=192.168.1.60
7. set physical=pcn0
8. end
9. (optional) set autoboot=true – testzone1 will be started when the system boots
10. (optional ) add attr ; set name=comment; set type=string; set value=”TestZone1”
11. verify – verifies zone for erros.
12. commit – commit changes
13. Zone installation – zoneadm -z testzone1 install
‘testzone1’ into ‘installed’ state NOT ready for production.
14. zoneadm -z testzone1 boot – boot zone
bash-3.00# zonecfg -z testzone1
testzone1: No such zone configured
Use ‘create’ to begin configuring a new zone.
zonecfg:testzone1>
zonecfg:testzone1> create
zonecfg:testzone1> set zonepath=/export/home/zones/testzone1
zonecfg:testzone1> set address=192.168.1.60
zonecfg:testzone1> add net
zonecfg:testzone1:net> set address=192.168.1.60
zonecfg:testzone1:net> set physical=pcn0
zonecfg:testzone1:net> end
zonecfg:testzone1> info
zonename: testzone1
zonepath: /export/home/zones/testzone1
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.1.60
physical: pcn0
zonecfg:testzone1> set autoboot=true
zonecfg:testzone1>
zonecfg:testzone1> add attr
zonecfg:testzone1:attr> set name=comment
zonecfg:testzone1:attr> set type=string
zonecfg:testzone1:attr> set value=”TestZone1″
zonecfg:testzone1:attr> end
zonecfg:testzone1> info
zonename: testzone1
zonepath: /export/home/zones/testzone1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.1.60
physical: pcn0
attr:
name: comment
type: string
value: TestZone1
zonecfg:testzone1> end
The end command only makes sense in the resource scope.
zonecfg:testzone1> verify
zonecfg:testzone1>
bash-3.00# zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
bash-3.00# zonecfg -z testzone1 info
zonename: testzone1
zonepath: /export/home/zones/testzone1
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.1.60
physical: pcn0
attr:
name: comment
type: string
value: TestZone1
bash-3.00# zoneadm -z testzone1 install
Preparing to install zone <testzone1>.
Creating list of files to copy from the global zone.
Copying <7644> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1045> packages on the zone.
Initialized <1045> packages on zone.
Zone <testzone1> is initialized.
The file </export/home/zones/testzone1/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.00# zoneadm list -iv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- testzone1 installed /export/home/zones/testzone1 native shared
bash-3.00# zoneadm -z testzone1 boot
zoneadm: zone ‘testzone1′: WARNING: pcn0:1: no matching subnet found in netmasks(4) for 192.168.1.60; using default of 255.255.255.0.
bash-3.00# echo $?
0
bash-3.00# zfs create poolraidz1/home
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
poolraidz1 121K 9.78G 24.5K /poolraidz1
poolraidz1/home 24.5K 9.78G 24.5K /poolraidz1/home
Quota:
bash-3.00# zfs set quota=4G poolraidz1/home
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
poolraidz1 122K 9.78G 25.5K /poolraidz1
poolraidz1/home 24.5K 4.00G 24.5K /poolraidz1/home
############ ZFS Snapshots #################
Features:
1. Read-only copies of volumes or file systems
2. Use no additional space, initially
####Return available snapshot
bash-3.00# zfs list -t snapshot
no datasets available
###Create spanpshot##########
bash-3.00# zfs snapshot poolraidz1/home@homespan1
bash-3.00# echo $?
0
bash-3.00# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
poolraidz1/home@homespan1 0 - 24.5K -
hidden directory spanshots
/poolraidz1/home/.zfs/snapshot/homespan1
test snapshots
bash-3.00# cd /poolraidz1/home/
bash-3.00# echo “testint spanshot 3″ > test.txt
bash-3.00# zfs snapshot poolraidz1/home@homespan3
#### Destroy Snapshots ###############
bash-3.00# zfs destroy poolraidz1/home@homesnap1
#### Rename Snapshots ###############
bash-3.00# zfs rename poolraidz1/home@homespan2 poolraidz1/home@homespandos
bash-3.00# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
poolraidz1/home@homespandos 22.5K - 24.5K -
poolraidz1/home@homespan3 23K - 25K -
#### Roll backs #########################
bash-3.00#zfs rollback -f poolraidz1/home@homesnap3
bash-3.00#echo $?
#### CLONES ###################
( First create a snapshot and then a clone)
Features:
1. Writable file systems or volumes
2. Linked to a snapshot
3. Clone can be stored anywhere in ZFS hierarchy
bash-3.00# zfs clone poolraidz1/home@homesnap3 poolraidz1/homeclone1
bash-3.00# echo $?
0
the clone inherited attributes of the target file system
snapshots do not inherited attributes
1. Mirroring – RAID – 1
2. RAID - 5 – RAID -Z
bash-3.00# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 1303 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c1d1 <DEFAULT cyl 1303 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
Virtual Devices:
1. c0d1 – 10.0G
2. c1d1 – 10.0G
Note: Redundacy/Replication is associated directly with the pool
Tip: For PRODUCTION enviroments ideally you should implement your mirror, raid z, straight volumnes dedicating THE ENTIRE DISK to zfs (the disks should be the same )
******************** MIRROR **********************
bash-3.00# zpool create poolmirror1 mirror c0d1 c1d1
bash-3.00# echo $?
0
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
poolmirror1 86K 9.78G 24.5K /poolmirror1
bash-3.00# ls -ltr /poolmirror1/
total 0
### CREATE Dir HOME ######
bash-3.00# zfs create poolmirror1/home
ash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
poolmirror1 114K 9.78G 25.5K /poolmirror1
poolmirror1/home 24.5K 9.78G 24.5K /poolmirror1/home
******************** raid-z **********************
# Create the pool bash-3.00#/usr/sbin/zpool create -f poolraidz1 raidz c0d1 c1d1
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
poolraidz1 86K 9.78G 24.5K /poolraidz1
bash-3.00# ls -ltr /usr/sbin/smcwebserver
lrwxrwxrwx 1 root root 43 Mar 17 12:11 /usr/sbin/smcwebserver -> ../../usr/share/webconsole/bin/smcwebserver
bash-3.00# netstat -anP tcp | grep 6789
*.6789 *.* 0 0 49152 0 LISTEN
111.222.233.44.6789 111.222.104.222.3338 65498 0 49368 0 FIN_WAIT_2
111.222.233.44.6789 111.222.104.222.3339 65498 0 49368 0 FIN_WAIT_2
Mozilla
https://localhost:6789/zfs
Features:
1. 256 quadrillion zettabytes ( Terabytes, Petabytes, Exabytes, Zettabytes (1024 Exabytes))
2. RAID-0/1 & RAID-Z ( RAID-5 with enhancements ) ( 2 – required virtual devices )
3. Snapshots - read-only copies of file systems or volumes
4. Create volumes
5. Uses storage pools to manage storage – aggregates virtual devices
6. File systems attached to pools grow dinamically as storage is added
7. File systems may span multiple physical disk
8. ZFS is transactional (Similar to databases. Example: Writing 100 mb, but only 80mb is commited in a traditional file system, leaving 20 mb unwriting, and the data is corrupted, and in ZFS all is written or NONE.
9. Pools & file systems are auto-mounted. No need to maintain /etc/vfstab
10. Supports file system hierarchies: /pool1/{home(5GB),var(10GB), etc.}
11. Supports reservation of storage: /pool1(36GB)/{home(10GB),var(36–10GB)}
12. Provides a secure web-based management tool
*********** ZFS – CLI **************
# which zpool
/usr/sbin/zpool
zpool list – list known pools
zpool create pool_name(alphanumeric, _,-,:,.)
Pool Name Constraints
1. mirror
2. raidz
—— Pause: note to vmware —————————————————————-
Add a second disk to the image in vmware
In order to add second hard disk with Fusion.
format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>
/pci@0,0/pci1000,30@10/sd@0,0
1. c1t1d0 <DEFAULT cyl 2557 alt 2 hd 128 sec 32>
/pci@0,0/pci1000,30@10/sd@1,0
———————————————————————————————————-
Continue….
zpool create pool_name device_name1, device_name2, device_name3, etc.
bash-3.00# devfsadm
bash-3.00# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <DEFAULT cyl 1303 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
Specify disk (enter its number): ^Z
[1]+ Stopped format
bash-3.00# zpool create pool1 c0d1
bash-3.00# echo $?
0
mount
/pool1 on pool1 read/write/setuid/devices/exec/xattr/atime/dev=2d50002 on Tue Mar 18 09:24:51 2008–
bash-3.00# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
pool1 9.94G 88K 9.94G 0% ONLINE -
ZFS Pool Statuses
1. ONLINE
2. DEGRADED (part of the mirror is broken or entire disk is fail, but still available)
3. FAULTED
4. OFFLINE
5. UNAVAILABLE
(Pools or datasets)
—————————-
zfs list – returns ZFS dataset info
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool1 85.5K 9.78G 25K /pool1
zfs mount – returns pools and mount points
bash-3.00# zfs mount
pool1 /pool1
zpool status – returns virtual devices that constitute pools
bash-3.00#zpool status
pool: pool1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
pool1 ONLINE 0 0 0
c0d1 ONLINE 0 0 0
errors: No known data errors
bash-3.00#zpool status -v pool1
Note: ZFS requieres a minimum of 128MB virtual device to create a pool
(Recommendation render all the disks over zfs minus / )
var home should be separate disks for performance
——————-DESTROY ————————————————
zpool destroy pool1 – Destroys pool and associated file system
bash-3.00# zpool destroy pool1
bash-3.00# echo $?
0
—————-CREATE File systems within pool1 ———————
zfs create pool1/home - creates file system named ‘home’ in pool1
bash-3.00# zfs create pool1/home
bash-3.00# echo $?
0
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool1 114K 9.78G 25.5K /pool1
pool1/home 24.5K 9.78G 24.5K /pool1/home
Note: Default action of ‘zfs create pool1/home’ assigns all storage available to ‘pool1’, to ‘pool1/home’
##### Set quota on existing file system ######
zfs set quota=5G pool1/home
bash-3.00# zfs set quota=5G pool1/home
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool1 114K 9.78G 25.5K /pool1
pool1/home 24.5K 5.00G 24.5K /pool1/home
##### Create user-based file system beneath pool1/home #####
zfs create pool1/home/zivo
bash-3.00# zfs get -r quota pool1
NAME PROPERTY VALUE SOURCE
pool1 quota none default
pool1/home quota 5G local
pool1/home/pedrito quota none default
pool1/home/zivo quota none default
zfs get -r compression pool1
NAME PROPERTY VALUE SOURCE
pool1 compression off default
pool1/home compression off default
pool1/home/pedrito compression off default
pool1/home/zivo compression off default
############ Rename file systems ######################
bash-3.00# zfs rename pool1/home/zivo pool1/home/zivob
bash-3.00# echo $?
0
############ Extending dynamically, pool storage ######################
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c0d1 <VMware V-0000000000000000-0001-10.00GB>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
2. c1d1 <DEFAULT cyl 4093 alt 2 hd 128 sec 32>
/pci@0,0/pci-ide@7,1/ide@1/cmdk@1,0
bash-3.00# zpool add pool1 c1d1
bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool1 210K 17.6G 25.5K /pool1
pool1/home 76.5K 5.00G 27.5K /pool1/home
pool1/home/pedrito 24.5K 5.00G 24.5K /pool1/home/pedrito
pool1/home/zivokickass 24.5K 5.00G 24.5K /pool1/home/zivokickass
bash-3.00# zpool status
pool: pool1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
pool1 ONLINE 0 0 0
c0d1 ONLINE 0 0 0
c1d1 ONLINE 0 0 0
errors: No known data errors
cat /var/svc/log/network-ssh\:default.log
Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_keycd /etc/sshssh-keygen -d -f ssh_host_dsa_key -N “”ssh-keygen -b 1024 -f ssh_host_rsa_key -t rsa -N “”
ZiVo Nix Blog