/var/lib/accountsservice/users

'IBM PowerLinux > REDHAT' 카테고리의 다른 글

Hot add, remove, rescan of SCSI devices on Linux  (0) 2018.07.09
Redhat Nouveau 내장그래픽카드 nvidia 드라이버 설치 삭제  (0) 2018.07.03
CentOS 7 bonding nmcli  (0) 2017.11.01
Linux semaphore  (0) 2016.07.11
NETWORK Bonding  (0) 2016.06.29

 

 

http://fibrevillage.com/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux

 

 

 

Hot add, remove, rescan of SCSI devices on Linux

Finding informations about SCSI devices

The first problem when working with SCSI devices might be to map informations you got from /proc/scsi/scsi to the device names the kernel uses like /dev/sda and so on.

Or you can use lsscsi utlity. Here's an example:

# lsscsi
[0:0:0:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sda
[0:0:1:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdb
...
[1:0:1:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdj
[1:0:2:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdk
[1:0:3:0]    disk    ATA      HITACHI H7210CA3 A3CB  /dev/sdl
[1:0:4:0]    disk    ATA      HITACHI HUA7210S AC5A  /dev/sdm
...
[5:0:7:0]    disk    ATA      SEAGATE ST31000N SU0D  /dev/sdav
[6:0:0:0]    mediumx IBM      TS3500           0104  /dev/sch0
[6:0:1:0]    tape    IBM      ULT3580-TD5      0104  /dev/st0
[6:0:2:0]    tape    IBM      ULT3580-TD5      0104  /dev/st1

You can find same info by checking /proc/scsi/scsi

# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
...

In the example above

Host: scsi0 Channel: 00 Id: 01 Lun: 00 
is the same device of [0:0:0:0] in the output of lsscsi

Where the output

          h == hostadapter id (first one being 0)
          c == SCSI channel on hostadapter (first one being 0)
          t == ID
          l == LUN (first one being 0)

Rescan of a SCSI bus

Surely reboot a server will let the scsi device get rescanned. But this is not the prefered way. The easiest way is to rescan the whole SCSI bus which will enable the Linux kernel to detect new devices!

To issue a SCSI bus rescan you must know on which bus you've added the device. If you don't know which bus and if there are mutliple buses on the system you can rescan each bus which will be somehow annoying but will not interrupt the system.
To initiate a SCSI bus rescan type

echo "- - -" > /sys/class/scsi_host/host<H>/scan

where H stands for the SCSI bus you want to scan.

# lsscsi
...
[1:0:0:7]    disk    IBM      1814      FAStT  1060  /dev/sdb
[1:0:0:8]    disk    IBM      1814      FAStT  1060  /dev/sdc
[1:0:0:10]   disk    IBM      1814      FAStT  1060  /dev/sde
# echo "- - -" > /sys/class/scsi_host/host1/scan
# lsscsi
...
[1:0:0:7]    disk    IBM      1814      FAStT  1060  /dev/sdb
[1:0:0:8]    disk    IBM      1814      FAStT  1060  /dev/sdc
[1:0:0:9]    disk    IBM      1814      FAStT  1060  /dev/sdd
[1:0:0:10]   disk    IBM      1814      FAStT  1060  /dev/sde

Well done, we got /dev/sdd back.

By the way this does not only work for disks but also for SCSI CD/DVD devices.

You can still use the old way, to get sdd back

echo "scsi add-single-device 1 0 0 9" > /proc/scsi/scsi

For more devices, you have to repeat the same for all devices

Deletion of a SCSI Device

There might be the situation where you must remove a SCSI device from the system.

Easy by using

    echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete
    or
    echo 1 > /sys/block/<dev>/device/delete
    where <dev> is like sda or sdb etc..

Here's an example:

# echo 1 > /sys/block/sdau/device/delete 
# lsscsi | grep sdau
#

Now you see the device sdau is gone.

In old way, this is what you would like to do

echo "scsi remove-single-device h c t l" > /proc/scsi/scsi

Add a SCSI Device back

Surely this can be done just rescan the SCSI bus that the disk seats inuse wildcard like below

    echo "- - -" > /sys/class/scsi_host/host<h>/scan

You can also do this if you know the device SCSI location h:c:t:l

    echo "c t l" >  /sys/class/scsi_host/host<h>/scan

Old way

    echo "scsi add-single-device a b c d" > /proc/scsi/scsi

Rescan of a SCSI Device

The problem of a SCSI bus rescan is, that it will only detect new devices. Can a existing or missing device be rescanned?

Sure, here is it

echo 1 > /sys/block/sdau/device/rescan 
or
echo 1 > /sys/class/scsi_device/h:c:t:l/device/rescan

 In SAN environment, there is a easier way to manage SAN scsi devices, see Sysfs fibre channel tools

'IBM PowerLinux' 카테고리의 다른 글

Linux에서 소프트웨어 RAID 구성  (0) 2017.02.21
linux scan device   (0) 2016.10.22
Linux Monitoring  (0) 2016.05.26
Linux CPU 하이퍼쓰레드 HT 기능 확인  (0) 2016.05.26
Linux CPU information 정보 확인  (0) 2016.05.26





How to view the current semaphore values

To view the maximum number of semaphores and semaphore sets which can be created, type:

cat /proc/sys/kernel/sem


File description: /proc/sys/kernel/sem

This file contains 4 numbers defining limits for System V IPC semaphores. These fields are, in order:

SEMMSL - The maximum number of semaphores in a sempahore set.
SEMMNS - A system-wide limit on the number of semaphores in all semaphore sets. The maximum number of sempahores in the system.

SEMOPM - The maximum number of operations in a single semop call

SEMMNI - A system-widerff limit on the maximum number of semaphore identifiers (sempahore sets)





How to change the semaphore values on Linux


# echo 250 32000 256 256 > /proc/sys/kernel/sem

# cat /proc/sys/kernel/sem
250 32000 256 256



To make the change permanent, add or change the following line in the file /etc/sysctl.conf. This file is used during the boot process.


# echo "kernel.sem = 250 32000 256 256" >> /etc/sysctl.conf




Revised file content for /etc/sysctl.conf


# more /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
kernel.sem=250 32000 256 256


# cat /proc/sys/kernel/sem
250 32000 256 256

 

RHEL 6.4 Bonding

- ent0 & ent1 본딩 구성 예

 1. 랜카드 인식 확인
  - #ifconfig


 2. 필요 파일 생성(#cd /etc/sysconfig/network-scripts 확인 후 있는 파일 빼고 생성)

  - #touch /etc/sysconfig/network-scripts/ifcfg-bond0

  - #touch /etc/sysconfig/network-scripts/ifcfg-eth0

  - #touch /etc/sysconfig/network-scripts/ifcfg-eth1


 3. ifcfg-bond0 파일 수정 (vi로 아래 내용 입력 후 저장)

  - #vi /etc/sysconfig/network-scripts/ifcfg-bond0

    DEVICE=bond0
    IPADDR= 000.000.000.000 /* 자신의 IP 입력 */
    NETMASK=000.000.000.000 /* 넷마스크 */
    GATEWAY=000.000.000.000 /* 게이트웨이 */
    DNS1=000.000.000.000 /* DNS */
    DNS2=000.000.000.000 /*보조 DNS */
    USERCTL=no
    BOOTPROTO=none
    ONBOOT=yes
    NM_CONTROLLED=no

    /* 고정 IP가 아닌 경우 BOOTPROTO=dhcp 로 */


 4. eth0 파일 수정

  - vi /etc/sysconfig/network-scripts/ifcfg-eth0

    DEVICE=eth0
    USERCTR=no
    BOOTPROTO=none
    NM_CONTROLLED=no
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes


 5. eth1 파일 수정(eth0 수정 후 : #sed 's/eth0/eth1/' ifcfg-eth0 > ifcfg-eth1 이용으로 간편히 수정, 생성)

  - vi /etc/sysconfig/network-scripts/ifcfg-eth1

    DEVICE=eth1
    USERCTR=no
    BOOTPROTO=none
    NM_CONTROLLED=no
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes


 6. bonding.conf 파일 수정

  - #touch /etc/modprobe.d/bonding.conf

  - vi /etc/modprobe.d/bonding.conf
   
    alias bond0 bonding
    options bond0 mode=1 miimon=100
    /* mode 0 - balance-rr : (Round Robin)Load Balancing, 송신할 패킷마다 사용하는  NIC 변경
       mode 1 - active-backup : Failover, bond  내에서 한 개의 Slave만 사용, 포트 문제 발상시 다른  Slave가 Enable
       mode 2 - blance-xor : Load Balancing, 소스와 목적지의 MAC을 XOR 연사을 통해 사용할 NIC을 결정하여 분배
       mode 3 - Broadcast : Fault-Tolerance, 모든 Slave로 데이터 전송(failover), 일반적으로 잘 사용 안 함.
       mode 4 - 802.3ad : Dynamic Link Aggregation, IEEE 802.3ad 프로토콜을 이용하여 동적 Aggregation 작성
     대역폭 상승, 부하 분산, Failover 지원
       mode 5 - blance-tlb(TLB) : 적응형 송신 부하 분산, 송신패킷 로드밸런싱, 송신 시 부하가 낮은 NIC 이용
       mode 6 - blance-alb(ALB) : 적응형 부하 분산, 송수신 패킷 로드 밸런싱, 송수신시 부하가 낮은 NIC를 사용
   
       miimon : 네트워크 인터페이스가 살아있는지 확인하는데 사용, 단위 0.001초, 기본 값은 0, 0으로 설정 시 failover 비활성화


 7. network 수정

  - vi /etc/sysconfig/network

    NETWORKING=yes
    NETWORKING_IPV6=no
    HOSTNAME=자기호스트 이름
    GATEWAYDEV=bond0
    기타 있는 문구는 그냥 둠.


 8. 본딩 모듈 적용

  - #modprobe bonding


 9. 네트워크 서비스 재시작

  - #service network restart


 10. bond0 인터페이스 Master 확인, 나머지 NIC Slave 확인
  - #ifconfig


 11. 물리적 테스트로 확인.


 12. 완료

 

 

리눅스 CPU 사용률 확인 :

top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{print 100-$1}'


리눅스 메모리 사용률 확인 :

top -n1 | grep Mem:


 


리눅스 메모리 점유율 프로세스 TOP 5 조회

ps -eo user,pid,ppid,rss,size,vsize,pmem,pcpu,time,cmd --sort -rss | head -n 6

(6 = TOP 5 + 1 을 해준다)

 

 

방법 1: cpuinfo[편집]

[root@zetawiki ~]# cat /proc/cpuinfo | egrep 'siblings|cpu cores' | head -2
siblings	: 8
cpu cores	: 4
→ siblings가 cpu cores의 2배이므로 하이퍼스레딩 활성된 것임

방법 2: dmidecode #1[편집]

[root@zetawiki ~]# dmidecode -t processor | egrep 'Core Count|Thread Count' | head -2
	Core Count: 4
	Thread Count: 8
→ Thread Count가 Core Count의 2배이므로 하이퍼스레딩 활성된 것임

방법 3: dmidecode #2[편집]

dmidecode -t processor | grep HTT
실행예시 (활성화됨)
[root@zetawiki ~]# dmidecode -t processor | grep HTT | head -1
		HTT (Hyper-threading technology)
실행예시 (비활성화됨)
[root@zetawiki2 ~]# dmidecode -t processor | grep HTT | head -1
                     HTT (Multi-threading)

'IBM PowerLinux' 카테고리의 다른 글

Linux에서 소프트웨어 RAID 구성  (0) 2017.02.21
linux scan device   (0) 2016.10.22
Hot add, remove, rescan of SCSI devices on Linux  (0) 2016.07.27
Linux Monitoring  (0) 2016.05.26
Linux CPU information 정보 확인  (0) 2016.05.26


출처 http://blog.naver.com/xerosda/30174926338


Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

 시작글

이 장에서는 CPU core 수와 정보를 확인 하는 부분입니다.

다만 인텔 하이퍼스레딩의 경우, OS(윈도우, 리눅스 등) 에서는 코어수가 실제 코어 수의 2배로 인식이 되는 경우가 발생합니다.

밑에서 확인 해보도록 하겠습니다.

CPU 모델 확인 하기

[root@localhost ~]# grep "model name" /proc/cpuinfo | tail -1
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz

 CPU 코어 전체 개수

[root@localhost ~]# grep -c processor /proc/cpuinfo
16

-> 가상 CPU 코어수는 16 개, 그러니까 물리적으로 8 코어가 됩니다.

물리 CPU 수

[root@localhost ~]# grep "physical id" /proc/cpuinfo | sort -u | wc -l
1

CPU당 물리 코어 수

[root@localhost ~]# grep "cpu cores" /proc/cpuinfo | tail -1
cpu cores : 8

CPU 정보 전부 확인 하기

[root@localhost ~]# cat /proc/cpuinfo

processor : 15
vendor_id : GenuineIntel
cpu family : 6
model  : 45
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping : 7
cpu MHz  : 1200.000
cache size : 20480 KB
physical id : 0
siblings : 16
core id  : 7
cpu cores : 8
apicid  : 15
initial apicid : 15
fpu  : yes
fpu_exception : yes
cpuid level : 13
wp  : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips : 3999.82
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

 

-> processor 는 0 부터 시작

정리

위에 나온 정보들을 정리하면 아래와 같습니다.

물리 CPU : 1 개

물리 CPU당 물리 코어 수 : 8 core

전체 물리코어 수 : 8 core

전체 가상코어 수 : 16 core


'IBM PowerLinux' 카테고리의 다른 글

Linux에서 소프트웨어 RAID 구성  (0) 2017.02.21
linux scan device   (0) 2016.10.22
Hot add, remove, rescan of SCSI devices on Linux  (0) 2016.07.27
Linux Monitoring  (0) 2016.05.26
Linux CPU 하이퍼쓰레드 HT 기능 확인  (0) 2016.05.26

 

 

 

SAP HANA System Replication on SLES for SAP Applications

 

https://www.suse.com/docrep/documents/wvhlogf37z/sap_hana_system_replication_on_sles_for_sap_applications.pdf

 

 

Current information about SAPHanaSR – the resource agents for SAP HANA system replication

https://www.suse.com/communities/blog/current-information-saphanasr-resource-agents-sap-hana-system-replication/

 

'IBM PowerLinux > SUSE' 카테고리의 다른 글

SUSE 12 root multipath  (0) 2017.08.20
SUSE 12 multipath 설정 후 부팅 안될때  (0) 2017.01.12
Storage Administration Guide  (0) 2016.05.19
multipath  (0) 2016.05.19

'IBM PowerLinux > SUSE' 카테고리의 다른 글

SUSE 12 root multipath  (0) 2017.08.20
SUSE 12 multipath 설정 후 부팅 안될때  (0) 2017.01.12
SAP HANA system  (0) 2016.05.20
multipath  (0) 2016.05.19

 

 node1:/boot # ls -lrt initrd*
-rw-r--r-- 1 root root 6720908 Jul 2 19:29 initrd-3.0.101-63-ppc64
-rw------- 1 root root 8540288 Jul 2 19:30 initrd-3.0.101-63-ppc64-kdump
lrwxrwxrwx 1 root root 23 Jul 2 19:30 initrd -> initrd-3.0.101-63-ppc64

 

 

multipath /boot/initrd~~~ 에 추가 (시스템 부팅시 multipathd 로드)

 

On SLES9 and SLES10 the command to enable multipath is:
# mkinitrd -f mpath

However on SLES11 it is:
# mkinitrd -f multipath

Unfortunately this is not considered in the documentation and manpage shipped with SLES11 DVD.

 

 

/etc/multipath.conf

 

defaults {
               user_friendly_names yes
}


 

자동 실행

# chkconfig multipathd on
# chkconfig boot.multipath on

 

수동 실행

# /etc/init.d/boot.multipath start
# /etc/init.d/multipathd start

 

 

multipath device name alias

 

https://www.suse.com/documentation/sles11/stor_admin/?page=/documentation/sles11/stor_admin/data/bndgyoe.html 

 

 

device rescan

# rescan-scsi-bus.sh

 

multipath restart

# multipath reload

 

SCSI ID 확인
# /lib/udev/scsi_id --whitelisted /dev/sda
SAIX     VDASD          00f9f3a800004c000000014d5aecde11.18

 

 

 

 

'IBM PowerLinux > SUSE' 카테고리의 다른 글

SUSE 12 root multipath  (0) 2017.08.20
SUSE 12 multipath 설정 후 부팅 안될때  (0) 2017.01.12
SAP HANA system  (0) 2016.05.20
Storage Administration Guide  (0) 2016.05.19

+ Recent posts