Featured post

Quiz: Data PreProcessing

Sunday, 29 May 2016

Redhat 6.7: file system in read only mode

Issue: due to issue on storage the file system went into ro mode. Try remounting the file system.

#cat /proc/mounts | grep ro
/dev/mapper/hostname_vg-lv_app_mcafee /app/mcafee ext4 ro,nosuid,nodev,relatime,barrier=1,data=ordered 0 0

Solution 1:
# mount -o remount,rw /app/mcafee
mount: cannot remount block device /dev/mapper/hostname_vg-lv_app_mcafee read-write, is write-protected

Solution 2: If first one is giving above error, follow this one.

a> Go to single user mode and run fsck

b> fsck /app/mcafee abd reboot


Tuesday, 24 May 2016

Redhat 6.7:"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message

My server was not responding today, some of the services were responding but ssh was not working. When I logged in from console it , I got below message:

*********************************************
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message
INFO: task java:23541 blocked for more than 120 seconds.
Tainted: G                 W -- -----------------------------  2.6.32-

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

Root cause: By default Linux uses up to 40% of the available memory for file system caching. After this mark has been reached the file system flushes all outstanding data to disk causing all following IOs going synchronous. For flushing out this data to disk this there is a time limit of 120 seconds by default. In this case  the IO subsystem is not fast enough to flush the data within 120 second. As IO subsystem responds slowly and more requests are served, System Memory gets filled up resulting this issue.

Fix:
1>     Lower this value of 40% to 10%. Ideally, it should not impact performance as it will use direct IO and bypass the file system cache completely.
e     set “vm.dirty_ratio=10″ in /etc/sysctl.conf to make it persistent across reboots.


2>     Increase the memory (however go for this if memory is less on the server).


Friday, 13 May 2016

RedHat 7.2: Network unreachable

Problem 1: After server reboot IP address didn't assign to interface and server was out of network

Solution: Even after configuring the interface observed netmask is 255.255.255.255 which was preventing to connect to network

Steps:

#ip address -add xx.xx.xx.xx dev ens123

#vi /etc/sysconfig/network-scripts/ifcfg-ens123
NETMASK=255.255.255.0
onboot=yes

#ifdown ens123

#ifup ens123

Problem 2: If you enable the iptables, it blocks the ssh. You can ssh to localhost from console but from outside you can't do ssh.

Solution: Disable the iptables or include the port

#systemctl stop iptables

Wednesday, 4 May 2016

Solaris 11: How to configure partition table for DB FRA/DAT


Initail Partition table:
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    15      128.00MB    (16/0/0)       262144
  1       swap    wu      16 -    31      128.00MB    (16/0/0)       262144
  2     backup    wu       0 - 12797       99.98GB    (12798/0/0) 209682432
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      32 - 12797       99.73GB    (12766/0/0) 209158144
  7 unassigned    wm       0                0         (0/0/0)             0

Procedure:
1> transfer all unassigned space to specified partition through free hog option.
partition> m
Select partitioning base:
        0. Current partition table (original)
        1. All Free Hog
Choose base (enter number) [0]? 1

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0                0         (0/0/0)             0
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 12797       99.98GB    (12798/0/0) 209682432
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

Do you wish to continue creating a new partition
table based on above table[yes]?
Free Hog partition[6]? 4
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 3c
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]:

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -     2       24.00MB    (3/0/0)         49152
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 12797       99.98GB    (12798/0/0) 209682432
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       3 - 12797       99.96GB    (12795/0/0) 209633280
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

Okay to make this the current partition table[yes]?
Enter table name (remember quotes): abc

Ready to label disk, continue? y

partition> q

Tuesday, 3 May 2016

RedHat 7.2: How to configure non standard port for ssh

Redhat don't allow non-standard port to be used by a service, follow below procedure to configure this and other parameters to bring it into network. SElinux refers to Security Enhanced Linux, this needs to be disabled.

Turn off selinux  (it’s not configured for docker or sshd on 2222)
set enforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

Turn off firewalld (docker listens on many and random ports)
service firewalld stop && chkconfig firewalld off

Fix sshd to reenable port 2222 for sshd (as per standards)
# add 2222 to /etc/ssh/sshd_config
service sshd reload

Install basic tools
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
rpm -ivh /media/cdrom/Packages/net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
rpm -ivh /media/cdrom/Packages/bind-utils-9.9.4-29.el7.x86_64.rpm /media/cdrom/Packages/bind-libs-9.9.4-29.el7.x86_64.rpm
rpm -ivh /media/cdrom/Packages/lsof-4.87-4.el7.x86_64.rpm

Fix /etc/resolv.conf so DNS works:
cat > /etc/resolv.conf << EOF
search unix.anz
nameserver 10.XX.XX.XX
nameserver 10.XY.XX.XX
EOF

Fix default route:
route add default gw XX.XX.XX..254
# both of above are already in /etc/sysconfig/network-scripts/ifcfg-ens192 but not active probably network restart would work, but good chance of failing and locking me out, so applied manually

Fix timezone
ln -sf /usr/share/zoneinfo/Country/City /etc/localtime

Install dependencies for docker:  (yum not configured)
cd /media/cdrom/Packages/
rpm -ivh policycoreutils-python-2.2.5-20.el7.x86_64.rpm audit-libs-python-2.4.1-5.el7.x86_64.rpm checkpolicy-2.1.12-6.el7.x86_64.rpm python-IPy-0.75-6.el7.noarch.rpm libsemanage-python-2.1.10-18.el7.x86_64.rpm libcgroup-0.41-8.el7.x86_64.rpm setools-libs-3.3.7-46.el7.x86_64.rpm


Monday, 2 May 2016

Solaris 11: How to prepare a lun for a ZFS File System on a ldom

Create a zpool using this lun, it will take care of everything


Create zpool it will automatically create the partition tabel.

# zpool create zpdibso63l_T2P_apps c1d1

Current partition table (original):
Total disk sectors available: 209698749 + 16384 (reserved sectors)

Part      Tag    Flag     First Sector         Size         Last Sector
  0        usr    wm               256       99.99GB          209698782
  1 unassigned    wm                 0           0               0
  2 unassigned    wm                 0           0               0
  3 unassigned    wm                 0           0               0
  4 unassigned    wm                 0           0               0
  5 unassigned    wm                 0           0               0
  6 unassigned    wm                 0           0               0
  8   reserved    wm         209698783        8.00MB          209715166