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

Friday, March 10, 2017

How to configure NTP server and client on Solaris 10 and Solaris 11

In this post, I will describe the step by step method that how we will configure the NTP server and client on Solaris 10 and Solaris 11 Operating system. Network time protocol is most important part of any UNIX operating system. We will setup the NTP daemon on both the operating system but before moving to main point we will understand first NTP mechanism.

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

NTP Service on Solaris 10 and Solaris 11:

Solaris 10 used the SMF utility (Service Management Facility) and the NTP service is now managed by SMF (Service Management Facility). NTP daemon configured using Service management facility (svc:/network/ntp:default) and a bunch of sample ntp.conf files to quickly configure a machine as a client or as a server. On Solaris 11 only ships with NTP v. 4, the NTP v. 4 service is identified by the name ntp4. You can check the ntp status using below command.

sun# svcs status ntp

STATE  STIME   FMRI
online 10:14:23 svc:/network/ntp:default

If you see the above command output it is shown that network time protocol services is enable and online on the server.

Steps for Configuring a NTP client:

Suppose your machine is just a client machine, then you can just take the /etc/inet/ntp.client file and copy it to /etc/inet/ntp.conf.

multicastclient 127.0.0.1

If you see the configuration it's a passive configuration for a Server host which listens for NTP server putting packets on the NTP multicast network, 127.0.0.1. If your machine is on LAN without NTP server then in that case we are not recveied any packet and for this we need to use Public NTP server for host.

In my case, I'm using the Indian pool in.pool.ntp.org and my configuration file contains:

server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Normally NTP requires a poll period to elapse before starting synchronizing your clock. If you want NTP to start immediately, which you most probably will if you're configuring a desktop environment, you can take advantage of iburst keyword, introduced in NTP v. 4: it instructs NTP to start the synchronization almost right away.

server 2.in.pool.ntp.org ibrust
server 1.asia.pool.ntp.org ibrust
server 3.asia.pool.ntp.org ibrust

You must make sure you're configuring NTP implementation corresponding to the syntax you're using.

Setting up the drift file:

The last thing which is remaining for NTP server setup in the client machine is to set up  drift file location. On my machine it is 

driftfile /var/ntp/ntp.drift

After setup the drift file configuration we will start the NTP servivce again 

sun# svcadm restart svc:/network/ntp:default
sun# svcs status svc:/network/ntp:default
STATE  STIME   FMRI
online 12:20:12 svc:/network/ntp:default 

Once the service is running, you can check which server you're using with ntpq, Please run the below command to check the ntpq.

sun# ntpq -p

Setting up an NTP server:

Now in above step you see the NTP service has been started successfully, so now, you'll probably want to setup all of your machines.

If you're in a LAN, you can setup an internal NTP server which will provide data to other clients on your LAN. As before, you can take inspiration from the server configuration file shipped with Solaris 10 or Solaris 11, /etc/inet/ntp.server.

After setting up the drift file and the clients you're going to use, you can examine the other options and fine-tune them at your taste. Let's give a quick look at it.

server 127.127.XType.0

Now you have configured the NTP server properly. Please comment on the post if you have any suggestion.

Thursday, March 9, 2017

How to enable SAR (System Activity Reporter) on Solaris Server

In this post, You can find the information one of the most important monitoring tool application on Solaris operating system. SAR (System Activity Reporter) is used to troubleshoot the performance issue on Sun Solaris Servers.

Using SAR (System Activity Reporter) we can troubleshoot or monitored the disk, memory or cpu performance issues on the Solaris operating system servers.

It is widely used performance tools for monitoring purpose but this utility also have some disadvantages. SAR utility consume lot of disk space when it is generated the report as well as /var file system space get increase rapidly.

Now in the below post we will step by step method to enable the SAR on Solaris Operating system.

Step by step procedure to enable SAR (System Activity Reporter):

1. In the first step we will check the current service status of SAR. To check this thing we will used below command which is mention below.

sun#svcs status sar
disabled        Mar_9  svc:/system/sar:default
or
sun#svcs -a | grep -i sar
disabled        Mar_9  svc:/system/sar:default

If you see the current status of SAR service it is disable. You can use both the above syntax to find out the current service status.

2.  As you seen in above step, the SAR service is disable on the Sun Solaris system so in this step we will enable it.

sun#svcadm enable svc:/system/sar:default

Check the status of service again as per below command.

sun# svcs status svc:/system/sar:default
enabled        Mar_9  svc:/system/sar:default

