자주 쓰는 명령어 위치 상관없이 사용 가능하도록 설정 리눅스를 사용하다 보면 자주 프로그램 명령어를 사용할때 마다 해당 디렉토리 위치로 이동해서 실행해야 하는경우가많다. 이를 편히 사용하기 위해 심볼릭 링크등을 통해 사용할수 있도록 한다.ln -s {원본소스} /usr/local/bin/{파일} ln -s /trident/trident-installer/tridentctl /usr/local/bin/tridentctl 서버/리눅스 2025.06.10
심볼릭 링크(Symbolic Link, Soft Link) 와 하드링크(hard Link) 심볼릭 링크란 : 실제 파일(원본데이터)의 바로가기 형식의 파일로 원본데이터가 손상되면 해당 파일도 엑세스 할수 없음. 다른 inode를 생성함.하드 링크란 : 실제 파일(원본데이터)와 동일한 inode 번호를 부여하여 엑세스 함, 원본 데이터가 손상되더라도 엑세스 가능함.심볼릭 링크(=소프트 링크) 설정 명령어 ln -s 원본파일이름 소프트링크 파일명ln -s original_file.txt softlink_file.txt하드링크 설정 명령어 ln original_file.txt hardlink_file.txt실제 하드링크에서 add World 라는 글을 추가 한 후 다른 파일에서 읽을경우 아래와 같이 동일하게 표시가 됨.원본데이터 삭제 시 (original_file.txt)원본데이터 손상으로 심볼릭.. 서버/리눅스 2025.06.02
zabbix 설치 Red Hat Enterprise Linux release 8.9 (Ootpa)sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-4.el8.noarch.rpmsudo dnf clean alldnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agentdnf install -y @mysqlsystemctl enable --now mysqldmysql_secure_installationVALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. .. 서버 2024.10.31
[리눅스] scsi 볼륨 용량 늘리는 작업 *스토리지에서 볼륨 Resize 후 서버에서 리스캔 및 확장된 볼륨을 다시 파티션을 진행해야 합니다.아래 절차로 진행[root@rhel1 ~]# iscsiadm -m session --rescan[root@rhel1 ~]# for host in /sys/class/scsi_host/host*; do echo "- - -" > $host/scan; done[root@rhel1 ~]# multipath -ll[root@rhel1 ~]# df -h[root@rhel1 ~]# resize2fs /dev/mapper/netappdisk1* 해당 명령어는 포멧방식이 ext4 일경우 'resize2fs' 의 명령어며, 다른 포멧형식은 별도의 명령어 확인이 필요.[root@rhel1 ~]# df -h테스트 환경에서는 .. 서버/리눅스 2024.09.10
[리눅스] lvm 추가 [root@rhel1 mapper]# pvcreate /dev/mapper/mpath4[root@rhel1 mapper]# vgextend vg-data /dev/mapper/mpath4 /dev/mapper/mpath5[root@rhel1 mapper]# lvextend -L +20g /dev/vg-data/database[root@rhel1 mapper]# df -h[root@rhel1 mapper]# xfs_growfs /DB 서버/리눅스 2024.09.06
[리눅스] lvm 생성 lvm 패키지 설치[root@rhel1 ~]# yum install lvm2pv 생성할 mapper 파티션 확인[root@rhel1 ~]# ls /dev/mapper/# 물리적 볼륨(Physical Volume, PV) 생성[root@rhel1 ~]# pvcreate /dev/mapper/mpath0[root@rhel1 ~]# pvcreate /dev/mapper/mpath1 # 볼륨 그룹(Volume Group, VG) 생성[root@rhel1 ~]# vgcreate vg-data /dev/mapper/mpath0 /dev/mapper/mpath1만일 추가로 붙일 파티션이 있다면 다른 명령어로 연결 할 수 있습니다.[root@rhel1 ~]# vgextend vg-data /dev/mapper/mpat.. 서버/리눅스 2024.09.05
[리눅스] multipath alias 설정 [root@rhel1 ~]# systemctl enable multipathd [root@rhel1 ~]# systemctl start multipathd [root@rhel1 ~]# multipath -ll* 3600a0980774f6a34663f58354f2f5355 숫자를 별도로 메모장 같은곳에서 기입[root@rhel1 ~]# vi /etc/multipath.confmultipaths { multipath { wwid 3600a0980774f6a34663f58354f2f5355 alias mpath0 }}해당 문구를 입력해준다. 만일 multipath 볼륨이 많다면 아래와 같이 설정해주면 됩니다.[root@rhel1 ~]# multipath -l.. 서버/리눅스 2024.09.05
open ssh 설정 서버1, Host name : centos1 서버2, Host name : centos2 root@centos1 poc]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): enter Enter passphrase (empty for no passphrase): enter Enter same passphrase again: enter Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key.. 서버/리눅스 2024.02.22
vi 자주 쓰는 명령어 :wq, wq! //변경된 내용을 저장하면서 나오는거 , ! wq가 안될경우 강제로 저장하고 나오는거 :q, q! // 변경된 내용을 저장 안하고 나오는거, ! q로 안될경우 강제로 저장안하고 나오는거 :set number // vi 편집기 좌측 줄번호 표시 a // 편집 (글쓰기 가능) dd // 줄삭제 x // 커서 위치 삭제 (계속업데이트 예정) 서버/리눅스 2024.02.20
리눅스 멀티패스 (multipath.conf) 1) multipath 설치 # yum install *mapper* # multipath -ll //multipath.conf 파일이 없으므로 위와 같은 메시지가 발생 2-1) multipath.conf copy 및 restart # cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/ # systemctl start multipathd.service # multipath -ll 2-2) multipath.conf 파일 생성 # mpathconf --enable # systemctl start multipathd.service //2가지 방법중에 하나를 선택하면 됨. 서버/리눅스 2024.02.20