28 Eylül 2015 Pazartesi

Linux sistemlerinde belli bir kullanıcıya ait, belli dosyaları silme (Yeni başlayanlar için :) )


Bir kullanıcıya ait sonu tmp ile biten dosyaları silmek için find komutunu kullanabiliriz.

Örnek;

find /home -uid 32768 -name \*.tmp -exec rm -f {} \; -print

kendi kullanıcınızın id si ile 32768 değiştirmeyi unutmayınız.

Detaylı bilgi için: man find

25 Eylül 2015 Cuma

Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7 - from Redhat


https://access.redhat.com/articles/1189123


System basics

TaskRHEL5RHEL6RHEL7
View subscription information/etc/sysconfig/rhn/systemid/etc/sysconfig/rhn/systemid
subscription-manager identity
subscription-manager identity
Configure subscriptionrhn_register
subscription-manager 1
rhn_register
rhnreg_ks
subscription-manager
subscription-manager2
rhn_register 3
View RHEL version information/etc/redhat-release
View system profilesosreport
dmidecode
hwbrowser
sosreport
dmidecode
lstopo
lscpu

Basic configuration

TaskRHEL5RHEL6RHEL7
Graphical configuration toolssystem-config-*gnome-control-center
Text-based configuration toolssystem-config-*-tui
Configure printersystem-config-printer
Configure networksystem-config-networknmcli
nmtui
nm-connection-editor
Configure system languagesystem-config-languagelocalectl
Configure time and datesystem-config-date
date
timedatectl
date
Synchronize time and datentpdate
/etc/ntp.conf
timedatectl
/etc/chrony.conf
ntpdate
Configure keyboardsystem-config-keyboardlocalectl
Configure SSH/etc/ssh/ssh_config
/etc/ssh/sshd_config
~/.ssh/config ssh-keygen

Jobs and services