3.  Now in this step, we will make a setup for automatic data collection. Normally once we enable the services of SAR, the default script for SAR utility are located the below directory location.

/usr/lib/sa/sa1: This is a shell script to collect and store data in the binary file /var/adm/sa/sadd, where dd is the current day.

/usr/lib/sa/sa2: This is a  shell script for generating daily report in the file /var/adm/sa/sardd, where dd is current day.

As these above script are used normally to collect the automatically data from Solaris Server. If you required the daily report or weekly report then you need to add both the script in crontab file which is describe in next step.

4.  If you required the SAR report regularly then you need to make an entry of above script on the crontab file.

#crontab -e

Using these command you can edit the existing file and make an entry of above script according to your requirement when you want to generate the report.

Please comment on the post, if you have any issue related to this SAR post.

Wednesday, March 8, 2017

How to run Oracle Explorer on Sun Solaris 11

In this post I will explain how to run Oracle Explorer file on Solaris 11 operating system. Explorer files are used as a snapshot when we need to check all hardware issues or internal issue. The explorer files keeps all these information.

Oracle SUN Solaris explorer is a collection of scripts and binary executable files which collect all information and creates a detailed snapshot of Oracle Sun Solaris system configurations.

Oracle Sun Solaris Explorer is always installed on Global zone using root user which are running only Sun Sparc system and Solaris X86 systems as well as we are gathers information related to drivers, patches, recent system event history, and log file entries from the Oracle Explorer Data Collector output.

Before moving to run the explorer files we need to understand which packages is required to installed and configure the explorer files.

1. First we need to download the Service tools bundle from any ftp servers and extract them and run the script with extension syntax.

# ./install_stb.sh -ext

2. In this step we will uncompressed and untar the Explorer tar file using below command.

# cd /var/tmp/stb/extract/Explorer
# uncompress Explorer.tar.Z
# tar xvf Explorer.tar

3. In this step we will install Explorer packages and create directories "SUNWexplo" and "SUNWexplu" to install the required packages.

# pkgadd -d . SUNWexplo SUNWexpl

4. Now we will run the explorer command to obtained the logs files from the Sun Solaris system.

  #explorer
  
Normally on Solaris server the default location to run the above command is /usr/sbin/explorer which create & send the explorer log file.

If you want the create default configuration file only first time please use the below syntax.

  # explorer -g 

If you want to check explorer version please run the below command.

  # explorer -V
        
Normally in most of the Solaris server the default path of the explorer output is /var/explorer/output but it depends where you installed the Explorer.

Friday, March 3, 2017

NFS mount on Solaris 11 Non-Global zones

In this post, we would learn how we mount one folder from one Non-Global zone to another zone on Solaris 11 operating system.

As you know, in linux server it is less difficult in comparision to Solaris server. Here, I will take a two local zone "sun01" & "sun02". Let's take an example, we will mount one folder named "/export/backup" from "sun01" local zone to another zone "sun02" on "/project/export/data" location.

Step by Step method of NFS mount on Solaris 11:

1. In the first step we will create the directory on "sun02" zone where we want to mount the folder. 

sun02#mkdir /project/export/data

2. In second step, we will make a configuration for this process. So for this work you need to login on global zone with root access and make an entry on the dfstb configuration file.

sun#vi /etc/dfs/dfstab

share -F nfs -o rw=sun02 /zones/sun01/root/export

If you see the above entry, we have provided the read/write access to directory on sun02 server where we mount the folder from sun01 local zone.

3. In next step you need to login on sun02 server and mount the shared folder using below command.

sun02#mount sun:/zones/sun01/root/export/backup /project/export/data

4. Once you run the above command the folder is mount from one local zone to another zone temprarily. You can go to the directory and verify that the data which is listed on /export/backup folder is show on sun02 directory.

5. In the last step you need to restart the NFS service on the global zone so the configuration files and other changes makes affect. But these configuration are available until we are not taking reboot of the zone.

Please comment on the post, if you have any issue regarding the NFS mount sharing process. I will try to resolve such issue as soon as possible.

Sunday, February 26, 2017

zone: error: net0: failed to create VNIC: operation not supported

In this post, I will discuss with you one of the most interesting error which I am facing when I boot the local zone on Solaris 11.3. The description of this interesting issue as describe below.

Description of error:

sun# zoneadm -z sun01 boot

zone 'sun01': error: net0: failed to create VNIC: operation not supported

