<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>공부 &#8211; WONIZZ.LOG</title>
	<atom:link href="https://blog.wonizz.com/tag/%EA%B3%B5%EB%B6%80/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.wonizz.com</link>
	<description>DEVELOPMENT &#38; LIFE LOG</description>
	<lastBuildDate>Fri, 21 Aug 2026 15:46:43 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2026/08/wz-siteicon-512.png?fit=32%2C32&#038;ssl=1</url>
	<title>공부 &#8211; WONIZZ.LOG</title>
	<link>https://blog.wonizz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">152411368</site>	<item>
		<title>[DevOps] ELK를 활용한 로그 분석</title>
		<link>https://blog.wonizz.com/2019/10/07/elk-log-anlysis/</link>
					<comments>https://blog.wonizz.com/2019/10/07/elk-log-anlysis/#respond</comments>
		
		<dc:creator><![CDATA[워니]]></dc:creator>
		<pubDate>Mon, 07 Oct 2019 13:59:37 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[도커]]></category>
		<guid isPermaLink="false">http://blog.wonizz.tk/?p=835</guid>

					<description><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
<p>안녕하세요? 정리하는 개발자 워니즈입니다. 이번시간에는 ELK를 활용한 웹서버 로그 분석에 대해서 알아보는 시간을 갖도록 해보겠습니다. 필자가 운영하는 프로젝트에서는 Nginx(IDS &#8211; Internet Detection Server) 와 Apache(웹서버) &#8211; WAS 서버의 구성으로 이루어져있습니다. Apache에서는 whitelist된 URL query string 에 대해서만 캐시를 남기고 그외에는 WAS까지 접속하여 가져오는 구성으로 되어어 있습니다. (식별된 파라미터에 대해서는 캐싱된 페이지를 보여주기 위함 입니다.) 그러다보니,&#8230;&#160;</p>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2019/10/07/elk-log-anlysis/">[DevOps] ELK를 활용한 로그 분석</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
안녕하세요? 정리하는 개발자 워니즈입니다. 이번시간에는 <code>ELK</code>를 활용한 웹서버 로그 분석에 대해서 알아보는 시간을 갖도록 해보겠습니다.

필자가 운영하는 프로젝트에서는 Nginx(IDS &#8211; Internet Detection Server) 와 Apache(웹서버) &#8211; WAS 서버의 구성으로 이루어져있습니다.

Apache에서는 whitelist된 URL query string 에 대해서만 캐시를 남기고 그외에는 WAS까지 접속하여 가져오는 구성으로 되어어 있습니다. (식별된 파라미터에 대해서는 캐싱된 페이지를 보여주기 위함 입니다.)

그러다보니, 비식별된 파라미터들의 접속량이 증가하면 WAS 서버에 부하를 주게 되어 이를 모니터링 할 수 있는 프로세스를 생각해봤습니다.

그러던중 <code>ELK</code>를 알게 되었고, filebeat와 logstash를 적절하게 이용하면 로그분석을 통하여 비식별 파라미터를 추출해 낼 수 있을 것이라고 생각했습니다.

<h1>1. 로그 수집 프로세스</h1>

<img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2019/10/ELK_%EC%95%84%ED%82%A4%ED%85%8D%EC%B2%98.png?w=1200&#038;ssl=1" alt="DevOps ELK를 활용한 로그 분석 설명 이미지 1" />

<ol>
<li>아파치 혹은 Nginx의 access.log에 외부 접근이 생기면 정해진 로그 포맷에 따라 파일이 생성되거나 내용이 추가됩니다.</li>
<li>filbeat는 마치 리눅스의 tail명령어와 같이 지속적으로 파일을 읽어서 로그스태시에게 전달해줍니다. filebeat.yml 파일의 설정 파일로 target 로그스태시 지정이 가능합니다.</li>
<li>logstash에서 input 모듈을 활용하면 beat에서의 내용을 받을 수 있습니다. 반드시 앞에 filebeat가 있어야 되는것이 아니고 로컬의 파일을 읽을 수도 있고, 혹은 외부 json 호출도 가능합니다.</li>
<li>logstash의 강력한 기능중 하나인 filter를 통하여 log파일의 정제 및 reform이 가능합니다.</li>
<li>정제된 내용을 elastic으로 output으로 보내 줍니다.</li>
<li>키바나에서는 elastic의 내용을 표현해줍니다.</li>
</ol>

<h1>2. Docker-elk를 활용한 설치</h1>

지금까지 <code>Docker</code>에 대해서 학습을 해왔기 때문에 Docker로 설치해보고자합니다. 개별제품군으로 설치를 하면 귀찮지만, Docker를 한번에 <code>ELK</code> 스택을 한번에 올릴 수 있어 굉장히 편합니다.

<h2>2-1. docker-elk repository clone</h2>

작업 디렉토리에서 docker-elk git 레포지토리를 clone 합니다.

<pre><code class="line-numbers">$ git clone https://github.com/deviantony/docker-elk#requirements
</code></pre>

<a href="https://github.com/deviantony/docker-elk" target="_blank" rel="noopener">docker-elk</a>

<h2>2-2. configuration</h2>

docker-elk를 clone 받으면 docker-elk 폴더가 생기고 여기서 각 config 폴더 안에 elk에 대한 설정을 해주면됩니다.

<ul>
<li>elasticsearch.yml</li>
<li>logstash.yml / logstash.conf</li>
<li>kibana.yml</li>
</ul>

<h2> </h2>

<h2>2-3. docker-elk 실행</h2>

<pre><code class="line-numbers"># docker-compose.yml이 있는 디렉토리에서 수행해야 한다 
# build 
$ docker-compose build 

# 빌드를 통해 생성된 도커 이미지 확인 
$ docker images 

# up: 컨테이너 생성 및 구동, -d는 백그라운드로 실행 옵션 
$ docker-compose up -d 

# 컨테이너 목록 확인 
$ docker-compose ps 

# 컨테이너 로그 확인 
$ docker-compose logs -f
</code></pre>

컨테이너 목록 확인에 정상적으로 컨테이너 3개(elasticsearch, logstash, kibana)가 보이고, 로그에서도 문제가 없으면 정상적으로 작동된 것이다. 브라우저에서 localhost:5601로 접속하면 kibana 웹 UI 화면이 뜰 것이다.

<h2>2-4. filebeat 설치</h2>

elk에 대한 내용은 설치를 완료했고, 필자 같은 경우, filebeat는 직접 host에 설치를 했습니다.

<ul>
<li>filebeat 설치

filebeat 를 yum을 통해서 설치

<pre><code class="line-numbers">sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
</code></pre>

/etc/yum.repods.d/elastic.repo 추가

<pre><code class="line-numbers">[elastic-6.x]
name=Elastic repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
</code></pre></li>
</ul>

​   <code>yum install filebeat</code>를 통해서 설치를 진행합니다.

<h1>3. 설정</h1>

이제 각 설정을 통해서 연결을 해줍니다.

<h2>3-1. filebeat 설정</h2>

filebeat 에서는 json 형태로 logstash 에게 데이터를 전달하고, 이때 <code>message</code> 필드에 수집한 로그 파일의 데이터가 담겨진다. 수집하려는 log file 의 유형에 따라서 <a href="https://www.elastic.co/guide/en/beats/libbeat/current/community-beats.html" target="_blank" rel="noopener">community beats</a>를 사용할 수도 있지만, 필자의 경우에는 Custom pattern의 로그 파일을 수집할 예정이라 logstash에서 pasring 하는 형태를 선택했다.

<pre><code class="line-numbers">![ELK_로그스태시](http://blog.wonizz.com/wp-content/uploads/2019/10/ELK_로그스태시.png)filebeat.prospectors:

# Each - is a prospector. Most options can be set at the prospector level, so
# you can use different prospectors for various configurations.
# Below are the prospector specific configurations.

- type: log
  enabled: true
  paths:
    - /var/log/my_log_path/*.log
  fields:
    index_name: "my_custom_file_index_name"

#----------Elasticsearch output--------------- 주석처리
# (beats 에서 바로 ES 로 데이터 전달하지 않음)


#----------Logstash output ------------------- 주석해제
# (beats 에서 logstash 로 데이터 전달)

output.logstash:
  # The Logstash hosts
  hosts: ["my-logstash-server-host:5044"]

...
</code></pre>

filebeat는 굉장히 심플하다. 1)target으로 보내주는 파일지정과 2) target에 대한 셋팅만 하면된다. 필자가 처음에 애먹었던 부분은 위에 보이는 것과 같이 elastic으로 바로 전달하면 안되기에 주석처리를 하고 logstash를 열어줘야되는데, logstash에 host만 셋팅하고 안되는 이유를 한참이나 찾았다.

<h2>3-2. logstash 설정</h2>

<ul>
<li>grok, mutate, json, geoip, alter 필터를 설정했고 filebeat 에서 fields 로 넘겨받은 index_name을 사용했다.</li>
<li>date 필터는 기준 시각을 filebeat 에 의해서 파싱된 시각을 사용하지 않고, log 에 기록된 시각으로 지정하도록 한다.</li>
</ul>

<img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2019/10/ELK_%EB%A1%9C%EA%B7%B8%EC%8A%A4%ED%83%9C%EC%8B%9C.png?w=1200&#038;ssl=1" alt="DevOps ELK를 활용한 로그 분석 설명 이미지 2" />

로그스태시의 기본구저는 INPUT, FILTERS, OUTPUT으로 이루어져있습니다.

<pre><code class="line-numbers">input {
...
}


filter {
...
}


output {
...
}
</code></pre>

아래는 필자가 만든 pipeline입니다. 파이프라인 설정을 통해서 비트로부터 넘어온 로그를 정정제하고 elasticsearch로 보내줍니다.

<pre><code class="line-numbers">input {
  beats {
    port => 5044
  }
}
filter {

        grok {
                match => { "message" => "\"(?:%{WORD:verb} %{GREEDYDATA:uri_stem}\?%{GREEDYDATA:uri_query}(?: HTTP/%{NUMBER:httpversion})?|-)\" %{QS:agent}" }
        }
        if "_grokparsefailure" in [tags] {
                drop { }
        }
        mutate {
                gsub => [ "uri_query", "=(?<=\=)(.*?)(?=&#038;|HTTP)", "",
                           "uri_query", "HTTP/1.0", "",
                           "uri_query", "HTTP/1.1", "",
                           "uri_query", "nocache", "",
                           "uri_query", "kkkkk", ""
        ]
                split => { "uri_query" => "&" }
        }
        mutate {
                remove_field => "message"
                remove_field => "verb"
                remove_field => "httpversion"
         }
        date {
                 match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
        }

}
output {
        elasticsearch {
                hosts => ["172.26.0.1:9200"]
                index => "wonizz_nginx"
                user => "elastic"
                password => "changeme"
        }

                stdout { codec => rubydebug }
}
</code></pre>

하나씩 의미를 확인해보겠습니다.

<ul>
<li>input</li>
</ul>

<pre><code class="line-numbers">beats {
    port => 5044
  }
</code></pre>

내용에서 보다시피, filebeat로부터 오는 input에 대한 내용입니다. 기본적으로 5044 tcp 포트로 들어오는 데이터를 수집합니다.

<ul>
<li>filter</li>
</ul>

<pre><code class="line-numbers">grok {
                match => { "message" => "\"(?:%{WORD:verb} %{GREEDYDATA:uri_stem}\?%{GREEDYDATA:uri_query}(?: HTTP/%{NUMBER:httpversion})?|-)\" %{QS:agent}" }
        }
</code></pre>

grok은 넘어오는 input에 대하여 동적으로 mapping하여 각 포맷별로 mapping시켜주는 것입니다. 예를들어 아파치나 nginx의 access.log는 정해진 포맷이 있는데 적절하게 grok 패턴을 사용하면 알아서 매핑을 해주어 쪼개줍니다.

아래의 2가지 웹사이트를 활용하여 필자는 custom되어있는 nginx로그를 매핑할 수 있는 grok 패턴을 만들어 봤습니다.

<a href="https://grokdebug.herokuapp.com/" target="_blank" rel="noopener">grok debugger</a>

<a href="https://grokconstructor.appspot.com/" target="_blank" rel="noopener">grok constructor</a>

<pre><code class="line-numbers">if "_grokparsefailure" in [tags] {
                drop { }
        }
</code></pre>

단순히, grok mapping에 실패하였을 경우, continue 하는 내용입니다.

<pre><code class="line-numbers">mutate {
                gsub => [ "uri_query", "=(?<=\=)(.*?)(?=&#038;|HTTP)", "",
                           "uri_query", "HTTP/1.0", "",
                           "uri_query", "HTTP/1.1", "",
                           "uri_query", "nocache", "",
                           "uri_query", "kkkkk", ""
        ]
                split => { "uri_query" => "&" }
        }
</code></pre>

mutate는 그 의미에서도 알 수 있듯이 변형을 가하는 것입니다.

gsub는 substring을 하는 것이고, split은 쪼개는 것입니다.
위에서 보는 내용은 uri_query로 매핑되어 도출된 내용을 적절하게 substring하여 앰퍼센트(&amp;)로 쪼개는 내용입니다.

예를들어, uri_query string이 &#8220;test=1&amp;test2=2 HTTP/1.1&#8243; 이라고 들어오면 첫줄의 정규식에 의하여 test&amp;test2 HTTP/1.1&#8221; 이 남고 그다음부터는 substring으로 제거해줍니다.

test&amp;test2는 split에 의하여 test, test2로 쪼개어 수집하게 됩니다.

<pre><code class="line-numbers">mutate {
                remove_field => "message"
                remove_field => "verb"
                remove_field => "httpversion"
         }
</code></pre>

불필요한 field에 대해서 삭제 처리합니다.

<ul>
<li>output</li>
</ul>

<pre><code class="line-numbers"> elasticsearch {
                hosts => ["172.26.0.1:9200"]
                index => "wonizz_nginx"
                user => "elastic"
                password => "changeme"
        }

</code></pre>

elasticsearch 로 적절한 index로 넣게 됩니다. 여기서 host 같은 경우는 docker로 올렸기 때문에 해당 호스트이 docker daemon 의 network 를 호출하여 9200포트로 보내줍니다.

<h1>4. elasticsearch 조회</h1>

필자 같은경우는 elasticsearch에 넣고 kibana로 조회를 했지만, 알람을 주기 위해 zabbix를 활용했다.

먼저 nodejs를 활용하여 elastic에서 데이터를 조회합니다.

<pre><code class="line-numbers">var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
  host: 'localhost:9200',
  log: 'trace'
});


client.search({
index: 'wonizz_nginx',
type: '_doc',
body: {
"query": {
    "bool": {
      "must": [
        {
          "range": {
            "@timestamp": {
              "gte": "now-1h/h",
              "lte": "now"
            }
          }
        }
      ]
    }
  },
  "aggs": {
    "group_by_state": {
      "terms": {
        "field": "uri_query.keyword"
        }
     }
  }
}
})
</code></pre>

간단하게 elasticsearch 모듈을 import하여 조회를 손쉽게 할 수 있다.

필자가 하고자 했던것은 <code>1시간 이전</code>의 데이터를 수집한 뒤, <code>aggregation</code>을 이용하여 uri_query에 대해서 group by를 하고자 하는 것입니다.

앞서 이야기했듯이 whitelist되지 않은 parameter가 노출이 되면, 해당 내용을 .log파일로 출력하고, zabbix는 지속적으로 .log파일을 감시하다가 신규 내용이 올라오면, 알람을 주는 구조입니다.

elasticsearch <-> nodejs -> requset_parameter.log 파일 &lt;- zabbix 감시

<h1>5. 마치며&#8230;</h1>

이번시간에는 <code>ELK</code>와 Filebeat를 통해서 로그 수집에 대해서 알아봤습니다. 아직은 기초적인 단계이지만, 잘만 활용하면 전체적인 로그의 모습을 볼 수 있고 또한 access.log같은 경우 패턴도 분석이 가능할 것 같습니다.

<code>ELK</code> 스택에서 제공해주는 로그 패턴 분석으로 알람까지 주는 기능도 좀더 알아봐야될 것 같습니다.

다음이시간에는 Elasticsearch 클러스터 구성에 대해서 알아보는 시간을 갖도록 하겠습니다.
<h2 class="wp-block-heading">함께 보면 좋은 글</h2>
<ul class="wp-block-list"><li><a href="https://blog.wonizz.com/2019/02/26/devops-assign/">DevOps 사전 과제</a></li><li><a href="https://blog.wonizz.com/2019/09/06/aws-ecs/">[AWS] ECS  서비스란?</a></li><li><a href="https://blog.wonizz.com/2019/08/08/ansible-role-include/">[Ansible] 플레이북 Role 과 Include</a></li><li><a href="https://blog.wonizz.com/2019/08/21/kubernetes-service/">[Kubernetes] 쿠버네티스 Service 란?</a></li></ul>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2019/10/07/elk-log-anlysis/">[DevOps] ELK를 활용한 로그 분석</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.wonizz.com/2019/10/07/elk-log-anlysis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">835</post-id>	</item>
		<item>
		<title>[Ansible] 플레이북 Role 과 Include</title>
		<link>https://blog.wonizz.com/2019/08/08/ansible-role-include/</link>
					<comments>https://blog.wonizz.com/2019/08/08/ansible-role-include/#respond</comments>
		
		<dc:creator><![CDATA[워니]]></dc:creator>
		<pubDate>Thu, 08 Aug 2019 05:49:51 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[도커]]></category>
		<guid isPermaLink="false">http://blog.wonizz.tk/?p=723</guid>

					<description><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
<p>안녕하세요? 정리하는 개발자 워니즈입니다. 이번시간에는 Ansible 의 플레북에 대한 이야기를 해보려고 합니다. 필자가 속한 프로젝트에서는 Ansible을 주로 다수의 서버의 configuration 을 수정할 때 사용하고 있습니다. 즉, 1개의 master 파일을 수정하고 각 서버의 경로에 해당 파일로 copy 해주는 단순한 구조입니다. 필자가 있는 프로젝트에서는 다음과 같이 사용합니다 . nginx conf 파일 변경 nginx map 파일 변경 nginx&#8230;&#160;</p>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2019/08/08/ansible-role-include/">[Ansible] 플레이북 Role 과 Include</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
안녕하세요? 정리하는 개발자 워니즈입니다. 이번시간에는 <code>Ansible</code> 의 플레북에 대한 이야기를 해보려고 합니다. 필자가 속한 프로젝트에서는 Ansible을 주로 다수의 서버의 configuration 을 수정할 때 사용하고 있습니다. 즉, 1개의 master 파일을 수정하고 각 서버의 경로에 해당 파일로 copy 해주는 단순한 구조입니다.

<img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2019/08/ANSIBLE_playbook.png?w=1200&#038;ssl=1" alt="ansible playbook" />

필자가 있는 프로젝트에서는 다음과 같이 사용합니다 .

<ul>
<li>nginx conf 파일 변경</li>
<li>nginx map 파일 변경</li>
<li>nginx location 파일 변경</li>
</ul>

다음시간에 <code>nginx</code> conf 구조에 대해서 설명을 하겠지만, 우선 ansible의 가장 효과적인 부분이 다수의 host에서 작업이 가능한 것입니다.

플레이북을 매우 큰 하나의 파일로 작성하는 것도 가능하지만 (초기에 플레이북을 배우면서는 이렇게 하기도 합니다) 점차 플레이북을 재사용하거나 계층적으로 관리할 필요도 생깁니다.

<h2>1. Ansible include</h2>

만약 플레이북의 플레이에 있는 일련의 태스크를 재사용한다고 가정해봅니다. <strong><em>include</em></strong> 를 이용하여 이 작업을 하면 됩니다. 가져온 태스크 목록은 특정 역할(role)을 수행하기에 알맞습니다. 다시한번 강조하면 플레이북은 관리 대상 시스템 그룹에 다양한 역할을 매핑하는 작업입니다.

<pre><code class="line-numbers">---
# possibly saved as tasks/foo.yml

- name: placeholder foo
  command: /bin/foo

- name: placeholder bar
  command: /bin/bar
</code></pre>

<pre><code class="line-numbers">tasks:

  - include: tasks/foo.yml
</code></pre>

분명 위와 아래는 확연히 달라집니다. 같은 내용이더라도, 파일을 <code>include</code>하는 구조가 훨씬 간단해 보입니다.

include 할 때 변수도 포함해서 가져올 수 있습니다. (<em>parameterized include</em> 라고 합니다)

<pre><code class="line-numbers">tasks:
  - include: wordpress.yml wp_user=timmy
  - include: wordpress.yml wp_user=alice
  - include: wordpress.yml wp_user=bob
</code></pre>

버전 1.0 상위부터는 아래와 같이 key, value pair로도 지정이 가능합니다.

<pre><code class="line-numbers">tasks:

  - include: wordpress.yml
    vars:
        wp_user: timmy
        ssh_keys:
          - keys/one.txt
          - keys/two.txt
</code></pre>

<strong><em>include</em></strong>에 작접 패러미터를 전달하던 아니면 <code>vars</code>를 이용하던 상관없습니다.
include 되는 파일에서는

<pre><code class="line-numbers">{{ wp_user }}
</code></pre>

여러개의 하위 플레이북도 <code>include</code> 가 가능합니다.

<pre><code class="line-numbers">- name: this is a play at the top level of a file
  hosts: all
  remote_user: root

  tasks:

  - name: say hi
    tags: foo
    shell: echo "hi..."

- include: load_balancers.yml
- include: webservers.yml
- include: dbservers.yml
</code></pre>

<h2>2. Ansible Role</h2>

버전 1.2 이후

태스크와 핸들러에 관하여 알았으므로 이제는 플레이북을 어떻게 잘 구성하는가를 알아낼 차례입니다. Role을 이용 하면 됩니다. Role은 파일 구조에 따라 vars_files, tasks 와 핸들러 등을 자동으로 로딩하는 것입니다.

처음에 필자는 <code>Role</code>이라는 것 자체가 계정과 역할 이런것일줄 알았는데, 말그대로 어떤 업무 수행단위를 하는지를 Component화 해서 재사용할 수 있도록 하는것으로 보면 될 것 같습니다.

다음과 같은 프로젝트 구조가 되어 있다고 합시다.

<pre><code class="line-numbers">site.yml
webservers.yml
fooservers.yml
roles/
   common/
     files/
     templates/
     tasks/
     handlers/
     vars/
     defaults/
     meta/
   webservers/
     files/
     templates/
     tasks/
     handlers/
     vars/
     defaults/
     meta/
</code></pre>

플레이북에는 다음과 같이 사용합니다.

<pre><code class="line-numbers">---
- hosts: webservers
  roles:
     - common
     - webservers
</code></pre>

다음과 같이 role <code>x</code> 에 대하여 작업이 진행됩니다.

<ul>
<li>만약 <strong>roles/x/tasks/main.yml</strong> 이 존재하면, 그곳에 있는 태스크 들이 플레이에 추가됩니다</li>
<li>만약 <strong>roles/x/handlers/main.yml</strong> 이 존재하면, 그곳에 있는 핸들러 들이 플레이에 추가됩니다</li>
<li>만약 <strong>roles/x/vars/main.yml</strong> 이 존재하면, 그곳에 있는 변수 들이 플레이에 추가됩니다</li>
<li>만약 <strong>roles/x/defaults/main.yml</strong> 이 존재하면, 그곳에 있는 변수 들이 플레이에 추가됩니다</li>
<li>만약 <strong>roles/x/meta/main.yml</strong> 이 존재하면, 그곳에 있는 role 의존성이 role 목록에 추가됩니다 (role 의존성은 아래에 따로 설명합니다)</li>
<li>Role에 있는 다른 어떤 copy, script, template 또는 include task 들은 <strong>role/x/{files,templates,tasks}/</strong> 에 있는 것을 참조합니다.</li>
</ul>

버전 1.4 이후에는 role을 찾기위한 <code>roles_path</code> 설정 변수를 사용할 수 있습니다.

만약 해당 파일이 존재하지 않으면 해당 내용은 무시됩니다. 예를 들어 role을 위한 <strong>vars/</strong> 하위 디렉터리는 없을 수도 있습니다.

<ul>
<li>파라미터 방식</li>
</ul>

<pre><code class="line-numbers">---
- hosts: webservers
  roles:
    - common
    - { role: foo_app_instance, dir: '/opt/a',  app_port: 5000 }
    - { role: foo_app_instance, dir: '/opt/b',  app_port: 5001 }
</code></pre>

<ul>
<li>조건부 방식</li>
</ul>

<pre><code class="line-numbers">---
- hosts: webservers
  roles:
    - { role: some_role, when: "ansible_os_family == 'RedHat'" }
</code></pre>

<ul>
<li>태그방식</li>
</ul>

<pre><code class="line-numbers">---
- hosts: webservers
  roles:
    - { role: foo, tags: ["bar", "baz"] }
</code></pre>

role의 태스크에 있는 이런 tag는 role 안에 단순 정의된 tag를 우선합니다. 만약 만약 특정 role에 있는 여러 task를 부분적으로 사용할 필요가 생긴다면 해당 role을 더 작은 단위로 나눌 필요가 있습니다.

<ul>
<li>순서 지정</li>
</ul>

<pre><code class="line-numbers">---

- hosts: webservers

  pre_tasks:
    - shell: echo 'hello'

  roles:
    - { role: some_role }

  tasks:
    - shell: echo 'still busy'

  post_tasks:
    - shell: echo 'goodbye'
</code></pre>

<h2>3. Ansible Role 예제 분석</h2>

<code>ansible galaxy</code>라는 것을 알게 되어, 처음으로 <code>docker</code> 설치를 한번 해보기 위해서 예제를 다운받았습니다.

<ol>
<li>https://galaxy.ansible.com/geerlingguy/docker 접속</li>
<li>ansible 이 설치된 서버에서 다음을 실행</li>
</ol>

<pre><code class="line-numbers">$ cd /etc/ansible/
$ ansible-galaxy install geerlingguy.docker
</code></pre>

<ol start="3">
<li>roles 폴더 확인</li>
</ol>

<pre><code class="line-numbers">$ cd /etc/ansible/roles
</code></pre>

<pre><code class="line-numbers">defaults/main.yml
handlers/main.yml
LICENSE
meta/main.yml
molecule
README.md
tasks/main.yml
     /docker-1809-shim.yml
     /docker-compose.yml
     /docker-users.yml
     /setup-Debian.yml
     /setup-RedHat.yml
templates/override.conf.j2
</code></pre>

<ol start="4">
<li>실행</li>
</ol>

/etc/ansible 경로에 playbook_docker_test.yml 파일을 생성한뒤, playbook을 실행합니다.

<pre><code class="line-numbers">ansible-playbook playbook_docker_test.yml
</code></pre>

<pre><code class="line-numbers">- hosts: test
  roles:
    - geerlingguy.docker
</code></pre>

<ol start="5">
<li>실행결과 해석</li>
</ol>

<pre><code class="line-numbers">PLAY [test] ************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : include_tasks] *****************************************************************************************************************************************************************************************
included: /etc/ansible/roles/geerlingguy.docker/tasks/setup-RedHat.yml for https_ids_a01

TASK [geerlingguy.docker : Ensure old versions of Docker are not installed.] ******************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Add Docker GPG key.] ***********************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Add Docker repository.] ********************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Configure Docker Edge repo.] ***************************************************************************************************************************************************************************
 [WARNING]: The value 0 (type int) in a string field was converted to u'0' (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.

ok: [https_ids_a01]

TASK [geerlingguy.docker : Configure Docker Test repo.] ***************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : include_tasks] *****************************************************************************************************************************************************************************************
skipping: [https_ids_a01]

TASK [geerlingguy.docker : install the container-selinux rpm from a remote repo] **************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Install Docker.] ***************************************************************************************************************************************************************************************
changed: [https_ids_a01]

TASK [geerlingguy.docker : Ensure containerd service dir exists.] **************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Add shim to ensure Docker can start in all environments.] *******************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Reload systemd daemon if template is changed.] ******************************************************************************************************************************************************************
skipping: [https_ids_a01]

TASK [geerlingguy.docker : Ensure Docker is started and enabled at boot.] ******************************************************************************************************************************************************************
changed: [https_ids_a01]

RUNNING HANDLER [geerlingguy.docker : restart docker] **************************************************************************************************************************************************************************************
changed: [https_ids_a01]

TASK [geerlingguy.docker : include_tasks] **************************************************************************************************************************************************************************************************
included: /etc/ansible/roles/geerlingguy.docker/tasks/docker-compose.yml for https_ids_a01

TASK [geerlingguy.docker : Check current docker-compose version.] **************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : Delete existing docker-compose version if it's different.] ******************************************************************************************************************************************************
skipping: [https_ids_a01]

TASK [geerlingguy.docker : Install Docker Compose (if configured).] ************************************************************************************************************************************************************************
ok: [https_ids_a01]

TASK [geerlingguy.docker : include_tasks] **************************************************************************************************************************************************************************************************
[DEPRECATION WARNING]: evaluating [] as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in
 version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
skipping: [https_ids_a01]

PLAY RECAP *********************************************************************************************************************************************************************************************************************************
https_ids_a01              : ok=16   changed=3    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   
</code></pre>

제일 먼저, 위의 플레이북 실행 결과를 보면, <code>task/main.yml</code>이 실행 됩니다.

<ul>
<li>setup-RedHat.yml

<ul>
<li>도커 설치</li>
</ul></li>
<li>docker-1809-shim.yml

<ul>
<li>도커 정상시작 체크</li>
<li>도커 방화벽 충돌체크</li>
</ul></li>
<li>docker-compose.yml</li>
<li>docker-users.yml</li>
</ul>

Task의 구조는 위와 같고, 각 yml 파일들이 <code>include</code>되면서 수행이 됩니다.

<h2>4. 필자 Ansible 사용예시</h2>

포스트 서두에 말씀드렸듯이, 필자가 사용하는 방법은 nginx configuration 파일들에 대해서 변경해주고 재시작해주는 방식으로 사용하고 있습니다. 여기서 변경할때는 <code>copy</code>를 하게 되는데 nginx의 멱등성에 의거하여 변경점이 없으면, 업데이트를 안하게 됩니다.

<ol>
<li>playbook_nginx_conf.yml</li>
</ol>

<pre><code class="line-numbers">- hosts: "{{ server }}"
  remote_user: idsuser  
  tasks:
  - name: Change Nginx Config file
    become: yes
    become_method: sudo
    template:
      src: /etc/ansible/config/{{server}}/nginx.conf
      dest: /etc/nginx/nginx.conf

  - name: Validate Config file
    become: yes
    become_method: sudo
    command: "nginx -t"
    register: shell_result

  - debug:
      var: shell_result.stderr_lines
</code></pre>

따로 <code>role</code>관리를 안하고 상위에서 보듯이 하나의 playbook으로 작성했습니다.

<ul>
<li>config 파일 변경</li>
<li>config 파일 이상유무 테스트</li>
</ul>

<ol start="2">
<li>playbook_nginx_restart.yml</li>
</ol>

<pre><code class="line-numbers">- hosts: idsqa_a01
  remote_user: idsuser
  tasks:
  - name: Syntax Test  Nginx.conf
    become: yes
    become_method: sudo
    command: "nginx -t"
    register: shell_result

  - debug:
      var: shell_result.stderr_lines

  - name: Restart Nginx
    become: yes
    become_method: sudo
    service: name=nginx state=restarted
    when: '"nginx: configuration file /etc/nginx/nginx.conf test is successful" in shell_result.stderr_lines'

  - name: Check Nginx Status
    become: yes
    become_method: sudo
    shell: service nginx status
    args:
      warn: false
    register: service_status

  - debug:
      var: service_status.stdout_lines

  - name: Check Process Nginx
    become: yes
    become_method: sudo
    shell: 'ps -ef | grep nginx'
    register: process_result

  - debug:
      var: process_result.stdout_lines

</code></pre>

<ul>
<li>config 파일 이상유무 테스트</li>
<li>nginx 재시작</li>
<li>nginx status 체크</li>
<li>nginx process 체크</li>
</ul>

두 개의 파일로 분할해 두었는데, <code>role</code> 로 <code>task</code>를 쪼개고 하나의 job으로 만드는 것도 좋을 것 같습니다.

<h2>5. 마치며..</h2>

오늘은 ansible의 <code>role</code>과 <code>include</code>에 대해서 알아봤습니다. ansible을 필자도 사용은 하지만, 아주 기초적인 수준으로 사용하고 있었다라는 것을 느꼈습니다. 이번기회에 <code>role</code>관리를 좀더 잘해보고, 특히 <code>ansible-galaxy</code>를 통해서 수준높은 <code>role</code> 관리에 대해서 학습을 좀 더 해보도록 하겠습니다.

다음 시간에는 ansible <code>jinja2</code> 에 대해서 알아보는 시간을 갖도록 하겠습니다.

<a href="http://blog.wonizz.com" title="워니즈 블로그">워니즈 블로그</a>
<a href="http://github.com/wonizz" title="워니즈 깃헙" target="_blank" rel="noopener">워니즈 깃헙</a>
<h2 class="wp-block-heading">함께 보면 좋은 글</h2>
<ul class="wp-block-list"><li><a href="https://blog.wonizz.com/2019/07/31/docker-dockerfile/">[Docker] Dockerfile 의 이해</a></li><li><a href="https://blog.wonizz.com/2019/07/29/docker-volume/">[Docker] Volume 의 관리</a></li><li><a href="https://blog.wonizz.com/2019/08/13/docker-compose/">[Docker] Compose 구성과 사용법</a></li><li><a href="https://blog.wonizz.com/2019/07/27/docker-network/">[Docker] 네트워크의 이해</a></li></ul>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2019/08/08/ansible-role-include/">[Ansible] 플레이북 Role 과 Include</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.wonizz.com/2019/08/08/ansible-role-include/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">723</post-id>	</item>
		<item>
		<title>OPIC AL 도전 1편</title>
		<link>https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/</link>
					<comments>https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/#respond</comments>
		
		<dc:creator><![CDATA[워니]]></dc:creator>
		<pubDate>Sat, 03 Nov 2018 08:45:36 +0000</pubDate>
				<category><![CDATA[Certification]]></category>
		<category><![CDATA[AL]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[영어]]></category>
		<category><![CDATA[오픽]]></category>
		<guid isPermaLink="false">http://blog.wonizz.tk/?p=293</guid>

					<description><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
<p>오픽 AL 도전 1편  오픽 시험 도전 수기 입니다. 4번의 시험을 볼 예정이고, 각자 시험마다, 후기를 작성합니다. 오픽 AL에 도전을 해볼까 한다. 오픽 서베이  직장 (사업/회사)  사는곳 ( 배우자와 함께 주택이나 아파트에 거주) 설문(총 12개 이상) 3-1. 영화보기, 공연보기, 콘서트보기 3-2. 공원가기, 캠핑하기, 해변가기 3-3. 카페/커피전문점에가기 3-4. 음악감상하기 3-5. 조깅/걷기/헬스 3-6. 국내여행/해외여행 돌발주제 4-1. 명절&#8230;&#160;</p>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/">OPIC AL 도전 1편</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The standard Lorem Ipsum passage, used since the 1500s<br />
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
<p>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
<p>1914 translation by H. Rackham<br />
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"</p>
<p>Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."</p>
<p>1914 translation by H. Rackham<br />
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."</p>
<h1><span style="background-color: #ffffff;">오픽 AL 도전 1편 </span></h1>

<blockquote>
오픽 시험 도전 수기 입니다. 4번의 시험을 볼 예정이고, 각자 시험마다, 후기를 작성합니다.
</blockquote>

오픽 AL에 도전을 해볼까 한다.

오픽 서베이

<ol>
    <li> 직장 (사업/회사)</li>
    <li> 사는곳 ( 배우자와 함께 주택이나 아파트에 거주)</li>
    <li>설문(총 12개 이상)
3-1. 영화보기, 공연보기, 콘서트보기
3-2. 공원가기, 캠핑하기, 해변가기
3-3. 카페/커피전문점에가기
3-4. 음악감상하기
3-5. 조깅/걷기/헬스
3-6. 국내여행/해외여행</li>
    <li>돌발주제
4-1. 명절
4-2. 교통수단
4-3. 산업
4-4. 지역 축제
4-5. 지형,야외 활동
4-6. 기술
4-7. 재활용</li>
</ol>

독학으로 준비하는 것이고, 우선 기간은 다음과 같이 지정할 예정이다.

<table style="border-collapse: collapse; width: 65.3942%; height: 111px;" border="1">
<tbody>
<tr style="height: 21px;">
<td style="width: 27.8764%; height: 21px;">시험일자</td>
<td style="width: 19.1385%; height: 21px;">지역</td>
<td style="width: 52.985%; height: 21px;">성적</td>
</tr>
<tr style="height: 21px;">
<td style="width: 27.8764%; height: 21px;">18년 11.18(일)</td>
<td style="width: 19.1385%; height: 21px;">인천 부평</td>
<td style="width: 52.985%; height: 21px;">IH</td>
</tr>
<tr style="height: 21px;">
<td style="width: 27.8764%; height: 21px;">18년 12.16(일)</td>
<td style="width: 19.1385%; height: 21px;">인천 부평</td>
<td style="width: 52.985%; height: 21px;">IH</td>
</tr>
<tr style="height: 21px;">
<td style="width: 27.8764%; height: 21px;">19년 01.20(일)</td>
<td style="width: 19.1385%; height: 21px;">인천 부평</td>
<td style="width: 52.985%; height: 21px;">IH</td>
</tr>
<tr style="height: 27px;">
<td style="width: 27.8764%; height: 27px;">19년
01.24(목)</td>
<td style="width: 19.1385%; height: 27px;">델타존</td>
<td style="width: 52.985%; height: 27px;">IH</td>
</tr>
</tbody>
</table>

회사에서 연 2회 무료 시험을 제공하고있어, 계획상으로는 내년 3월 안으로는 AL을 취득하는 것을 목표로 하고있다.

&#8220;사실 운이 좋아 좀더 미리따기를 바라고있다.. 왜냐하면 내년상반기까지는 또다른 자격증 계획이 있기 때문이다.&#8221;

우선 공부 계획은 아래처럼 계획은 초기에 세웠으나, 아직 돌발주제까진 넘어가지 못했고, 이번주까지해서 설문을 최종적으로 끝낼계획이다.

<img data-recalc-dims="1" fetchpriority="high" decoding="async" data-attachment-id="294" data-permalink="https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/caleander/" data-orig-file="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?fit=1609%2C816&amp;ssl=1" data-orig-size="1609,816" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="공부게획" data-image-description="&lt;p&gt;공부게획&lt;/p&gt;
" data-image-caption="&lt;p&gt;공부게획&lt;/p&gt;
" data-large-file="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?fit=1024%2C519&amp;ssl=1" class="size-large wp-image-294" src="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?resize=980%2C497&#038;ssl=1" alt="공부게획" width="980" height="497" srcset="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?resize=1024%2C519&amp;ssl=1 1024w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?resize=300%2C152&amp;ssl=1 300w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?resize=768%2C389&amp;ssl=1 768w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?resize=416%2C211&amp;ssl=1 416w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander.png?w=1609&amp;ssl=1 1609w" sizes="(max-width: 980px) 100vw, 980px" />

현재 글에 이어서, 각 주제별로 내가 사용하는 스크립트를 올릴 예정이다.

대략적으로 20개정도의 스크립트를 2주동안 암기(?) 한것 같다.

<h3><오픽 2주차></h3>

<ol>
    <li> 직장 (사업/회사)</li>
    <li> 사는곳 ( 배우자와 함께 주택이나 아파트에 거주)</li>
    <li>설문(총 12개 이상)
3-1. 영화보기, 공연보기, 콘서트보기
3-2. 공원가기, 캠핑하기, 해변가기
3-3. 카페/커피전문점에가기
3-4. 음악감상하기
3-5. 조깅/걷기/헬스
3-6. 국내여행/해외여행</li>
    <li>돌발주제
4-1. 명절
4-2. 교통수단
4-3. 산업
4-4. 지역 축제
4-5. 지형,야외 활동</li>
</ol>

주저리 주저리 하다 보니, 저위의 주제에 대해서는 대강이라도..이야기할 수는 있을것 같다. 그치만, 오픽이라는게 정해진 포맷이있어서 외운다기보다는,

상황에 맞게 이야기 해야되다보니, 좀더 자연스러운 어휘들과 문장들을 많이 사용할 수 있도록 해야될 것 같다.

5년만인가&#8230;프렌즈 공부한다고 하기만 하다가 이제서야 프렌즈를 보면서 쉐도잉 공부법을 하고있는데 나름 영어 문법보다는 그사람들의 감정에 대해서도 배울수 있는 것같다.

미국인 스럽게(?) 이야기하는 것도 도움이 되는 것 같다. 우선 내가 AL을 맞을 수 있을지는 아직 모르겠지만, 저위의 계획대로 총 4번의 시험안에 따는 것을 목표로 하면되지 않을까 싶다.

<h2>11월 18(일) 시험 후기</h2>

1.자기소개

<ol start="2">
<li>갑작스러운 돌발(?)</li>
</ol>

<ul>
<li>너가 사는곳에 강이나 산이 있니?</li>
</ul>

<ol start="3">
<li>갑작스러운 돌발(?)</li>
</ol>

  &#8211; 직장상사에 대한 이야기 해봐.

<ol start="4">
<li>직장에서 상사와 우연히 만난 이야기</p></li>
<li>직장에서 어려운 문제를 해결한 이야기</p></li>
<li>좋아하는 음악 타입 혹은 음악가 2개 선정 후 비교</p></li>
<li>좋아하는 여행지 해변가 ?</p></li>
<li><p>요즘 시대에 기술이 가미된 프로덕트(?) 소개</p></li>
<li><p>해외여행에서 렌트카 관련 질문 3가지 이상</p></li>
<li><p>렌트카 빌렸는데 면허증 없을때의 대처</p></li>
</ol>

<p>&#8230;..시험본지 일주일만에 젂으려니 기억이 잘 안난다.

우선 2년만에 보는 나름의 첫(?) 시험이라, 다소 긴장도 했고 더듬거리도 한듯하다. 우선 결과를 기다리고 있지만,

큰 기대는 하고 있지 않는다.

다음시험을 준비하면서 추가적인 계획을 세워본다.

<h3><오픽 2차 시험 대비></h3>

1차 시험은 아쉽게도 IH를 획득했다. 나름 첫 시험 치고는 좋은 결과이기는 하나, 어느부분에서 내가 부족했는지를 생각해보아야한다.

우선, 전체 문제에서 버벅거렸던 문제는 돌발 질문이였던것 같다. (1)지형, (2)롤플(렌트카) 여기서 버벅거리고, 다소 말이 안되는 문장을 구사했다고 생각한다. 나머지 설문에 대해서는 제대로 질문을 했고, 문장수도 최소 12문장은 넘었던것 같다.

자, 그럼 롤플 강화를 해야 한다. 오픽 노잼이라는 영상을 기재한다. 이분이 강조하는것은 필러 word!,
<div class="nv-iframe-embed"><iframe class="youtube-player" width="1200" height="675" src="https://www.youtube.com/embed/lzOFxAqb7ds?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=ko-KR&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe></div>

그리고 다음은 2차 계획!

<img data-recalc-dims="1" decoding="async" data-attachment-id="324" data-permalink="https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/caleander2/" data-orig-file="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?fit=1611%2C641&amp;ssl=1" data-orig-size="1611,641" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="공부계획" data-image-description="&lt;p&gt;캘린더&lt;/p&gt;
" data-image-caption="" data-large-file="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?fit=1024%2C407&amp;ssl=1" class="aligncenter size-large wp-image-324" src="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?resize=980%2C390&#038;ssl=1" alt="caleander2" width="980" height="390" srcset="https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?resize=1024%2C407&amp;ssl=1 1024w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?resize=300%2C119&amp;ssl=1 300w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?resize=768%2C306&amp;ssl=1 768w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?resize=416%2C166&amp;ssl=1 416w, https://i0.wp.com/blog.wonizz.com/wp-content/uploads/2018/11/caleander2.png?w=1611&amp;ssl=1 1611w" sizes="(max-width: 980px) 100vw, 980px" />

<ol>
    <li> 직장 (사업/회사)</li>
    <li> 사는곳 ( 배우자와 함께 주택이나 아파트에 거주)</li>
    <li>설문(총 12개 이상)
3-1. 영화보기, 공연보기, 콘서트보기
3-2. 공원가기, 캠핑하기, 해변가기
3-3. 카페/커피전문점에가기
3-4. 음악감상하기
3-5. 조깅/걷기/헬스
3-6. 국내여행/해외여행</li>
    <li>돌발주제
4-1. 명절
4-2. 교통수단
4-3. 산업
4-4. 지역 축제
4-5. 지형,야외 활동</li>
</ol>

<h3><오픽 시험 3차 대비></h3>

2차 시험까지 IH가 나오는거보니, content 면에서는 이상이 없는 것 같다. 발화량도 얼추(30-35분)되는데 뭐가 안되나 생각해보았더니, 발음이나 억양이 문제인것 같다.

speaking에 대해서 익숙치 않다 보니, 읽을때마다 발음이 잘 안되는 것같다.
내용은 돌발 문제에 대해서 마인드맵으로만 생각하고, 나머지 문장에 대해서는 계속해서 반복하려고합니다.

다만, 발음의 문제에 대해서는 프렌즈 통해서 쉐도잉 매일 30분으로 매꿔보려 합니다.
현재 2번의 시험을 더 응시할예정이고, 가능하면 최대한 2월 안으로 취득하려고 합니다.

<h3><오픽 시험 4차 대비></h3>

오픽을 따로 이제 공부한다기보다는 영어를 공부하는 심정으로 준비하고 있다.

매일저녁 끝나고, 30분간 친구와 화상통화로 영어 대화를 하고있다. 아직은 자기 표현이 서툴러 여러가지 문장을 외우는 방식으로 진행하고 있다. 외우는것에는 아무래도 자신이 있다보니, 다양한 문장을 계속해서 반복숙달하고 있다. 그런데 확실히 문제가 새롭게 나오면 준비되지 않은티가 나는것 같아,  다양한 주제에 대해서 브레인 스토밍을 우선적으로 하는것도 좋을것 같다는 생각이 든다.
<h2 class="wp-block-heading">함께 보면 좋은 글</h2>
<ul class="wp-block-list"><li><a href="https://blog.wonizz.com/2020/04/27/certification-aws-solutions-architect-professional/">[자격증] AWS Solutions Architect Professional 취득 후기</a></li><li><a href="https://blog.wonizz.com/2021/05/25/block-chain-1/">[블록체인] 1편 : 블록체인 기본 개념</a></li><li><a href="https://blog.wonizz.com/2019/10/07/elk-log-anlysis/">[DevOps] ELK를 활용한 로그 분석</a></li><li><a href="https://blog.wonizz.com/2019/08/08/ansible-role-include/">[Ansible] 플레이북 Role 과 Include</a></li></ul>
<p>The post <a rel="nofollow" href="https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/">OPIC AL 도전 1편</a> appeared first on <a rel="nofollow" href="https://blog.wonizz.com">WONIZZ.LOG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.wonizz.com/2018/11/03/%ec%98%a4%ed%94%bd-al-%eb%8f%84%ec%a0%84-1%ed%8e%b8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">293</post-id>	</item>
	</channel>
</rss>
