7 Şubat 2018 Çarşamba

Linux tabanlı sistemlerde hafıza ( ram ) kontrolu ( free )

Linux sistemlerinde hafıza kullanımı kontrol ile  ilgili olarak, genellikle free komutu kontrol ederiz.
Fakat bu kontrol eski ve güncel olmayan sistemlerde, yalnış algılamamıza neden oluyor.

Red Hat 6.x/5.X sistemlerinde aşağıdakilerini görürsünüz.


Gerçekte kullanılabilir sistem hafızamız ise  free + buffers + cached
Özetle eski sistemlered Used  %100  ve cache de %95 civarındaysa endişelenmeyin.
Sistem rama ihtiyaç olduğunda cached için kullanılan hafızayı hızlıca boşaltarak, serbest bırakır.
Hafızaya ihtiyaç  duyan uygulamada, serbest kalan hafızayı anında kullanır. Bir sıkıntı olmaz.
Şayet içiniz rahat olmaz ise kernel parametrelerinden vm.min_free_kbytes değerini artırabilirsiniz.
Bu değeri artırırken abartmaya gerek yok. Büyük hafızalı sistemlerde bile 512MB  yeterlidir.

Red Hat 7.x (Oracle veya CentOS 7.x lerde ise) bu yanılmayı düzeltmek için güncelleme yapılmış olup, free komutunun çıktısına ilave olarak kullanılabilir boş hafızayı gösteren available bölümü eklenmiştir. Used bölümündende cache/buff kullanımı çıkartılmıştır.




Özetle eski sistemlerde used, tam olarak used, free de tam olarak free anlamına gelmez.

Eski linux işletim  sistemin kullananlara tavsiyem, kullandıkları işletim sisteminin güncel sürümlerine veya uygulamalarının desteklediği en güncel sürüme geçmeleridir.

2 Şubat 2018 Cuma

slurmda kuyrukta bekleyen bir işi bir başka kuyruğa taşımak

Slurm kullanırken, kaynak yetersizliğinden beklemekte olan bir işi veya işleri, kaynağı olan başka bir kuyruğa taşımak istersek aşağıdaki scripti kullanabiliriz.

[root@headnode bin ]# cat movejob.sh
#/bin/bash
# 2018.02.02
# Remzi AKYUZ


if [ $# -lt 2 ]
then
        echo "Kullanim sekli $0 kullanici_adi yeni_kuyruk"
        exit 0
fi

user=$1
newq=$2

for i in $(squeue -u $user -h -t PD -o %i)
do
scontrol update jobid=$i partition=$newq
done



[root@headnode bin ]#


1 Şubat 2018 Perşembe

postfixte - giden mailleri relay üzerinden göndermek

Postfix yüklü sistemlerde giden mailleri, direk göndermek yerine,  relay sunucusunun üzerinden göndermek için relayhost tanımını kullanırız.


http://www.postfix.org/postconf.5.html#relayhost

/etc/postfix/main.cf:

# INTERNET OR INTRANET

# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
#
# If you're connected via UUCP, see also the default_transport parameter.
#
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
 

Red Hat Enterprise Linux 5.x/6.x bonding ayarlamak

2009 yılındaki çalışma notumu biraz güncelleyerek burada da olsun istedim.

"RHEL 5.3 uzerinde bonding (Bonding Mode: fault-tolerance (active-backup) )" - Remzi AKYUZ - (2009-08-27 06:01:00)

1. /etc/modprobe.d/bonding.conf dosyasına

alias bond0 bonding
options bonding mode=1 miimon=100

satırı ilave edilir.

2. /etc/sysconfig/network-scripts/ifcfg-bond0 dosyası oluşturulur ve içerisine
DEVICE=bond0
TYPE=bond
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=none
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=1 miimon=100"
BROADCAST=192.168.1.255
IPADDR=192.168.1.100
NETMASK=255.255.255.0
NETWORK=192.168.1.0


satırı ilave edilir.

3. bondingde kullanılacak ethernetler ayarlanır. eth1 ve eth2 yi kullanacağız

/etc/sysconfig/network-scripts/ifcfg-eth1 icerisinde aşağıdaki satırlar olmalı.

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
HOTPLUG=no

/etc/sysconfig/network-scripts/ifcfg-eth2 içerisinde aşağıdaki satırlar

DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
HOTPLUG=no

4. Kontrol için
[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: down
Link Failure Count: 0
Permanent HW addr: 08:00:27:5c:33:61

Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:a5:24:6a

Son olarakta fiziksel olarak(kablolar sökülüp takılarak test edilir.
Loglardada aşağıdakileri görebiliriz.

#
grep bond /var/log/messages
Aug 27 05:33:55 localhost kernel: bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.
Aug 27 05:33:55 localhost kernel: bonding: bond0: setting mode to active-backup (1).
Aug 27 05:33:55 localhost kernel: bonding: bond0: Setting MII monitoring interval to 100.
Aug 27 05:33:55 localhost kernel: bonding: bond0: Adding slave eth1.
Aug 27 05:33:55 localhost kernel: bonding: bond0: enslaving eth1 as a backup interface with a down link.
Aug 27 05:33:55 localhost kernel: bonding: bond0: Adding slave eth2.
Aug 27 05:33:55 localhost kernel: bonding: bond0: making interface eth2 the new active one.
Aug 27 05:33:55 localhost kernel: bonding: bond0: first active interface up!
Aug 27 05:33:55 localhost kernel: bonding: bond0: enslaving eth2 as an active interface with an up link.
Aug 27 05:37:18 localhost kernel: bonding: bond0: link status definitely up for interface eth1.
Aug 27 05:37:46 localhost kernel: bonding: bond0: link status definitely down for interface eth2, disabling it
Aug 27 05:37:46 localhost kernel: bonding: bond0: making interface eth1 the new active one.


Detaylı bilgi için: https://access.redhat.com/articles/172483

ansible ile yerel quay sunucusu üzerinden execution environment kullanımı

 Yerel quay veya registry sunucularımızdaki ee leri ansible ile kullanabiliyoruz. Bunun için kendi yaptığımız ee leri veya hazır ee leri yük...