본문 바로가기

분류 전체보기

(43)
ansible playbook - copy , systemd , inline --copy [root@ansible-server ~]# echo ansible-test > /root/test.txt [root@ansible-server ~]# cat /root/test.txt ansible-test --hosts 파일 확인 [root@ansible-server ~]# vi /etc/ansible/hosts [rockylinux] 200.200.200.147 200.200.200.148 [nginx] 200.200.200.147 200.200.200.148 [root@ansible-server ~]# vi /root/ansible-playbook-test-02.yml --- - name: ansible-playbook-test-02 host..
ansible playbook playbook 규칙 --- : 시작 name : 작업구분이름 (생략가능) hosts : 적용대상 tasks : 적용작업 # : 주석(comment) ... : 종료(생략가능) playbook 실행 play : 시작 TASK [Gathering Facts] : 처음 시작 되는 부분 , 문법 검사 TASK [작업 이름] : 실제로 작업 PLAY RECAP : 작업실행의 결과 - ok, changed, unreachable, failed, skippied, rescued, ignored [root@ansible-server ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/i..
ansible ad-hoc [root@ansible-server ~]# uptime 16:18:24 up 10 min, 2 users, load average: 0.05, 0.10, 0.08 [root@ansible-server ~]# ansible all -m shell -a "uptime" -k SSH password: 200.200.200.148 | CHANGED | rc=0 >> 16:18:59 up 11 min, 3 users, load average: 0.00, 0.03, 0.04 200.200.200.147 | CHANGED | rc=0 >> 16:18:59 up 2 min, 3 users, load average: 0.40, 0.47, 0.20 [root@ansible-server ~]# top [root@ansib..
2tier - service --1tier 실습 원복 [root@mariadbserver ~]# systemctl stop httpd.service [root@mariadbserver ~]# systemctl stop php-fpm.service [root@mariadbserver ~]# dnf -y remove httpd [root@mariadbserver ~]# dnf -y remove php-fpm [root@was ~]# dnf -y install httpd [root@was ~]# dnf -y install httpd php-fpm php-mysqlnd [root@was ~]# vi /etc/php-fpm.d/www.conf 392 security.limit_extensions = .php .php3 .php4 .php5 ..
1tier-service web + was + db가 1개의 서버에 같이 있음 --mariadb server 구성 --database WebTest MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | WebTest | | information_schema | | mysql | | performance_schema | +--------------------+ 4 rows in set (0.002 sec) MariaDB [(none)]> use WebTest; Reading table information for completion of table and column names You can turn off this..
step 3-5 #!/bin/bash #filename : /root/du.sh #디렉터리 절대경로 입력 시 디렉터리 용량 계산하는 du 명령어를 이용하여 sehll script를 작성할 것 echo "====== du를 이용한 디렉토리 용량 확인 ======" echo -n "Input DrectoryPath : ";read dir if [ -d "$dir" ]; then # 'du' 명령어를 사용하여 사용자가 입력한 디렉터리의 용량을 계산 size=$(du -sh "$dir" | cut -f1) echo "${size} /root" else echo "$dir 디렉터리가 존재하지 않습니다." fi --실행 [root@localhost ~]# sh du.sh ====== du를 이용한 디렉토리 용량 확인 ====== ..
DBMS 실습 --mariadb server [root@realserver-02 ~]# dnf -y install mariadb*​ --cli 원복 systemctl set-default graphical.target -- version 확인 [root@realserver-02 ~]# mysql -v Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.5.22-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Reading history-file /root/.my..
haproxy.service 원복 --director [root@localhost ~]# ipvsadm -C [root@localhost ~]# ipvsadm -L IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn [root@localhost ~]# dnf -y remove ipvsadm [root@localhost ~]# sysctl -p net.ipv4.ip_forward = 1 [root@localhost ~]# dnf -y install haproxy [root@localhost ~]# ifconfig ens160:1 172...