zoneadm: zone sun01: call to zoneadmd(1M) failed: zoneadmd(1M

I have try to create and configure the  VNIC on Solaris 11.3 operating server but it get failed with the same error.

sun#dladm create-vnic -l net0 vnic01

dladm: vnic creation failed: operation not supported

If you are also facing a such error while booting the local zone on solaris 11 server, then please use the below solution to resolve such issues.

Solution of error:

1. This error "failed to create VNIC: operation not supported" would normally come when there are not enough mac addresses to assign to the zone. So now we need to add alternate mac addresses to the network interface.So before adding the new mac address we will stop LDM.

sun#ldm list-domain

NAME            STATE     FLAGS  CONS   VCPU MEMORY  UTIL NORM UPTIME

primary         active    -n-cv- UART   8    8G      2.0% 2.0% 41d 20h 14m

0004fb0000060000ff1d3d8336112f6f active    -n---- 5001   50   64G     0.1% 0.1% 18h 23m

2. Now log in to the Solaris global zone and check if net0 have additional MAC addresses or not. Please use the below command to check the status.

sun# dladm show-phys -m

LINK               SLOT    ADDRESS           INUSE CLIENT

net0               primary 0:21:f6:d6:d3:e5  yes  net0

                   1       0:14:4f:f9:6d:8d  no   --

                   2       0:14:4f:fb:10:2b  no   --

                   3       0:14:4f:f9:41:d6  no   --

                   4       0:14:4f:f8:dd:c8  no   --

net1               primary 0:21:f6:51:be:4d  yes  net1

3. Now zone will start without any issue, as we have assigned the new mac address to this zone.

sun# zoneadm -z sun01 start

Hope, your issue related to this has been resolved after reading my post. Please let me know if you are facing any issue regarding this error.

How to create whole root zone on Solaris 11

In this post we will see how to install  zone on Solaris 11. In my last post regarding the zone creation you see the zone creation steps about Solaris 10.

Before going to main installation part we need to understand the basic installation methods difference between Solaris 10 & Solaris 11. 

In Solaris 10, we can’t install it without configuring repo on Solaris while in Solaris 11 ,first we need to create a  Solaris 11 repo , then we can install Solaris local zone. In Solaris 11, all the local zones by default uses exclusive ip address. You can’t set the IP address while configuring the zone. After the installation of zone, you can able to configure the IP from the local zone itself.

On my Solaris 11 machine I have already installed one local zone which is used for my R&D work so for this post work I need to install second local zone. So I will clone it from the first local zone.

Step by step method to create a zone on Solaris 11:-

1. In the first step we will create a new local zone. For the zone creation we will used "zonecfg" command and configure the zones as whole root zone without any options supplied.

#zonecfg -z sun02
sun02: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:sun> create
zonecfg:sun> info
zonename: sun02
zonepath:
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
zonecfg:sun> set zonepath=/zones/sun02
zonecfg:sun > add anet
zonecfg:sun:anet> set linkname=net0
zonecfg:sun:anet> end
zonecfg:sun > verfiy
zonecfg:sun > commit
zonecfg:sun > exit

In the above step, we will create a zne and set the zonepath. In my case my new solaris zone path is "/zones/sun02" in your case you can change your installation zone path. Here, I assign the network interface "net0" for this newly zone.

2. After successfully zone creation in above step 1, we will go for start the Solaris zone installation in this step. As I explained you for solaris 11 local zone installation we required solaris 11 repo which is used for installation part.

sun#zoneadm -z sun02 install
The following ZFS file system(s) have been created:
    rpool/zones/sun02
Progress being logged to /var/log/zones/zoneadm.30220110Z233232Z.sun02.install
       Image: Preparing at /zones/sun02/root.
 AI Manifest: /tmp/manifest.xml.F_ayqq
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: sun02
Installation: Starting ...
              Creating IPS image
Startup linked: 1/1 done
        Installing packages from:
solaris  origin:  http://localhost:1008/solaris/ce43f14c4791b5320596e2023cde1ec08709a3af/

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            183/183   33556/33556  222.2/222.2  139k/s

PHASE                                          ITEMS
Installing new actions                   46825/46825
Updating package state database               Done
Updating image state                          Done
Creating fast lookup database                 Done
Installation: Succeeded

Note:Man pages can be obtained by installing pkg:/system/manual done. Done: Installation completed in 2392.837 seconds.

Now our newly zone "sun02" has been installed successfully. All the configuration files are keep in /zones/sun02/root directory.

3. In this step we will boot the newly installed zone "sun02".

sun#zoneadm -z sun02 boot

You can check the status of zone that it is running or not after boot.

sun#zoneadm list -icv
ID NAME      STATUS     PATH          BRAND    IP
   0 global   running    /            solaris  shared
   1 sun01    running    /zones/sun01 solaris  excl
   3 sun02    running    /zones/sun02 solaris  excl

if you see the above output newly zone "sun02" is running working fine on the solaris 11 operating system.

4. Now in the next step, we will login on the local zone console to complete the configuration process.

sun# zlogin -C sun02
[Connected to zone 'sun02' console]

You can press enter when you will get this message. Now it is asking for some configuration step we need to give a details one by one.

Time Zone: Regions
select the region that contains your time zone.
Regions
UTC/GMT
Africa
Americas
Antarctica
Arctic Ocean
Asia
Atlantic Ocean
Australia
Europe
Indian Ocean
Pacific Ocean
F2_Continue  F3_Back  F6_Help  F9_Quit

Time Zone: Locations
Select the location that contains your time zone.
Locations
x Afghanistan
x Armenia
x Azerbaijan
x Bahrain
x Bangladesh
x Bhutan
x Brunei
x Cambodia
x China
x Cyprus
x East Timor
x Georgia
x Hong Kong
v India
F2_Continue  F3_Back  F6_Help  F9_Quit

Time Zone
Select your time zone.
Time Zones
Asia/Kolkata

F2_Continue  F3_Back  F6_Help  F9_Quit

System Configuration Summary
Review the settings below before continuing. Go back (F3) to make changes.

Time Zone: Asia/Kolkata
Language: *The following can be changed when logging in.
Default language: C/POSIX
Terminal type: vt100

Users:
No user account

Network:
Computer name: sun02
Network Configuration: Automatic

Support configuration:
Not generating a Support profile as OCM and ASR services are not installed.
Hostname: sun02

So now your zone is fully configured ans installed successfully. You can login in zone very easily. So in next step we will see the post configuration settings which is required on local solaris zone.

5. In the final step you need login to local zone sun02 and configured the ip address on the zone sun02.

sun#zlogin -z sun02

You can successfully login in your newly created solaris 11 zone. Please leave a comment if you have any doubt ,i will get back to you as soon as possible.

How to Create VNIC and Assign a IP Address on Solaris 11

Hello Friends,

In my old post, I described that how we will create a new local solaris zone on global zone. As you know every zone has their own networking but how it is works and configured we need to understand, So in this post, I will explain to you how to create a virtual network on Solaris 11 before zone creation.

For creating Virtual NIC and assigning fix static IP address in Solaris 11 we need to understand the basic difference between older version of Solaris and Solaris 11.

In Solaris 10, according to the NIC manufacturer,physical network interfaces are named as (Ex:bge,e1000g,nxge).But in Solaris 11 onwards,the names are hidden from the view and all the interfaces will be named as net0,net1…netx.

Before forward to main work we need to know that using which command we can check which interface has been mapped to physical interface. Using below command you can check all the network interface details.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002

If you want to show all dladm level devices,including VNIC’s & aggregation links,use the below command-

sun01# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --
net1                phys      1500   up       --

In Solaris 11,you can give a meaning full description(net1/oracle_VIP) to all the IP address on the system unlike Solaris 10. (e1000g1:2)

How to assigning new IP address to NIC:-

1. We can see how we assigned IP address to the physical interface, so in the first step we will check all the physical interface using below command.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002

2. In this step we would know how we will create a new interface so you can use the below command for this.

sun01# ipadm create-ip net1

3. This is the main step to assign the static ip address to the newly created interface net1. You can use below command or syntax to assign the fixed IP.

sun01#ipadm create-addr -T static -a local=10.135.0.2/24 net1

You can change your IP address accordingly. 

4. Now we will Verify whether IP address is configured or not which we assigned on above step.

sun01# ifconfig  net1
net1: flags=1000843 mtu 1500 index 7
        inet 10.135.0.2 netmask ffffff00 broadcast 10.135.0.255
        ether 0a:cB:12:8e:15:e2

If you see the above output, the new IP address is shown on net1 interface successfully. Using above all 4 steps you can know how we will assinged the static ip address to the sun solaris 11 operating system.

Now we will go for Virtual Network Interface creation steps.I can create N number of VNIC’s using single physical interface.These VNIC are treated as actual physical interface and possible to assign to local zones with  full access to it.

How to create a new VNIC using interface net2:-

1. In the initial steps I will run the same command to check out the all physical interface which is available on the Solaris 11 Server.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002
net2              Ethernet             unknown    1000   full      bge003

If you see the above command output network interface "net2" is in unknow state, So in the next step I will create a new VNIC using net2.

2. In this step we will create a new VNIC using net2. In my case i will suppose VNIC name “vnic01”, so for creating the new VNIC we will run the below command which describe below.

sun01#dladm create-vnic  -l net2 vnic01

3.Now, We will plumb the virtual interface and create a default IP to new VNIC.

sun01# dladm create-vnic  -l net2 vnic01
sun01# ipadm create-ip vnic01
sun01# ifconfig vnic01
vnic01: flags=1000842 mtu 1500 index 8
        inet 0.0.0.0 netmask 0
        ether 2c:18:10:Ce:1a:12

4. Now we will assign the new IP address to VNIC and verfif that new IP for vnic01 is configured or not.

sun01# ipadm create-addr -T static -a local=10.135.0.3/24 vnic01
sun01# ifconfig vnic01
vnic01: flags=1000843 mtu 1500 index 8
        inet 10.135.0.3 netmask ffffff00 broadcast 10.135.0.255
        ether 2c:18:10:Ce:1a:12

5. In the final step we will try to run snoop on VNIC which we have create now. You can verify through snooping is that VNIC01 is working fine or not.

sun01# snoop -d vnic01

The same way you can create a multiple VNIC and assign a new IP address to it. Hope you got some idea about Solaris 11 networking part after reading this post. Please let me know if you have any doubt regarding this post.

Thursday, January 5, 2017

How to Set a Solaris 11 Machine's NIS Domain Name

Hello Friends,

Hope you are doing well at your end. In this post, I will explain to you, how to set a Solaris machine NIS domain name on Solaris 11 operatings system. 

If domainname command not showing any output then you need to check either defaultdomain or NIS domain is configured or not.

Steps which we need to follow to set the NIS domain name as describe below.

1. Please run  "cat /etc/defaultdomain" command and check the output that domain is set or not.

    #domainname

The above command shows you the current domain name on the server, if no output is display you need to set the domain by below command.

   #domainname UNIX

Run the below command to check the output again.

   #domainname
   UNIX

You can see the output. All the above command is used for checking and setting the domain name on the Solaris operating server.

2. If you want to set the domain using NIS, then first please check the NIS/DOMAIN service is running or not

root@sun:~# svcs status nis/domain
STATE          STIME    FMRI
disabled       18:20:04 svc:/network/nis/domain:default

In my Solaris machine, currently NIS domain services is stop, we will start it later once we will configured the NIS domain name on the Solaris server.

3. Now you need to configure the NIS domain for your machine ( in my case - UNIX is my domain name)

root@sun:~# svccfg -s svc:/network/nis/domain setprop config/domainname = UNIX

If you see the above command, "svccfg" command is used to configure the domain and set the proper properties.

4. In the final step once the configuration has been completed you need to refresh & enable the NIS domain service again.

root@sun:~# svccfg -s nis/domain:default refresh
root@sun:~# svcadm enable nis/domain

You can check the NIS domain service status as describe in step 2. 

5. Now you can verify the domain name using below command so we can ensure that the NIS domain name has been set successfully. 

root@sun:~# domainname
UNIX
The above command output show "UNIX" domain name which we set during the configuration, so using these above method we can easily set the NIS domain name on the Solaris operating server.

I would request to you please comment on the post if you are facing any issue during setting the NIS domain name on Solaris platform. 

Tuesday, December 27, 2016

How you will increase the file system size in Solaris 11


Please find the below method to increase the file system size in Solaris operating system.

1. First you need to check which "zpool" pool is used for your solaris file system. Generally if you server is not connected to any SAN, then zpool name should be "rpool"

2. You can run the below command to check the current zpool status.

#zpool status














In my machine two pool status you can see. My machine is connected to SAN , So I have two pool through which i can increase the file systems size.

3. Run the "df -h" command to check the current size and file system name as given below.











If you can see in above image my system root filesystem is created through "rpool" pool. So when i will increase the file system size then i can use only free space from "rpool" zpool.

4. Please find the below command to increase the file system size. (ex. we will increase the root file system size here)

#zfs set quota=69G rpool/ROOT/solaris-1

If you see the output of df -h , the current size of root file system is 67 GB, and if we want to increase 2GB space more, then you can use the above command. We can fixed the quota size of file system then reserve it. 

#zfs set reservation=69G rpool/ROOT/solaris-1

after successfully run above command you can found that your file system size can increase to 2 GB more and same size has been reduced to "rpool" pool.