HAProxy 를 모르는 분은 없을 정도로 유명한 소프트웨어 L4~L7 로드밸런서 소개입니다.

컨피그 구성 및 사용방법은 대단히 많으나, 체계적인 플로우 이해에 도움이 되는 부분이 많을 것 같아, HAProxy Configure 메뉴얼이 필요할 것 같아 포스팅을 작성합니다.


==================================================

Summary
-------

1.    Quick reminder about HTTP
1.1.      The HTTP transaction model
1.2.      HTTP request
1.2.1.        The request line
1.2.2.        The request headers
1.3.      HTTP response
1.3.1.        The response line
1.3.2.        The response headers

2.    Configuring HAProxy
2.1.      Configuration file format
2.2.      Quoting and escaping
2.3.      Environment variables
2.4.      Time format
2.5.      Examples

3.    Global parameters
3.1.      Process management and security
3.2.      Performance tuning
3.3.      Debugging
3.4.      Userlists
3.5.      Peers
3.6.      Mailers

4.    Proxies
4.1.      Proxy keywords matrix
4.2.      Alphabetically sorted keywords reference

5.    Bind and server options
5.1.      Bind options
5.2.      Server and default-server options
5.3.      Server DNS resolution
5.3.1.      Global overview
5.3.2.      The resolvers section

6.    HTTP header manipulation

7.    Using ACLs and fetching samples
7.1.      ACL basics
7.1.1.      Matching booleans
7.1.2.      Matching integers
7.1.3.      Matching strings
7.1.4.      Matching regular expressions (regexes)
7.1.5.      Matching arbitrary data blocks
7.1.6.      Matching IPv4 and IPv6 addresses
7.2.      Using ACLs to form conditions
7.3.      Fetching samples
7.3.1.        Converters
7.3.2.        Fetching samples from internal states
7.3.3.        Fetching samples at Layer 4
7.3.4.        Fetching samples at Layer 5
7.3.5.        Fetching samples from buffer contents (Layer 6)
7.3.6.        Fetching HTTP samples (Layer 7)
7.4.      Pre-defined ACLs

8.    Logging
8.1.      Log levels
8.2.      Log formats
8.2.1.        Default log format
8.2.2.        TCP log format
8.2.3.        HTTP log format
8.2.4.        Custom log format
8.2.5.        Error log format
8.3.      Advanced logging options
8.3.1.        Disabling logging of external tests
8.3.2.        Logging before waiting for the session to terminate
8.3.3.        Raising log level upon errors
8.3.4.        Disabling logging of successful connections
8.4.      Timing events
8.5.      Session state at disconnection
8.6.      Non-printable characters
8.7.      Capturing HTTP cookies
8.8.      Capturing HTTP headers
8.9.      Examples of logs

9.    Supported filters
9.1.      Trace
9.2.      HTTP compression
9.3.      Stream Processing Offload Engine (SPOE)

10.   Cache
10.1. Limitation
10.2. Setup
10.2.1. Cache section
10.2.2. Proxy section

==================================================

'Linux ( Cent OS )' 카테고리의 다른 글

haproxy.cfg 기본 설정  (7) 2019.06.24
Docker 기본 커맨드 #01 - 컨테이너 생성 및 삭제  (0) 2019.06.11
블로그 이미지

늙은M군

개인 저장공간입니다. 해당 일부 과정들을 공인 인터넷 환경에서 악성적으로 응용할 시 피해가 발생할 수 있으며, 그에 대해 책임은 사용자에게 있습니다!! 주의해주세요.

,

docker 의 Container 는 host ( 로컬콘솔) 의 cgroup 에 따라가는터라

host커널의 systemctl 을 사용하기가 기본적으로는 쉽지가 않아서 커스텀이 필요함.

systemctl 사용가능하도록 패키징된 git 버전을 쓰는게 편하고..


Container 안에서 nfs client 세팅하고 외부의 NFS mount 하는것도 쉽지가 않음

보통 docker run 으로 이미지 생성 시 -v 옵션으로 host에 기 마운트된 NFS Mountpoint 를 그냥 적재시키는 방법을 사용했습니다.



참고로 오래된 예전 자료 정리한거라서.. 더 좋은 방법 있으면 알려주세요 ㅎㅎ 



NFS 마운트하기


1) DOCKER HOST 에서 /mnt 라는 마운트포인트로 외부 NFS 마운트.

( 리모트 NFS 마운트를 위해서는 RPCBIND 실행을 위해 

클라이언트도 nfs-util 패키지를 설치해 주어야 함.. 설치만..  안그러면 알수없는 타입 뜰겁니다. ) 


[root@docker ~]# mount -o nolock 192.168.0.10:/nfs_data /mnt

192.168.0.10:/nfs_data  6.7G  1.7G  5.1G  25% /mnt   // df -h 로 마운트 확인



2) Container 생성 시 -v 옵션으로 HOST 의 NFS Mountpoint 를 같이 적재 하기

# docker run -i -t --name centos_nfs  -v /mnt 4dd69d0e6123


run : container 만들기

-i : interective 

-t : tty 

--name : 컨테이너 이름지정




3) 컨테이너 확인

[root@aec58ea41a6c /]# df -h

Filesystem      Size  Used Avail Use% Mounted on

overlay          13G  2.2G   11G  18% /

tmpfs          1000M     0 1000M   0% /dev

tmpfs          1000M     0 1000M   0% /sys/fs/cgroup

/dev/sda3        13G  2.2G   11G  18% /mnt

shm              64M     0   64M   0% /dev/shm

tmpfs          1000M     0 1000M   0% /proc/acpi

tmpfs          1000M     0 1000M   0% /proc/scsi

tmpfs          1000M     0 1000M   0% /sys/firmware


이 방법의 문제는? -v 옵션으로 적재한 마운트포인트의 추적이 어렵다는 것인데

( #docker volume ls 명령어로 보이지가 않음 ) 


관리를 위해 Volume name 을 지정해서 운용하면 됩니다.

#docker volume NFS

[root@docker /]# docker volume ls

DRIVER              VOLUME NAME

local               NFS


#docker run -i -t --name "test3" -v NFS:/mnt 4dd69d0e6123

Localhost의 /mnt 를 마운트하는 컨테이너를 생성 하라는 커맨드입니다. 



( 계속 ) 




블로그 이미지

늙은M군

개인 저장공간입니다. 해당 일부 과정들을 공인 인터넷 환경에서 악성적으로 응용할 시 피해가 발생할 수 있으며, 그에 대해 책임은 사용자에게 있습니다!! 주의해주세요.

,