TaskRHEL5RHEL6RHEL7
List all serviceschkconfig --list
ls /etc/init.d/
systemctl -at service
ls /etc/systemd/system/*.service
ls /usr/lib/systemd/system/*.service
List running servicesservice --status-allsystemctl -t service --state=active
Start/stop serviceservice name start
service name stop
systemctl start name.service
systemctl stop name.service
Enable/disable servicechkconfig name on
chkconfig name off
systemctl enable name.service
systemctl disable name.service
View service statusservice name statussystemctl status name.service
Check if service is enabledchkconfig name --list systemctl is-enabled name
Create new service file or modify configurationchkconfig --addsystemctl daemon-reload
/etc/systemd/system/*.service
View run level/targetrunlevel
who -r
systemctl get-default
who -r
Change run level/target/etc/inittab
init run_level
systemctl isolate name.target
systemctl set-default
Configure logging/etc/syslog.conf/etc/rsyslog.conf/etc/rsyslog.conf
/etc/rsyslog.d/*.conf
/var/log/journal
systemd-journald.service
View logs/var/log/var/log
journalctl
Configure system auditadd audit=1 to kernel cmdline
auditctl
/etc/audit/auditd.conf
/etc/audit/audit.rules
authconfig
/etc/pam.d/system-auth
pam_tty_audit kernel module
View audit outputaureport /var/log/faillog
Schedule/batch taskscron
at
batch
Find file by namelocate
Find file by characteristicfind
Create archivetar
cpio
zip

Kernel, boot, and hardware

TaskRHEL5RHEL6RHEL7
Single user/rescue modeappend 1 or s or init=/bin/bash to kernel cmdlineappend rd.break or init=/bin/bash to kernel cmdline
Shut down systemshutdown
Power off systempoweroffpoweroff
systemctl poweroff
Halt systemhalthalt
systemctl halt
Reboot systemrebootreboot
systemctl reboot
Configure default run level/target/etc/inittabsystemctl set-default
Configure GRUB bootloader/boot/grub/grub.conf/etc/default/grub
grub2-mkconfig
grub-set-default
Configure kernel modulemodprobe
View hardware configuredhwbrowserlshw (in EPEL)
Configure hardware deviceudev
View kernel parameterssysctl -a
cat /proc/cmdline
Load kernel modulemodprobe
Remove kernel modulemodprobe -r
View kernel versionrpm -q kernel
uname -r

Software management

TaskRHEL5RHEL6RHEL7
Install softwareyum install
yum groupinstall
yum install
yum group install
View software infoyum info
yum groupinfo
yum info
yum group info
Update softwareyum update
Upgrade softwareyum upgrade
Configure software repositorysubscription-manager repos
/etc/yum.repos.d/*.repo
Find package owning filerpm -qf filename
yum provides filename-glob
View software versionrpm -q packagename
View installed softwarerpm -qa
yum list installed

User management

TaskRHEL5RHEL6RHEL7
Graphical user managementsystem-config-users
Create user accountuseradd
Delete user accountuserdel
View/change user account detailsusermod
/etc/passwd
vipw
id
Create user groupgroupadd
Delete user groupgroupdel
Change group detailsgroupmod
/etc/group
Change user passwordpasswd
Change user permissionsusermod
visudo
Change group permissionsgroupmod
visudo
Change password policychage
View user sessionsw

File systems, volumes, and disks

TaskRHEL5RHEL6RHEL7
Default file systemext3ext4xfs
Create/modify disk partitionsfdisk
parted
fdisk
gdisk
parted
ssm create
Format disk partitionmkfs.filesystem_type (ext4, xfs)
mkswap
mkfs.filesystem_type (ext4, xfs)
mkswap
ssm create
Defragment disk spacecopy data to new file system
fsck (look for 'non-contiguous inodes')
copy data to new file system
fsck (look for 'non-contiguous inodes')
xfs_fsr
Mount storagemount
/etc/fstab
mount
/etc/fstab
ssm mount
Mount and activate swap/etc/fstab
swapon -a
Configure static mounts/etc/fstab
View free disk spacedf
View logical volume infolvdisplay
lvs
vgdisplay
vgs
pvdisplay
pvs
Create physical volumepvcreatepvcreate
ssm create (if backend is lvm)
Create volume groupvgcreatevgcreate
ssm create (if backend is lvm)
Create logical volumelvcreatelvcreate
ssm create (if backend is lvm)
Enlarge volumes formatted with default file systemvgextend
lvextend
resize2fs
vgextend
lvextend
xfs_growfs
ssm resize
Shrink volumes formatted with default file systemresize2fs
lvreduce
vgreduce
XFS cannot currently be shrunk; copy desired data to a smaller file system.
Check/repair file systemfsckfsck
ssm check
View NFS shareshowmount -e
mount
Configure NFS share/etc/exports
service nfs reload
/etc/exports
systemctl reload nfs.service
Configure on-demand auto-mounts/etc/auto.master.d/*.autofs
/etc/auto.*
Change file permissionschmod
chown
chgrp
umask (future file creation)
Change file attributeschattr
Change access control listsetfacl

Networking

TaskRHEL5RHEL6RHEL7
Configure name resolution/etc/hosts
/etc/resolv.conf
/etc/hosts
/etc/resolv.conf
nmcli con mod
Configure hostname/etc/sysconfig/networkhostnamectl
/etc/hostname
nmtui
View network interface infoip addr
ifconfig
brctl
ip addr
nmcli dev show
teamdctl
brctl
bridge
Configure network interface/etc/sysconfig/network-scripts/ifcfg-* /etc/sysconfig/network-scripts/ifcfg-*
nmcli con [add|mod|edit]
nmtui
nm-connection-editor
View routesip route
Configure routesip route add
system-config-network
/etc/sysconfig/route-iface
ip route add
nmcli
nmtui
nm-connection-editor
/etc/sysconfig/route-iface
Configure firewalliptables and ip6tables
/etc/sysconfig/ip*tables
iptables and ip6tables
/etc/sysconfig/ip*tables
system-config-firewall
firewall-cmd
firewall-config
View ports/socketsss
lsof
netstat
ss
lsof

Security and identity

TaskRHEL5RHEL6RHEL7
Configure system security/etc/selinux/config
chcon
restorecon
semanage
setsebool
system-config-selinux
Report on system securitysealert
LDAP, SSSD, Kerberosauthconfig
authconfig-tui
authconfig-gtk
Network usersgetent

Resource management

TaskRHEL5RHEL6RHEL7
Trace system callsstrace
Trace library callsltrace
Change process prioritynice
renice
Change process run locationtaskset
Kill a processkill
pkill
killall
View system usagetop
ps
sar
iostat
netstat
vmstat
mpstat
numastat
top
ps
sar
iostat
netstat
ss
vmstat
mpstat
numastat
tuna
top
ps
sar
iostat
ss
vmstat
mpstat
numastat
tuna
View disk usagedf df
iostat

22 Eylül 2015 Salı

lvm i hızlandırmak (Gazlamak :) ) { SSD diski cache disk olarak kullanmak md_cache}

Linux dağıtımlarından her hangi birinde, softraid ve lvm kullanıyorsanız, performansınız düşüklüğünden şikayetçi iseniz, bir adet ssd disk + lvmcache  yardımınıza koşacaktır. lvmcache güncel linux dağıtımlarında standart bulunmaktadır.

Kullandığınız dağıtımda bu özelliğin olup olmadığını öğrenmek için;

                     #modinfo dm_cache

komutundan faydalanabilirsiniz.


Bu komut sizlere aşağıdaki gibi bir çıktı veriyorsa sorun yok.

root@ultra27:~# modinfo dm_cache
filename:       /lib/modules/4.2.0-10-generic/kernel/drivers/md/dm-cache.ko
license:        GPL
author:         Joe Thornber <ejt@redhat.com>
description:    device-mapper cache target
srcversion:     5B4207739B7A6C60B2A22CE
depends:        dm-persistent-data,dm-bio-prison
intree:         Y
vermagic:       4.2.0-10-generic SMP mod_unload modversions
signer:         Build time autogenerated kernel key
sig_key:        F3:83:3C:CF:74:C7:88:F8:B9:EC:CF:4D:A2:19:C0:B6:39:84:EE:58
sig_hashalgo:   sha512
parm:           cache_copy_throttle:A percentage of time allocated for copying to and/or from cache (uint)
root@ultra27:~#

Şayet sisteminizde mevcut değilse sisteminizi/kernelinizi güncellemeniz yeterli olur.

dm_cache kullanılan sistemde lvs çıktısı;






Kullanımını;
                  man lvmcache
ile öğrenebilirsiniz. Yok ben man den öğrenemiyorum diyenlerdenseniz;


Unutmamak gereken önemli nokta, cache olarak kaliteli ssd kullanılması gerektiği.  ssd diskinizden emin değilseniz, 2 tane ssd yi mirror olarak kullanabilirsiniz.

Kendim ssd cache olarak "Intel SSD DC S3700 Series 100GB, SATA" disklerinden kullanıyorum.

    Model Number:       INTEL SSDSC2BA100G3                    
    Firmware Revision:  5DV10270

Sizlerede tavsiye ederim.

 

uzun bir aranın ardından biraz yenilik iyi olur diyerek tekrardan linux lvm cache kullanmaya başladım. Başlamışkenden bu bilgiyi hatırlamak için tahtaya yazıyorum.

Kişisel lab ortamlarında kullanabilirsiniz. 

Sistem disklerimiz;

Data diskimiz : /dev/sda                (normal sata 3.5" disk)

Cache diskimiz : /dev/sdb

                              /dev/sdc

Cache metadata diskimiz:   /dev/nvme0n1p3

                                                 /dev/nvme1n1p3                      

lvmcache cachemetada data için en fazla 16GB destekler, buda fazlasıyla yeterli.

cache metadatayı nvme diskimiz  üzerinde, cache olarak ssd sata diskimizi, data diskimiz olarak normal sata diski kullanıyoruz. ufacık milyonlarca dosyanız varsa metadatayı yüksek tutabiliriz.

Hadi başlayalım.


    1. Volum grubu oluşturuyoruz

         # vgcreate vg_data /dev/sd[abc} /dev/nvme0n1p3 /dev/nvme1n1p3

    2. Data lv yi oluşturuyoruz

        lvcreate -L16T -n lv_data vg_data /dev/sda

    3. Cache lv yi oluşturalım

        # lvcreate -L1T -i2 -n lv_cache vg_data /dev/sdb /dev/sdc

    4. Cache meta datayı oluşturalım

       # lvcreta -L16G -i2 -n lv_cachemetadata vg_data /dev/nvme0n1p3 /dev/nvme1n1p3 

    5. cache pool olarak ayarlayalım

       # lvconvert --type cache-pool --poolmetadata vg_data/lv_cachemetadata vg_data/lv_cache

    6. Kontrol edelim

         # lvs

         # lvs -a -o +devices vg_data

 


19 Eylül 2015 Cumartesi

sparc sistemlerde boot diski seçmek

reset
reset-all
probe-scsi-all

{0} ok devalias
ttya                     /ebus@c0/serial@0,ca0000
nvram                    /virtual-devices/nvram@3
net3                     /pci@0/pci@0/pci@1/pci@0/pci@3/network@0,1
net2                     /pci@0/pci@0/pci@1/pci@0/pci@3/network@0
net1                     /pci@0/pci@0/pci@1/pci@0/pci@2/network@0,1
net0                     /pci@0/pci@0/pci@1/pci@0/pci@2/network@0
net                      /pci@0/pci@0/pci@1/pci@0/pci@2/network@0
cdrom                    /pci@0/pci@0/pci@1/pci@0/pci@1/pci@0/usb@0,2/storage@2/disk@0:f
disk7                    /pci@0/pci@0/pci@2/scsi@0/disk@7
disk6                    /pci@0/pci@0/pci@2/scsi@0/disk@6
disk5                    /pci@0/pci@0/pci@2/scsi@0/disk@5
disk4                    /pci@0/pci@0/pci@2/scsi@0/disk@4
disk3                    /pci@0/pci@0/pci@2/scsi@0/disk@3
disk2                    /pci@0/pci@0/pci@2/scsi@0/disk@2
disk1                    /pci@0/pci@0/pci@2/scsi@0/disk@1
disk0                    /pci@0/pci@0/pci@2/scsi@0/disk@0
disk                     /pci@0/pci@0/pci@2/scsi@0/disk@0
scsi                     /pci@0/pci@0/pci@2/scsi@0
virtual-console          /virtual-devices/console@1
name                     aliases
{0} ok set boot-device /pci@0/pci@0/pci@2/scsi@0/disk@4
Unimplemented action # 1 on object (f02733b0) , whose maximum action # is -1

{0} ok setenv boot-device /pci@0/pci@0/pci@2/scsi@0/disk@4
boot-device =           /pci@0/pci@0/pci@2/scsi@0/disk@4
{0} ok boot
Boot device: /pci@0/pci@0/pci@2/scsi@0/disk@4  File and args:


 {0} ok show-disks



14 Eylül 2015 Pazartesi

Bildiğimizi zannettiğimiz, kulaktan dolma bilgilerle...


Merhabalar,

Bu gün bir soruya cevap verirken, düşünmeden, araştırmadan, hızlıca cevap verdiğimizi fark ettim.

 "Linux, Microsoft Windows 7 Nedir? Aralarındaki temel farkı tek cümle ile özetleyiniz." sorusuna 55 den fazla cevap  içerisinde tane bile doğru cevap çıkmaması.

55 tane cevap veren farklı insanlardan hiç birisi,  arama motorlarına(google/yandex vs.)  "linux nedir"  sorusunu sormamış olması çok ilginç.

Galiba bu bizim toplumsal yapımızı gösteriyor..



Cevabı merak edip, araştırmayan için cevap;

Linux  kernel(işletim sistemleri için), microsoft windows 7 ise işletim sistemidir.

Redhat/Debian/Suse gibi dağıtımları işletim sistemi olarak kabul edebiliriz.


8 Eylül 2015 Salı

freebsd ve qmail meraklıları için

Merhabalar,

üzerinden çıkalı yıllar geçsede önemini kaybetmeyen freebsd ve qmail kurulumu hakkında bir kaynağı paylaşmak istiyorum.

http://www.freebsdrocks.net/index.php/documents/17-qmail-2-0-testing-only

Umarım meraklılarına faydalı olur.

6 Eylül 2015 Pazar

78 diskli sunucu ( disk sunucusu)


Bu gün, Türkiye'de satılmayın(umarım reklamdan sonra satan birileri çıkar!!) bir ürün reklamı yapmak istiyorum.


Bu ürün oldukça özel bir sunucu. Üzerinde 78 adet disk takılabilin bir sunucu.

Yüksek disk pakasitesine ihtiyacı olanlar lütfen dikkatlice inceleyiniz. Hatta incelemekle kalmayıp,
üreticiye Türkiye'de satılıp satılmadığını, fiyatını sormanız çok güzel olur.


http://www.quantaqct.com/Product/Storage/Storage-Servers/4U/New-QuantaPlex-T21P-4U-p291c77c71c150c222


QuantaPlex T21P-4U

Storage
SKU 1: 2 MBs with 70x 3.5"/2.5” hot plug, each MB manages 35 hard drives
SKU 2: 1 MB with 78x 3.5"/2.5” hot plug

Processor
Processor Type
(2) Intel® Xeon® processor E5-2600 v3 product family,
Max. TDP Support
135W
Number of Processors
2
Internal Interconnect
6.4 / 8.0/ 9.6 GT/s
L3 Cache
Up to 45MB


 Storage Controller
Onboard
Wellsburg PCH RSTe
Optional Controller (more options refer to the CCL)
Quanta LSI® 3008 12Gb/s SAS mezzanine, RAID 0,1,10
Quanta LSI® 3108 12Gb/s RAID mezzanine, RAID 0, 1, 5, 10; RAID 6 requires additional RAID key


 Onboard Storage
(2) 2.5" hot-plug SSD
(1) SATADOM 

QuantaPlex T21P-4U
Ultra-Dense Extreme Performance Storage Server
Tailored to meet the growing storage capacity demand in hyper scale datacenter, the QuantaPlex T21P-4U equips up to seventy-eight hot-swappable and screw-less 3.5” drives and two high-computing server nodes into an ultra-dense 4U chassis. Capable of delivering up to 620 terabytes of storage in one system, the QuantaPlex T21P-4U efficiently achieve the most demanding cloud storage environments planning today and future.

The QuantaPlex T21P-4U is a highly sophisticated, dense storage server built to provide outstanding low dollar-per-GB costs for cold, warm and even hot storage workloads. With the latest Intel® Xeon® E5-2600v3 processors and Quanta System Manager (QSM), the QuantaPlex T21P-4U offers cloud planners the storage capacity and the manageability they need.
Maximized Storage Density
Aimed at streaming file, massive object or block level data stores for cloud environments, archive and data analytics with up to seventy-eight 3.5” SAS/SATA hard drives, each up to 8TB in capacity, QuantaPlex T21P-4U provides exceptionally high storage density while leveraging high-efficiency power to maximize performance-per-watt savings to reduce TCO. Two 2.5” SSD boot drives provide extra capability for high-performance storage within each node for fast access to frequently-used data.
Efficient System Assembly and Deployment
Driven by social media, mobile applications, and devices boosted by mega hyper scale datacenters, server and storage platforms are requiring more capacity to store the increasing volume of data and retain the data for longer periods of time than ever. To install higher density and large number of hard drives into one system is time consuming for system integrators and IT administrators. With innovated screw-less hard drive carrier design, QuantaPlex T21P-4U allows operators can complete the system assembly in the short time, which is significantly reduce the deployment and service time.
Flexible and Versatile I/O Expansion
QuantaPlex T21P-4U support QCT made OCP LAN mezzanine card with varied type of Ethernet connectivity from 1Gb, 10Gb and 40Gb. Along with the support up to three additional PCIe Gen3 slots, offers flexible and versatile I/O expansion capability to eliminate costly bottlenecks. Deliver high availability even under heavy loading with up to four 1600W Platinum-efficiency power supplies that provide fully-redundant 2+2 split zone power configuration capabilities.
About QCT
QCT (Quanta Cloud Technology) is a global datacenter solution provider extending the power of hyperscale datacenter design in standard and open SKUs to all datacenter customers.  Product lines include servers, storage, network switches, integrated rack systems and cloud solutions, all delivering hyperscale efficiency, scalability, reliability, manageability, serviceability and optimized performance for each workload.  QCT offers a full spectrum of datacenter products and services from engineering, integration and optimization to global supply chain support, all under one roof.  The parent of QCT is Quanta Computer Inc., a Fortune Global 500 technology engineering and manufacturing company.

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...