[rhel8.4] rpm / yum 명령어
·
OS_Linux&Unix
rpm 텔넷 설치 확인 SFTP로 파일 전송 -ivh 옵션으로 설치 패키지 설치가 되었지만 라이브러리 의존성 문제 발생 패키지 설치는 정상적으로 설치되었지만, 라이브러리 파일이 누락되어 의존성을 충족시키는 것이 필요 만약 telnet 서버인 경우 23번 포트를 열어줘야된다. netstat -antp | grep 텔넷포트 23번 확인 활성화가 안되어있는 것을 알 수 있음 systemctl status telnet.socket 텔넷 상태를 확인 활성화를 시켜줘야함 systemctl start telnet.socket systemctl enable telnet.socket systemctl status telnet.socket 다시 텔넷 포트 확인 telnet 테스트 진행 -qi 옵션으로 패키지 검색 및 정보..
[rhel8.4] sar 명령어
·
OS_Linux&Unix
sar 란 ? - System Activity Report 커맨드 - 현재 사용량 뿐만 아니라, 시스템에 예약작업으로 등록되어 있어서 리소스 사용량을 주기마다 기록/저장하여 이전의 상태와 변화 추이를 확인할 수 있음 - 설치가 안되어있으면 yum install sysstat 패키지 설치하면 됨. 사례 1) 1. 시스템이 메모리를 100% 사용 한 후 reboot 된 상황, 2. sar 데이터를 통해 부하의 원인을 분석 3. sar 데이터는 11:25:04 am을 마지막으로 더 이상 찍히지 않았고, 이후 시스템은 reboot 된 것을 확인 4. sar 데이터 주기 1분 5. OS - rhel 7 $ sar -r kbactive : 프로세스에 의해서, 비교적 최근에 메모리로 로드된 메모리 공간의 크기를 의미..
[rhel8.4] iostat 명령어 및 옵션
·
OS_Linux&Unix
iostat : 시스템의 I/O(입출력) 통계를 보기 위한 유틸리티 중 하나로, CPU 및 DISK의 I/O 통계를 제공하는 커맨드이다. 리눅스에서 국한되어 사용이 가능하며, 리눅스 시스템의 성능 모니터링 및 디스크 사용량 파악에 유용하다. == 옵션내용 -ccpu 사용량 정보 -ddisk 사용량 장보 -k블락 단위에서 킬로바이트로 -m블락 단위에서 메가바이트로 -p파티션 당 통계 포함 -t타임스탬프 출력 -x확장 정보 -z활동 0인 애들 제외 %user : user level에서 CPU가 사용되고 있는 비율 %nice : nice priority를 가진 user level에서 CPU가 사용되고 있는 비율 %system : kernel level에서 CPU가 사용되고 있는 비율 %iowait : I/O ..
[rhel8.4] top 명령어
·
OS_Linux&Unix
top 현재 시스템(OS)의 상태를 나타내줌 - 메모리 사용량, CPU 사용량 등 - top 커맨드를 실행하는 동안 주기적으로 업데이트 가능 요약 영역 - 전체 프로세스가 OS에 대해서 리소스를 어느정도 차지하고 있는지 확인 가능 - 시스템 시간 : GMT 기준 표기 -> timedatectl set-timezone [시간대] 커맨드로 변경 - 유저 : 현재 접속중인 유저 세션 수 - Load Average : CPU Load(CPU가 사용하는 작업의 양)의 이동 평균을 표시 (1분, 5분, 15분에 대한 평균값) - TASK : 현재 프로세스들의 상태를 나타내주는 영역 - CPU : CPU가 어떻게 사용되고 있는지 사용률을 보여주는 영역 us : 프로세스의 유저 영역에서의 CPU 사용률 sy : 프로세..
[rhel8.4] ps 명령어
·
OS_Linux&Unix
ps optionmeaning -a세션 리더와 터미널과 연관이 없는 프로세스를 제외한 모든 프로세스를 출력 aBSD 스타일로 터미널과 연관된 모든 프로세스(다른 유저의 프로세스도) 를 출력하거나, x 옵션과 함께 사용되어 모든 프로세스를 출력 -d세션 리더를 제외한 모든 프로세스들을 출력 r실행 프로세스만 출력 xBSD 스타일로 혼자 사용되면 사용자에 의해 소유된 모든 프로세스 출력하며, a 옵션과 함께 사용되어 모든 프로세스 출력 -l상세 내용을 함께 출력 -e모든 프로세스 출력 -f풀 포맷으로 목록을 출력 -h메뉴 x (PID, TTY, STAT, TIME, CMD 등 -j작업에 관련된 ID 를 출력 u프로세스 실행 user, CPU, memory, usage, 상태 등 출력 f프로세스 간 상속관계를..
[Linux] dmidecode - 서버 하드웨어 및 BIOS 정보 확인
·
OS_Linux&Unix
dmidecode ==1. dmidecode 란 컴퓨터의 메인보드에 있는 DMI(Desktop Management Interface, SMBIOS) 테이블의 정보를 사람이 읽을 수 있는 ASCII 형태로 출력함 = DMI table을 Decoding 해주는 커맨드 2. 용도 및 목적마더보드의 모델 시리얼, 칩셋 정보, 메모리 뱅크 정보, vendor 정보 등 BIOS에서 확인 가능한 하드웨어 정보를 OS 상에서 확인할 수 있게 한다. 하드웨어에 문제가 생겨 파트 정보를 확인하거나 업그레이드 계획을 세울 때 유용하게 사용된다.== 1) 시스템 정보 출력 $ dmidecode | grep -i -A9 "system information" 2) BIOS 정보 출력$ dmidecode | grep -i -..
[rhel8.4] 네트워크 인터페이스 Bonding
·
OS_Linux&Unix
1.Bonding 인터페이스 생성 $ nmcli connection add type bond con-name [connection-name] ifname [interface-name] bond.options "mode=" 2. Bonding 인터페이스 할당 $ mncli connection add type ethernet slave-type bond con-name [connection-name] ifname [interface-name] master [bond-name] 3. Bonding 인터페이스 IP / GW / DNS 주소 할당 $ mncli connection modify [bond interface] ipv4.addresses [address] ipv4.gateway [address] ipv..
[k8s] imperative command
·
DevOps_k8s
kubectl run nginx --image=nginx (deployment) kubectl run nginx --image=nginx --restart=Never (pod) kubectl run nginx --image=nginx --restart=OnFailure (job) kubectl run nginx --image=nginx --restart=OnFailure --schedule"* * * * *" (cronjob) kubectl run nginx --image=nginx \ --restart=Never --port=80 \ --namespace=myname --command -- serviceaccount=mysql --env=HOSTNAME=local \ --labels=bu=instanc..
kubernetes 커맨드 shortcuts
·
DevOps_k8s
po - 파드 rs - 레플리카셋 deploy - 디플로이먼트 svc - 서비스 ns - 네임스페이스 netpol - 네트워크 폴리시 pv - 퍼시스턴트 볼륨 pvc - 퍼시스턴트 볼륨 클레임 sa - 서비스 어카운트 숏컷을 사용해서 시간을 줄여보자
[CKAD] rewrite-target 옵션
·
DevOps_k8s
Different ingress controllers have different options that can be used to customise the way it works. NGINX Ingress controller has many options that can be seen here. I would like to explain one such option that we will use in our labs. The Rewrite target option. Our watch app displays the video streaming webpage at http://:/ Our wear app displays the apparel webpage at http://:/ We must configur..
[CKAD/Lab] Imperative commands
·
DevOps_k8s
Imperative command 예제1) Deploy a redis pod using the redis:alpine image with the labels set to tier=db Either use imperative commands to create the pod with the labels. Or else use imperative commands to generate the pod definition file, then add the labels before creating the pod using the file. $ kubectl run redis --image=redis:alpine --labels tier=db => image 생성 및 label 생성 (kubectl run 명령어를 사..
[CKAD/Lab] - namespace
·
DevOps_k8s
namespace 예제 1) Create a POD in the finance namespace. Use the spec given below. Name: redis Image name: redis $ kubectl get pods --namespace=finance $ kubectl get pods -n=finance => 네임스페이스 finance 내의 pod를 확인하는 커맨드 $ kubectl run redis --image=redis --namespace=finance => 네임스페이스 finance 내에 redis 라는 이름으로 redis를 생성하는 커맨드 예제 2) Access the Blue web application using the link above your terminal!! Fro..
python
·
Dev_Python
c = """ 연관사이트 페이스북"> 블로그"> 유트브"> """ # 키워드 검색 print(c.find("list_sns")) # 키워드를 이용한 스키핑 c = c[167:] # 필요없는 데이터 날리기 print(c) # 태그를 기준으로 쪼개기 c = c.split("") print(c) print("-----------------------------------------------------------") # c[0] 데이터 출력 print(c[0]) # 각 태그에서 usrl만 출력 url = c[0].split('" target')[0] print(url) # 각 태그에서 usrl만 출력 2 url = url.split('href="')[1] print(url) print("------------..
[Python] decorator
·
Dev_Python
# 데코레이터 def decorator_func(original_func): def wrapper_func(*args, **kwargs): # 가변 파라미터를 넣어준다. 파라미터의 갯수가 몇개인지 알 수 없을 때! 연속적인 파라미터를 받을 수 있다. print("{} 함수가 실행되기 전 실행되는 문구".format(original_func.__name__)) return original_func(*args, **kwargs) # 실행한 뒤의 결과값을 출력해야함 return wrapper_func # 실행되지 않은 function 그대로를 출력해야함. @decorator_func # annotation def display_1(): # 앞에 실행되는 로직 print("display_1 함수가 실행되었습니다..
[Python] property 예제
·
Dev_Python
class Person: bag = [] val1 = 123 def __init__(self,val2): self.bag2 = [] self.val2 = [] def put_bag(self, stuff): self.bag.append(stuff) def put_bag2(self, stuff): self.bag2.append(stuff) def minus_val1(self): # self.val1 -= 10 Person.val1 -= 10 def class_method(self): print("클래스 메소드 출력") @staticmethod # 클래스메서드에 접근하는 방식 def class_method(): # 셀프를 지우면 일반적인 호출이 아니라 클래스에서 막바로 매서드를 호출 print("클래스 메소드..
최선을 다하자!
기록