'2020/12/04'에 해당되는 글 5건

  1. 2020.12.04 pdsh
  2. 2020.12.04 openHPC 설치 part2?
  3. 2020.12.04 bash $$ 변수, 배열, 반복
  4. 2020.12.04 bash 배열
  5. 2020.12.04 find -mmin
Linux2020. 12. 4. 16:12

복수개의 target에 ssh로 접속해서 동일한 명령어로 실행하는 유틸리티

 

Some examples of usage follow:

Run command on foo01,foo02,...,foo05
    pdsh -w foo[01-05] command

Run command on foo7,foo9,foo10
pdsh -w foo[7,9-10] command
Run command on foo0,foo4,foo5
pdsh -w foo[0-5] -x foo[1-3] command

A suffix on the hostname is also supported:
Run command on foo0-eth0,foo1-eth0,foo2-eth0,foo3-eth0
   pdsh -w foo[0-3]-eth0 command

 

[링크 : https://linux.die.net/man/1/pdsh]

[링크 : https://qastack.kr/server/2533/linux-running-the-same-command-on-many-machines-at-once]

'Linux' 카테고리의 다른 글

linux command line에서 mp3 재생하기  (0) 2020.12.08
shuf  (0) 2020.12.08
bash $$ 변수, 배열, 반복  (0) 2020.12.04
bash 배열  (0) 2020.12.04
find -mmin  (0) 2020.12.04
Posted by 구차니
프로그램 사용/openHPC2020. 12. 4. 15:26

virtualbox에서 DHCP 사용 끄고

master node 설정에서 BOOTPROTO=none 으로 해서 static ip로 설정하도록 설정(아래 내용 참고)

[링크 : https://linuxconfig.org/rhel-8-configure-static-ip-address]

# cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export CHROOT=/opt/ohpc/admin/images/centos8.2
export eth_provision=enp0s3
export num_computes=2
export c_ip=("10.0.2.4" "10.0.2.5")
export c_mac=("08:00:27:4b:df:4f" "08:00:27:f9:ca:3f")
export c_name=("openhpc-1" "openhpc-2")
export compute_regex=openhpc-*

export ntp_server=10.0.2.15
export sms_name=master
export sms_ip=10.0.2.15
export sms_eth_internal=enp0s3
export internal_netmask=255.0.0.0

 

Finalizing provisioning configuration

[sms]# wwbootstrap `uname -r`
// /srv 내의 내용이 변경됨
[sms]# wwvnfs --chroot $CHROOT
[sms]# echo "GATEWAYDEV=${eth_provision}" > /tmp/network.$$
[sms]# wwsh -y file import /tmp/network.$$ --name network
[sms]# wwsh -y file set network --path /etc/sysconfig/network --mode=0644 --uid=0
[sms]# for ((i=0; i<$num_computes; i++)) ; do
wwsh -y node new ${c_name[i]} --ipaddr=${c_ip[i]} --hwaddr=${c_mac[i]} -D ${eth_provision}
done
[sms]# wwsh provision set --postnetdown=1 "${compute_regex}"
// 아래 항목이 실행되지 않으면 로그인 계정이 정상적으로 되지 않음
[sms]# wwsh -y provision set "${compute_regex}" --vnfs=centos8.2 --bootstrap=`uname -r` \ --files=dynamic_hosts,passwd,group,shadow,munge.key,network
[sms]# systemctl restart dhcpd
[sms]# wwsh pxe update

 

클라이언트 노드들을 켤 준비를 해준다.

 

전원 on! 하니 오오오

PXE 부팅하는거 첨 보는 느낌인데?!?!? 아무튼 부팅은 성공!

하지만 root 로그인이 안되서 멀 잘못했네 멘붕중 ㅠㅠ

 

/ 는 tmpfs도 되어있어서 아마.. 램디스크 처럼 날아갈 것 같고

이전에 설정되었던 fstab에 의해서 붙긴한데 이제 멀 더 해야 하려나..

# df -h
Filesystem               Size  Used Avail Use% Mounted on
tmpfs                    490M  474M   16M  97% /
devtmpfs                 465M     0  465M   0% /dev
tmpfs                    490M     0  490M   0% /dev/shm
tmpfs                    490M  6.5M  484M   2% /run
tmpfs                    490M     0  490M   0% /sys/fs/cgroup
10.0.2.15:/opt/ohpc/pub  8.0G  3.7G  4.4G  46% /opt/ohpc/pub
10.0.2.15:/home          8.0G  3.7G  4.4G  46% /home
tmpfs                     98M     0   98M   0% /run/user/0

 

 

---

wwsh node new 이후에 node list로 확인

# wwsh node list 
NAME                GROUPS              IPADDR              HWADDR 
================================================================================ 
openhpc-1           UNDEF               10.0.2.4            08:00:27:4b:df:4f 
openhpc-2           UNDEF               10.0.2.5            08:00:27:f9:ca:3f 

# wwsh bootstrap list 
BOOTSTRAP NAME            SIZE (M)      ARCH 
4.18.0-193.el8.x86_64     42.6          x86_64 

 

postnetdown이 멀까...

# wwsh provision set --postnetdown=1 "${compute_regex}" 
Are you sure you want to make the following changes to 2 node(s): 

     SET: POSTNETDOWN          = 1 

Yes/No> y

 

'프로그램 사용 > openHPC' 카테고리의 다른 글

nagios  (0) 2020.12.07
openHPC LBNL NHC  (0) 2020.12.07
warewulf 유틸리티  (0) 2020.12.02
wwsh (warewulf shell)  (0) 2020.12.02
openHPC 설치 part 1?  (2) 2020.12.02
Posted by 구차니
Linux2020. 12. 4. 14:28

 

 

특수 매개 변수(Special Parameters)
문자 설명
$$ 현재 스크립트의 PID
$? 최근에 실행된 명령어, 함수, 스크립트 자식의 종료 상태
$! 최근에 실행한 백그라운드(비동기) 명령의 PID
$- 현재 옵션 플래그
$_ 지난 명령의 마지막 인자로 설정된 특수 변수

[링크 : https://blog.gaerae.com/2015/01/bash-hello-world.html]

 

배열

배열은 콤마가 아니라 공백으로 내용이 구분되어야 한다. 콤마를 넣으면 하나의 값이 들어있는 배열로 인식한다. 주의!!

배열명= ("내용1" "내용2")

[링크 : http://blog.redjini.com/282]

 

for 루프

변수의 제어문에서 존재하지 않는 변수를 사용할 경우 0으로 인식되는게 아니라 에러가 발생하니 주의!!

[링크 : https://skylit.tistory.com/321]

'Linux' 카테고리의 다른 글

shuf  (0) 2020.12.08
pdsh  (0) 2020.12.04
bash 배열  (0) 2020.12.04
find -mmin  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
Posted by 구차니
Linux2020. 12. 4. 12:44

변수명=("내용", "내용", ...)

으로 선언하는데 접근은

${변수명[index]} 로 해야 한다.

 

 

# 빈 배열
EMPTY_LIST=()

PLANETS=( "EARTH" "MARS" "VINUS" )
# ${PLANETS[0]} == "EARTH"
# ${PLANETS[1]} == "MARS"
# ${PLANETS[2]} == "VINUS"

PLACES[0]="HERE"
PLACES[1]="THERE"
PLACES[2]="WHERE"

NAMES=()
NAMES+=("ME")    # ${NAMES[0]} == "ME"
NAMES+=("YOU")   # ${NAMES[1]} == "YOU"
NAMES+=("THEM")  # ${NAMES[2]} == "THEM"

[링크 : https://blog.leocat.kr/notes/2018/02/18/shell-declare-list]

'Linux' 카테고리의 다른 글

pdsh  (0) 2020.12.04
bash $$ 변수, 배열, 반복  (0) 2020.12.04
find -mmin  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
linux page cache  (0) 2020.01.13
Posted by 구차니
Linux2020. 12. 4. 10:28

10분 이내로 수정된 파일 찾기

-mmin -10

 

[링크 : http://bahndal.egloos.com/565007]

'Linux' 카테고리의 다른 글

bash $$ 변수, 배열, 반복  (0) 2020.12.04
bash 배열  (0) 2020.12.04
linux 스토리지 정보  (0) 2020.10.14
linux page cache  (0) 2020.01.13
dmesg 시간 환산하기  (0) 2020.01.07
Posted by 구차니