OS
-
haproxy 로깅 설정OS/centos 2022. 11. 4. 09:26
haproxy는 기본으로 로그가 남지 않는다. 추가 설정을 해줘야한다./etc/haproxy/haproxy.cfg global 영역에 log 127.0.0.1 local2 frontend 영역에 log global option httplog ====================== /etc/rsyslog.d/haproxy.conf ----------------------------- $ModLoad imudp $UDPServerRun 514 $template HAproxy,"%msg%\n" local2.=info -/var/log/haproxy.log local2.notice -/var/log/haproxy-status.log local2.* ~ ----------------------..
-
ssh 비밀번호 없이 접속하기OS/centos 2022. 11. 4. 09:22
[접속하는서버] ls -al ~ 경로 .ssh 가 존재하는지 확인, 없다면 만들어주기 mkdir .ssh chmod 700 .ssh ssh-keygen 엔터 엔터 엔터 cd ~/.ssh chmod 600 id_rsa id_rsa.pub ======================== [접속당할서버] ls -al ~ | grep '.ssh' .ssh 존재하는지 확인 없으면 만들기 mkdir .ssh chmod 700 .ssh cd .ssh touch authorized_keys chmod 600 authorized_keys authorized_keys파일에 [접속하는서버]의 id_rsa.pub 공개키 삽입 ========================= 여러 서버를 비밀번호 없이 접속하려면 공개키를 만들어서 추..
-
HAproxy - Keepalived - Apache 설정(수정중)OS/centos 2022. 5. 12. 17:44
수정중 keepalived 설치 VIP : 192.168.202.13 MASTER : 192.168.202.11 BACKUP : 192.168.202.12 yum install -y keepalived vi /etc/sysctl.conf 추가 net.ipv4.ip_forward = 1 net.ipv4.ip_nonlocal_bind = 1 :wq! sysctl -p [MASTER, SLAVE 각각] ============================= vi /etc/keepalived/keepalived.conf global_defs { router_id web01 } vrrp_instance VI_1 { state MASTER interface enp0s8 virtual_router_id 51 prior..
-
NTP서버 구성(chrony) - Master, ClientOS/centos 2022. 5. 2. 13:28
NTP Server Master : 192.168.72.11 ========================================= ========================================= [NTP서버 MASTER] chrony 설치되어있는지 확인 rpm -qa | grep chrony ========================================= timezone 확인 timedatectl status Time zone: 확인하여 Asia/Seoul이 아니면 아래 명령어 실행 timedatectl set-timezone Asia/Seoul ========================================= vi /etc/chrony.conf 주석처리 #server..
-
ansible-playbook 02 tarOS/ansible 2022. 4. 19. 12:52
inventory /etc/ansible/hosts [all:vars] ansible_port=22222 [hosts] 192.168.72.132 #hosts01 192.168.72.133 #hosts02 [apache] 192.168.72.132 [nginx] 192.168.72.133 ========================================================= 파일 세개 만든 후 타르로 묶은 후 각 노드들로 배포 후 압축풀기 [root@localhost ansible]# pwd /etc/ansible touch test1.txt test2.txt test3.txt tar -cvf test.tar test1.txt test2.txt test3.txt tar tvf test.t..
-
ansible-playbook 01 apache(httpd), nginx 설치OS/ansible 2022. 4. 19. 11:23
inventory /etc/ansible/hosts [all:vars] ansible_port=22222 [hosts] 192.168.72.132 #hosts01 192.168.72.133 #hosts02 [apache] 192.168.72.132 [nginx] 192.168.72.133 ==================================================== [ansible-playbook으로 hosts01에 apahce 설치] vi apache-install.yml --- - yml파일 선언 - name: install apache hosts: apache - 호스트 become: yes - 루트권한으로 실행 gather_facts: no - fact수집하지않음으로 앤서블 기능 ..
-
ansible inventory .yaml 작성법OS/ansible 2022. 4. 19. 10:59
ansible 디폴트 인벤토리 파일 지정 - 같은경로의 study.yaml, common.yaml 파일 참조 sudo vi /etc/ansible/ansible.cfg [defaults] inventory =./study.yaml, common.yaml :wq! =============================================================== yaml 파일 작성 방법(들여쓰기 중요) all: hosts: - 미지정그룹 1.1.1.1 children: - 지정그룹 test1: - 그룹명(test1) hosts: - test1그룹의 호스트 jumper1: - 호스트중 하나의 별칭(jumper1) ansible_port: 22222 - jumper1의 ssh접속포트(기본포트22..