<?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>Moogi&#039;s Craft</title>
	<atom:link href="http://amoogi.azurewebsites.net/feed" rel="self" type="application/rss+xml" />
	<link>http://amoogi.azurewebsites.net</link>
	<description>Programming, IT, Hardware, Software</description>
	<lastBuildDate>Wed, 16 May 2018 04:16:47 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.3</generator>
	<item>
		<title>Windows 10 Ubuntu(Windows Subsystem for Linux)에 docker 설치</title>
		<link>http://amoogi.azurewebsites.net/12618</link>
				<pubDate>Wed, 16 May 2018 04:14:04 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows 10]]></category>
		<category><![CDATA[Windows 10 Linux]]></category>
		<category><![CDATA[Windows Subsystem for Linux]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[도커]]></category>
		<category><![CDATA[리눅스]]></category>
		<category><![CDATA[우분투]]></category>
		<category><![CDATA[원도우 10]]></category>
		<category><![CDATA[원도우 리눅스]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12618</guid>
				<description><![CDATA[Docker를 Windows 10 Ubuntu(Windows Subsystem for Linux)에 설치하는 방법이다. 1. BIOS에서 하드웨어 가상화 옵션을 활성화 한다. 활성화된 가상화는 다음과 같이 확인할 수 있다. 2. Hyper-V 옵션을 체크한다. 3. Windows 10에 Docker를 설치한다. https://www.docker.com/community-edition 4. Windows 10에 설치된 Docker의 설정 중 &#8220;Expose daemon on tcp://localhost:2375 without TLS&#8221;를 체크한다. 5. Windows 10 Ubuntu에 Docker를 설치한다. [crayon-5d86db545e143977151326/] 6. &#8230; <a href="http://amoogi.azurewebsites.net/12618" class="more-link">더 보기<span class="screen-reader-text"> "Windows 10 Ubuntu(Windows Subsystem for Linux)에 docker 설치"</span></a>]]></description>
								<content:encoded><![CDATA[<!-- Easy Plugin for AdSense V8.67 --><!-- [leadin: 2 urCount: 2 urMax: 0] --><div class="ezAdsense adsense adsense-leadin" style="text-align:center;margin:12px;"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Moogi_Craft_Top_Ad_1 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:468px;height:15px"
     data-ad-client="ca-pub-7142891933112649"
     data-ad-slot="7400382192"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div><!-- Easy Plugin for AdSense V8.67 --><p>Docker를 Windows 10 Ubuntu(Windows Subsystem for Linux)에 설치하는 방법이다.</p>
<p>1. BIOS에서 하드웨어 가상화 옵션을 활성화 한다.<br />
활성화된 가상화는 다음과 같이 확인할 수 있다.</p>
<p><a href="http://amoogi.azurewebsites.net/12618/wud1" rel="attachment wp-att-12619"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud1.png" alt="" width="666" height="593" class="alignnone size-full wp-image-12619" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud1.png 666w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud1-150x134.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud1-520x463.png 520w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>2. Hyper-V 옵션을 체크한다.</p>
<p><a href="http://amoogi.azurewebsites.net/12618/wud2" rel="attachment wp-att-12620"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud2.png" alt="" width="423" height="365" class="alignnone size-full wp-image-12620" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud2.png 423w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud2-150x129.png 150w" sizes="(max-width: 423px) 85vw, 423px" /></a></p>
<p>3. Windows 10에 Docker를 설치한다.<br />
https://www.docker.com/community-edition</p>
<p>4. Windows 10에 설치된 Docker의 설정 중 &#8220;Expose daemon on tcp://localhost:2375 without TLS&#8221;를 체크한다.</p>
<p><a href="http://amoogi.azurewebsites.net/12618/wud3" rel="attachment wp-att-12621"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3-800x555.png" alt="" width="800" height="555" class="alignnone size-large wp-image-12621" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3-800x555.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3-150x104.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3-520x361.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3-768x533.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2018/05/wud3.png 834w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>5. Windows 10 Ubuntu에 Docker를 설치한다.</p><pre class="crayon-plain-tag">curl -fsSL https://get.docker.com/ | sudo sh</pre><p></p>
<p>6. .bashrc에 설정 정보를 추가한다.</p><pre class="crayon-plain-tag">export DOCKER_HOST=localhost:2375</pre><p></p>
<p>7. Shell에 반영한다.</p><pre class="crayon-plain-tag">source .bashrc</pre><p></p>
]]></content:encoded>
										</item>
		<item>
		<title>IntelliJ 한글 Reference Card</title>
		<link>http://amoogi.azurewebsites.net/12605</link>
				<pubDate>Tue, 27 Mar 2018 11:56:13 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[IntelliJ]]></category>
		<category><![CDATA[IntelliJ Key Map]]></category>
		<category><![CDATA[IntelliJ Korea]]></category>
		<category><![CDATA[인텔리J]]></category>
		<category><![CDATA[인텔리제이 키매핑]]></category>
		<category><![CDATA[한글 Referece Card]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12605</guid>
				<description><![CDATA[IntelliJ 한글 Reference Card 입니다. 요즘은 개인적으로 IntelliJ 없으면 개발이 안됩니다. IntelliJ 한글 Referece Card]]></description>
								<content:encoded><![CDATA[<p>IntelliJ 한글 Reference Card 입니다.<br />
요즘은 개인적으로 IntelliJ 없으면 개발이 안됩니다.</p>
<p><a href="https://drive.google.com/open?id=1z_H6-7PxLIChJpzghD8idKT7Qv9XA47O" rel="noopener" target="_blank">IntelliJ 한글 Referece Card</a></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[번역] MSA Data Management Pattern: Shared database Context</title>
		<link>http://amoogi.azurewebsites.net/12463</link>
				<pubDate>Wed, 19 Jul 2017 07:18:01 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[MSA]]></category>
		<category><![CDATA[Data Management]]></category>
		<category><![CDATA[Shared database Context]]></category>
		<category><![CDATA[microservice]]></category>
		<category><![CDATA[msa]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12463</guid>
				<description><![CDATA[원본 : http://microservices.io/patterns/data/shared-database.html 1. Problem 가. What&#8217;s the database architecture in a microservices application? 2. Forces 가. 서비스를 느슨하게 결합하여 독립적으로 개발, 배포 및 확장 할 수 있어야 한다. 나. 일부 비즈니스 트랜잭션은 여러 서비스에 걸쳐서 불변값(데이터 무결성?)이 강제 되어야 한다. 예를 들어 &#8220;Place Order&#8221; 유스 케이스는 새로운 주문이 고객의 신용 한도를 초과하지 않는지 확인해야 &#8230; <a href="http://amoogi.azurewebsites.net/12463" class="more-link">더 보기<span class="screen-reader-text"> "[번역] MSA Data Management Pattern: Shared database Context"</span></a>]]></description>
								<content:encoded><![CDATA[<p>원본 : <a href="http://microservices.io/patterns/data/shared-database.html" target="_blank">http://microservices.io/patterns/data/shared-database.html</a></p>
<p><strong>1. Problem</strong></p>
<p>  가. What&#8217;s the database architecture in a microservices application?</p>
<p><strong>2. Forces</strong></p>
<p>  가. 서비스를 느슨하게 결합하여 독립적으로 개발, 배포 및 확장 할 수 있어야 한다.</p>
<p>  나. 일부 비즈니스 트랜잭션은 여러 서비스에 걸쳐서 불변값(데이터 무결성?)이 강제 되어야 한다.<br />
      예를 들어 &#8220;Place Order&#8221; 유스 케이스는 새로운 주문이 고객의 신용 한도를 초과하지 않는지<br />
      확인해야 한다.<br />
      다른 비즈니스 트랜잭션은 여러 서비스가 소유한 데이터를 업데이트 해야 한다.</p>
<p>  다. 일부 비즈니스 트랜잭션은 여러 서비스가 소유하는 데이터를 조회해야 한다.<br />
      예를 들어 &#8220;View Available Credit&#8221;은 고객의 &#8220;creditLimit&#8221;을 알아내거나 미결 주문의 총 금액을<br />
      계산하기 위해 &#8220;Customer&#8221;에게 쿼리해야 한다.</p>
<p>  라. 규모에 맞게 데이터베이스를 복제하고 분류해야 한다.</p>
<p>  마. 서로 다른 서비스에는 서로 다른 데이터 저장 요구 사항이 있다.<br />
      일부 서비스의 경우, 관계형 데이터베이스가 최선의 선택이다.<br />
      다른 서비스에는 복잡하고 구조화되지 않은 데이터를 저장하는 MongoDb와 같은 NoSQL 데이터베이스나<br />
      그래프 데이터를 효율적으로 저장하고 쿼리하도록 설계된 Neo4J가 필요할 수 있다.</p>
<p><strong>3. Solution</strong></p>
<p>  가. 여러 서비스가 공유하는 단일 데이터베이를 사용하면 된다.<br />
      각 서비스는 로컬 ACID 트랜잭션을 사용하여 다른 서비스가 소유한 데이터에 자유롭게 접근 한다.</p>
<p><strong>4. Example</strong></p>
<p>  가. &#8220;OrderService&#8221;와 &#8220;CustomerService&#8221;는 자유롭게 서로의 테이블에 접근할 수 있다.<br />
      예를 들어, &#8220;OrderService&#8221;는 다음 ACID 트랜잭션을 사용하여 새로운 주문이 고객의 신용 한도를<br />
      위반하지 않도록 할 수 있다.</p>
<p></p><pre class="crayon-plain-tag">BEGIN TRANSACTION
…
SELECT ORDER_TOTAL
 FROM ORDERS WHERE CUSTOMER_ID = ?
…
SELECT CREDIT_LIMIT
FROM CUSTOMERS WHERE CUSTOMER_ID = ?
…
INSERT INTO ORDERS …
…
COMMIT TRANSACTION</pre><p></p>
<p>  나. 동일한 고객을 대상으로 동시에 주문을 만들려는 시도가 있을때라도 데이터베이스는 신용 한도를<br />
      초과히지 않도록 보장해 준다.</p>
<p><strong>5. Resulting context</strong></p>
<p>  가. 이 패턴의 장점은 다음과 같다.</p>
<p>    1) 개발자는 친숙하고 쉬운 ACID 트랜잭션을 사용하여 데이터 일관성을 유지한다.</p>
<p>    2) 단일 데이터베이스는 더욱 간단하게 동작한다.</p>
<p>  나. 이 패턴의 단점은 다음과 같다.</p>
<p>    1) 개발 시간 커플링<br />
       예를 들어 개발자는 &#8220;OrderService&#8221; 스키마 변경에 대해 동일한 테이블을 접근하고 있는 다른 서비스의<br />
       개발자들과 협의해야 한다. 이러한 커플링과 협의는 개발 속도를 늦추게 한다.</p>
<p>    2) 런타임 커플링<br />
       모든 서비스가 동일한 데이터베이스에 접근하기 때문에 잠재적으로 서로에게 간섭할 수 있다.<br />
       예를 들어 오랫동안 실행되는 &#8220;CustomerService&#8221; 트랜잭션이 &#8220;ORDER&#8221; 테이블에 대한 lock을<br />
       잡고 있으면, 그동안 &#8220;OrderService&#8221;는 Block될 수 있다.</p>
<p>    3) 단일 데이터베이스는 모든 서비스에 대한 데이터 저장 및 접근 요구 사항을 충족시키지 못할 수 있다.</p>
<p>** ACID 참조 (<a href="https://ko.wikipedia.org/wiki/ACID" target="_blank">https://ko.wikipedia.org/wiki/ACID</a>)</p>
<p>1. ACID</p>
<p>  가. 원자성(Atomicity) : 트랜잭션과 관련된 작업들이 부분적으로 실행되다가 중단되지 않는 것을<br />
      보장하는 능력이다.</p>
<p>  나. 일관성(Consistency) : 트랜잭션이 실행을 성공적으로 완료하면 언제나 일관성 있는 데이터베이스<br />
      상태로 유지하는 것을 의미한다.</p>
<p>  다. 고립성(Isolation) : 트랜잭션을 수행 시 다른 트랜잭션의 연산 작업이 끼어들지 못하도록 보장한다.</p>
<p>  라. 지속성(Durability) : 성공적으로 수행된 트랜잭션은 영원히 반영되어야 한다.</p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[번역] MSA Data Management Pattern: Database per Service Context</title>
		<link>http://amoogi.azurewebsites.net/12443</link>
				<pubDate>Wed, 19 Jul 2017 06:51:18 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[MSA]]></category>
		<category><![CDATA[Data Management]]></category>
		<category><![CDATA[Database per Service Context]]></category>
		<category><![CDATA[microservice]]></category>
		<category><![CDATA[msa]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12443</guid>
				<description><![CDATA[원본 : http://microservices.io/patterns/data/database-per-service.html 1. Problem 가. What&#8217;s the database architecture in a microservices application? 2. Forces 가. 서비스를 느슨하게 결합하여 독립적으로 개발, 배포 및 확장 할 수 있어야 한다. 나. 일부 비즈니스 트랜잭션은 여러 서비스에 걸쳐서 불변값(데이터 무결성?)이 강제 되어야 한다. 예를 들어 &#8220;Place Order&#8221; 유스 케이스는 새로운 주문이 고객의 신용 한도를 초과하지 않는지 확인해야 &#8230; <a href="http://amoogi.azurewebsites.net/12443" class="more-link">더 보기<span class="screen-reader-text"> "[번역] MSA Data Management Pattern: Database per Service Context"</span></a>]]></description>
								<content:encoded><![CDATA[<p>원본 : <a href="http://microservices.io/patterns/data/database-per-service.html" target="_blank">http://microservices.io/patterns/data/database-per-service.html</a></p>
<p><strong>1. Problem</strong></p>
<p>  가. What&#8217;s the database architecture in a microservices application?</p>
<p><strong>2. Forces</strong></p>
<p>  가. 서비스를 느슨하게 결합하여 독립적으로 개발, 배포 및 확장 할 수 있어야 한다.</p>
<p>  나. 일부 비즈니스 트랜잭션은 여러 서비스에 걸쳐서 불변값(데이터 무결성?)이 강제 되어야 한다.<br />
      예를 들어 &#8220;Place Order&#8221; 유스 케이스는 새로운 주문이 고객의 신용 한도를 초과하지 않는지<br />
      확인해야 한다.<br />
      다른 비즈니스 트랜잭션은 여러 서비스가 소유한 데이터를 업데이트 해야 한다.</p>
<p>  다. 일부 비즈니스 트랜잭션은 여러 서비스가 소유하는 데이터를 조회해야 한다.<br />
      예를 들어 &#8220;View Available Credit&#8221;은 고객의 &#8220;creditLimit&#8221;을 알아내거나 미결 주문의 총 금액을<br />
      계산하기 위해 &#8220;Customer&#8221;에게 쿼리해야 한다.</p>
<p>  라. 규모에 맞게 데이터베이스를 복제하고 분류해야 한다.</p>
<p>  마. 서로 다른 서비스에는 서로 다른 데이터 저장 요구 사항이 있다.<br />
      일부 서비스의 경우, 관계형 데이터베이스가 최선의 선택이다.<br />
      다른 서비스에는 복잡하고 구조화되지 않은 데이터를 저장하는 MongoDb와 같은 NoSQL 데이터베이스나<br />
      그래프 데이터를 효율적으로 저장하고 쿼리하도록 설계된 Neo4J가 필요할 수 있다.</p>
<p><strong>3. Solution</strong></p>
<p>  가. 각 마이크로 서비스의 영구 데이터를 해당 서비스에 대해 비공개로 유지하고, API를 통해서만<br />
      처리할 수 있도록 한다.</p>
<p>  나. 서비스의 데이터베이스는 사실상 해당 서비스 구현의 일부이다.<br />
      다른 서비스에서는 직접 액세스 할 수 없다.</p>
<p>  다. 서비스의 영구 데이터를 비공개로 유지하는 몇 가지 다른 방법이 있다.<br />
      각각의 서비스에 대해  데이터베이스 서버를 제공할 필요가 없다.</p>
<p>  라. 관계형 데이터베이스를 사용하는 경우 옵션은 다음과 같다.</p>
<p>    1) 서비스 별 개인 테이블 &#8211; 각 서비스는 해당 서비스에서만 액세스해야 하는 테이블 집합을 소유한다.</p>
<p>    2) 서비스 별 스키마 &#8211; 각 서비스는 해당 서비스에 대해 비공개인 데이터베이스 스키마가 있다.</p>
<p>    3) 서비스 별 데이터베이스 서버 &#8211; 각 서비스는 자체 데이터베이스가 있어야 한다.</p>
<p>  마. &#8220;서비스 별 개인 테이블&#8221;과 &#8220;서비스 별 스키마&#8221;는 아주 낮은 부하를 가진다.<br />
      소유권을 명확하게 해주기 때문에, &#8220;서비스 별 스키마&#8221;를 사용하는 것은 매력적이다.<br />
      일부 높은 처리랑의 서비스는 자체 데이터베이스 서버가 필요하다.</p>
<p>  바. 이 분산을 강제로 적용시키는 장벽을 만드는 것이 좋다.<br />
      예를 들어 각 서비스에 다른 데이터베이스 user id를 할당하고 권한 부여와 같은 데이터베이스<br />
      액세스 제어 메커니즘을 사용할 수 있다.<br />
      캡슐화를 강제하기 위한 장벽이 없으면, 개발자는 서비스의 API를 우회하여 직접 데이터에 액세스하려는<br />
     유혹에 빠지게 된다.</p>
<p><strong>4. Resulting context</strong></p>
<p>  가. 서비스 별 데이터베이스를 사용하면 다음과 같은 장점이 있다.</p>
<p>    1) 서비스가 느슨하게 결합하도록 한다.<br />
       한서비스의 데이터베이스를 변경해도 다른 서비스에는 영향을 미치지 않는다.  </p>
<p>    2) 각 서비스는 요구조건에 가장 적합한 유형의 데이터베이스를 사용할 수 있다.<br />
       예를 들어, 텍스트 검색을 하는 서비스는 ElasticSearch를 사용할 수 있다.<br />
       소셜 그래프를 구현해야 하는 서비스는 Neo4J를 사용할 수 있다.</p>
<p>  나. 서비스 별 데이터베이스를 사용하면 다음과 같은 단점이 있다.<br />
    1) 여러 서비스에 걸쳐 있는 비즈니스 트랜잭션을 구현하는 것이 쉽지 않다.<br />
       분산 된 트랜잭션은 CAP 이론에 의하면 피해야 한다.<br />
       또한 많은 현대적인 NoSQL 데이터베이스는 분산 트랜잭션을 지원하지 않는다.<br />
       최상의 솔류션은 &#8220;일관성 있는 이벤트  중심 아키텍쳐&#8221;를 사용하는 것이다.<br />
       서비스는 데이트를 업데이트 할 때 이벤트를 발행한다.<br />
       다른 서비스는 이벤트를 구독하고 이에 대한 응답으로 데이터를 업데이트 한다.</p>
<p>    2) 여러 데이터베이스에 있는 데이터를 조인하는 쿼리를 만드는 것은 쉽지 않다. 다음과 같은 다양한<br />
       솔류션들이 있다.</p>
<p>      가) 애플리케이션 측 조인<br />
          애플리케이션이 데이터베이스 대신 조인을 수행한다.<br />
          예를 들어 서비스(또는 API 게이트웨이)는 먼저 고객 서비스에서 고객을 검색 한 다음<br />
          주문 서비스를 쿼리하여 고객의 가장 최근 주문을 반환함으로써 고객 및 주문을 검색 할 수 있다.</p>
<p>      나) 명령 쿼리 책임 분리 (CQRS : Command Query Responsibility Segregation)<br />
          여러 서비스의 데이터가 포함 된 한나 이상의 구체화된 뷰를 유지 관리한다.<br />
          뷰는 데이터를 업데이트 하는 서비스가 게시하는 이벤트를 구독하는 서비스에 의해 유지된다.<br />
          예를 들어 온라인 상점은 고객 및 주문을 결합하는 뷰를 유지 관리하여,<br />
          특정 지역 및 최근 주문의 고객을 찾는 쿼리를 구현할 수 있다.<br />
          이 뷰는 고객 및 주문 이벤트를 구독하는 서비스에 의해 업데이트 된다.</p>
<p>      다) 복수의 SQL과 NoSQL 데이터베이스 관리의 복잡도      </p>
<p>** CAP 참조 (<a href="http://wiki.nex32.net/%EC%9A%A9%EC%96%B4/cap%EC%A0%95%EB%A6%AC" target="_blank">http://wiki.nex32.net/%EC%9A%A9%EC%96%B4/cap%EC%A0%95%EB%A6%AC</a>)</p>
<p>1. CAP</p>
<p>  가. 일관성(Consistency) : 각각의 사용자가 같은 데이터를 볼 수 있다.<br />
      (분산 시스템: 모든 노드가 같은 시간에 같은 데이터를 보여 줘야 한다.)</p>
<p>  나. 가용성(Avaliability) : 모든 사용자가 항상 읽고 쓸 수 있다.<br />
      (분산 시스템: 몇몇 노드가 다운되어도 다른 노드들에게 영향을 주지 않아야 한다.)</p>
<p>  다. 분단가용성 (Partition Tolerance) : 물리적으로 분리된 분산 환경에서도 작동한다.<br />
      (분산 시스템: 일부 메시지를 손실하더라도 시스템은 정상 동작을 해야 한다.)</p>
<p>2. 분산 시스템에서 CAP의 세가지 특성을 동시에 충족시키는 것은 불가능하다.</p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Azure] CentOS 7 에서 Mongodb (Version 3.4) 설치</title>
		<link>http://amoogi.azurewebsites.net/12361</link>
				<pubDate>Mon, 03 Jul 2017 05:10:34 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[CentOS 7]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[mongo]]></category>
		<category><![CDATA[몽고DB]]></category>
		<category><![CDATA[몽고디비]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12361</guid>
				<description><![CDATA[CentOS 7 에서 Mongodb를 설치해 보겠다. 참조 : https://docs.mongodb.com/master/tutorial/install-mongodb-on-amazon/?_ga=2.108279303.465376522.1498783244-1021359696.1498783244 1. yum repository에 Mongodb 저장소를 추가한다. [crayon-5d86db54652ec557289555/] 2. mongodb-org-3.4.repo에 아래 내용을 저장한다. [crayon-5d86db54652fd032083135/] 3. yum 자동 업데이트를 방지하기 위해, /etc/yum.conf 에 아래 내용을 추가한다. [crayon-5d86db546530a446592446/] 4. Mongodb를 설치한다. [crayon-5d86db5465315990127805/] 5. Selinux를 사용하는지 확인한다. [crayon-5d86db5465321938362928/] 6. 사용하고 있다면, Selinux를 disabled 시킨다. (Azure에서는 포트 추가보다 disabled 권장) [crayon-5d86db546532d793125569/] &#8230; <a href="http://amoogi.azurewebsites.net/12361" class="more-link">더 보기<span class="screen-reader-text"> "[Azure] CentOS 7 에서 Mongodb (Version 3.4) 설치"</span></a>]]></description>
								<content:encoded><![CDATA[<p>CentOS 7 에서 Mongodb를 설치해 보겠다.<br />
참조 : https://docs.mongodb.com/master/tutorial/install-mongodb-on-amazon/?_ga=2.108279303.465376522.1498783244-1021359696.1498783244</p>
<p>1. yum repository에 Mongodb 저장소를 추가한다.</p>
<p></p><pre class="crayon-plain-tag"># vi /etc/yum.repos.d/mongodb-org-3.4.repo</pre><p></p>
<p>2. mongodb-org-3.4.repo에 아래 내용을 저장한다.</p><pre class="crayon-plain-tag">[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc</pre><p></p>
<p>3. yum 자동 업데이트를 방지하기 위해, /etc/yum.conf 에 아래 내용을 추가한다.</p><pre class="crayon-plain-tag">exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools</pre><p></p>
<p>4. Mongodb를 설치한다.</p><pre class="crayon-plain-tag"># yum install -y mongodb-org</pre><p></p>
<p>5. Selinux를 사용하는지 확인한다.</p><pre class="crayon-plain-tag"># sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28</pre><p></p>
<p>6. 사용하고 있다면, Selinux를 disabled 시킨다. (Azure에서는 포트 추가보다 disabled 권장)</p><pre class="crayon-plain-tag"># vi /etc/selinux/config
SELINUX=disabled</pre><p></p>
<p>7. 리부팅한다.</p>
<p>8. Azure Portal에서 연결된 네트워크 보안 그룹에서 접속할 MongoDB의 포트를 허용한다.<br />
&#8211; Azure Portal 접속<br />
&#8211; 리소스 -> 네트워크 보안 그룹 선택<br />
&#8211; 인바운드 보안 규칙에 &#8220;27017&#8221;포트 허용<br />
<a href="http://amoogi.azurewebsites.net/12361/mongo_nsg1" rel="attachment wp-att-12363"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/07/mongo_nsg1.png" alt="" width="753" height="60" class="alignnone size-full wp-image-12363" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/07/mongo_nsg1.png 753w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/07/mongo_nsg1-150x12.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/07/mongo_nsg1-520x41.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/07/mongo_nsg1-660x53.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>9. 시작프로그램에 Mongodb를 등록한다.</p><pre class="crayon-plain-tag"># sudo systemctl enabled mongod
# sudo systemctl start mongod</pre><p></p>
<p>10. Mongodb를 실행해 본다.</p><pre class="crayon-plain-tag"># sudo service mongod start (stop/start/restart)</pre><p></p>
<p>11. mongo sehll로 Mongodb에 접속한다.</p><pre class="crayon-plain-tag"># mongo --port 27017</pre><p></p>
<p>12. 관리자를 생성한다.</p><pre class="crayon-plain-tag">> use admin
switched to db admin
> db.createUser(
... {
... user: "m_admin",
... pwd: "m_admin075",
... roles: [{role: "userAdminAnyDatabase", db: "admin"}]
... }
... )
Successfully added user: {
        "user" : "m_admin",
        "roles" : [
                {
                        "role" : "userAdminAnyDatabase",
                        "db" : "admin"
                }
        ]
}</pre><p></p>
<p>13. 사용할 DB를 만들고, 접속할 사용자를 생성한다.</p><pre class="crayon-plain-tag">> db.createUser(
... {
... user: "tester",
... pwd: "tester074",
... roles: [
... {role: "readWrite", db: "test"}
... ]
... }
... )
Successfully added user: {
        "user" : "tester",
        "roles" : [
                {
                        "role" : "readWrite",
                        "db" : "test"
                }
        ]
}</pre><p></p>
<p>14. 외부 서버나 클라이언트에서 접근 가능 하도록 설정한다.</p><pre class="crayon-plain-tag"># vi /etc/mongod.conf
=========
net:
  port: 27017
  #bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.


security:
  authorization: enabled</pre><p></p>
<p>15. Mongodb를 재시작 한다.</p><pre class="crayon-plain-tag"># sudo service mongod restart</pre><p></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Jetbrains Plugin] Java Stream Debugger</title>
		<link>http://amoogi.azurewebsites.net/12271</link>
				<pubDate>Tue, 13 Jun 2017 08:10:11 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[IntelliJ]]></category>
		<category><![CDATA[Java Stream Debugger]]></category>
		<category><![CDATA[JetBrains]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Stream]]></category>
		<category><![CDATA[스트림]]></category>
		<category><![CDATA[인텔리J]]></category>
		<category><![CDATA[자바 1.8]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12271</guid>
				<description><![CDATA[Java 1.8이 나오면서 관심 받는 기능중에 Stream이 있다. Stream을 이용하면 컬렉션 데이터를 쉽게 다룰 수 있다. 다만 중간 연산에 대한 디버깅이 힘든면이 있다. Stream에 대한 디버깅을 쉽게 하기 위해, Jetbrains에서는 Java Stream Debugger Plugin을 제공한다. 다음과 같이 설치하고 사용하면 된다. 1. Plugins -> Browse repositories&#8230;를 선택한다. 2. 검색에서 &#8220;Java Stream Debugger&#8221;를 찾는다. 3. install을 선택하고, &#8230; <a href="http://amoogi.azurewebsites.net/12271" class="more-link">더 보기<span class="screen-reader-text"> "[Jetbrains Plugin] Java Stream Debugger"</span></a>]]></description>
								<content:encoded><![CDATA[<p>Java 1.8이 나오면서 관심 받는 기능중에 Stream이 있다.<br />
Stream을 이용하면 컬렉션 데이터를 쉽게 다룰 수 있다.<br />
다만 중간 연산에 대한 디버깅이 힘든면이 있다.<br />
Stream에 대한 디버깅을 쉽게 하기 위해, Jetbrains에서는 Java Stream Debugger Plugin을 제공한다.</p>
<p>다음과 같이 설치하고 사용하면 된다.</p>
<p>1. Plugins -> Browse repositories&#8230;를 선택한다.</p>
<p>2. 검색에서 &#8220;Java Stream Debugger&#8221;를 찾는다.<br />
<a href="http://amoogi.azurewebsites.net/12271/jsd1" rel="attachment wp-att-12281"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1.png" alt="" width="810" height="703" class="alignnone size-full wp-image-12281" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1.png 810w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1-150x130.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1-520x451.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1-768x667.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1-800x694.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd1-660x573.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>3. install을 선택하고, Restart Intellij IDEA를 선택한다.</p>
<p>4. Debug Mode로 실행 후 확인할 Stream Code에 Debug Point를 지정한다.<br />
<a href="http://amoogi.azurewebsites.net/12271/jsd2" rel="attachment wp-att-12291"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2.png" alt="" width="743" height="523" class="alignnone size-full wp-image-12291" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2.png 743w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2-150x106.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2-520x366.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2-660x465.png 660w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd2-200x140.png 200w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>5. Debugger Menu에서 Trace Current Stream Chain(ALT + O)을 선택한다.<br />
<a href="http://amoogi.azurewebsites.net/12271/jsd3" rel="attachment wp-att-12301"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3.png" alt="" width="886" height="468" class="alignnone size-full wp-image-12301" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3.png 886w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3-150x79.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3-520x275.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3-768x406.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3-800x423.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd3-660x349.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>6. &#8220;Split Mode&#8221;로 컬렉션 데이터 변화를 확인한다.<br />
&#8220;Flat Mode&#8221;로 보려면 밑의 &#8220;Flat Mode&#8221;를 선택한다.<br />
<a href="http://amoogi.azurewebsites.net/12271/jsd4" rel="attachment wp-att-12311"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4.png" alt="" width="1090" height="582" class="alignnone size-full wp-image-12311" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4.png 1090w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4-150x80.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4-520x278.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4-768x410.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4-800x427.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd4-660x352.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>7. &#8220;Flat Mode&#8221;로 컬렉션 데이터 변화를 확인하다.<br />
&#8220;Split Mode&#8221;로 보려면 밑의 &#8220;Split Mode&#8221;를 선택한다.<br />
<a href="http://amoogi.azurewebsites.net/12271/jsd5" rel="attachment wp-att-12321"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5.png" alt="" width="1087" height="559" class="alignnone size-full wp-image-12321" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5.png 1087w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5-150x77.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5-520x267.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5-768x395.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5-800x411.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/06/jsd5-660x339.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Azure] VM Tomcat기반 Jenkins 설치</title>
		<link>http://amoogi.azurewebsites.net/12221</link>
				<pubDate>Thu, 12 Jan 2017 10:59:06 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[CentOS 7.3]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Tomcat Jenkins]]></category>
		<category><![CDATA[VM]]></category>
		<category><![CDATA[azure]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12221</guid>
				<description><![CDATA[* Tomcat 설치 : http://amoogi.azurewebsites.net/12051 참조 * &#8230;$ : Terminal Prompt 1. https://jenkins.io/index.html 에서 최신 jenkins war 링크 주소를 복사한다. 2. jenkins war를 다운로드 받는다. [crayon-5d86db5467525169749310/] 3. 다운로드 받은 war를 tomcat 폴더의 webapps에 복사한다. [crayon-5d86db5467538936537596/] 4. http://~/jenkins 에 접속한 후 확인한다. jenkins에 지시하는 대로 설정하면, 다음과 같은 화면을 볼 수 있다.]]></description>
								<content:encoded><![CDATA[<p>* Tomcat 설치 : http://amoogi.azurewebsites.net/12051 참조<br />
* &#8230;$ : Terminal Prompt</p>
<p><strong>1. https://jenkins.io/index.html 에서 최신 jenkins war 링크 주소를 복사한다.</strong></p>
<p><strong>2. jenkins war를 다운로드 받는다.</strong></p><pre class="crayon-plain-tag">...$ wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war

--2017-01-12 10:23:57--  http://mirrors.jenkins.io/war-stable/latest/jenkins.war
Resolving mirrors.jenkins.io (mirrors.jenkins.io)... 52.202.51.185
Connecting to mirrors.jenkins.io (mirrors.jenkins.io)|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://ftp-chi.osuosl.org/pub/jenkins/war-stable/2.32.1/jenkins.war [following]
--2017-01-12 10:24:03--  http://ftp-chi.osuosl.org/pub/jenkins/war-stable/2.32.1/jenkins.war
Resolving ftp-chi.osuosl.org (ftp-chi.osuosl.org)... 64.50.236.52, 2600:3402:200:227::2
Connecting to ftp-chi.osuosl.org (ftp-chi.osuosl.org)|64.50.236.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 70146512 (67M) [application/x-java-archive]
Saving to: ‘jenkins.war’

100%[===============================================================================>] 70,146,512  7.97MB/s   in 9.7s

2017-01-12 10:24:13 (6.86 MB/s) - ‘jenkins.war’ saved [70146512/70146512]</pre><p></p>
<p><strong>3. 다운로드 받은 war를 tomcat 폴더의 webapps에 복사한다.</strong></p><pre class="crayon-plain-tag">...$ sudo cp jenkins.war /opt/tomcat/webapps</pre><p></p>
<p><strong>4. http://~/jenkins 에 접속한 후 확인한다.</strong><br />
jenkins에 지시하는 대로 설정하면, 다음과 같은 화면을 볼 수 있다.</p>
<p><a href="http://amoogi.azurewebsites.net/12221/jenkins2" rel="attachment wp-att-12231"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2.png" alt="" width="1275" height="506" class="alignnone size-full wp-image-12231" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2.png 1275w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2-150x60.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2-520x206.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2-768x305.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2-800x317.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/jenkins2-660x262.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Azure] VM Nginx+Tomcat8 연동</title>
		<link>http://amoogi.azurewebsites.net/12171</link>
				<pubDate>Thu, 12 Jan 2017 06:30:01 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[CentOS7.3]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Tomcat Nginx 연동]]></category>
		<category><![CDATA[Tomcat8]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12171</guid>
				<description><![CDATA[* Nginx 설치 : http://amoogi.azurewebsites.net/11861 참조 * Tomcat 설치 : http://amoogi.azurewebsites.net/12051 참조 * &#8230;$ : Terminal Prompt 1. Nginx config을 생성한다. [crayon-5d86db5468166153378162/] 2. Nginx config을 수정한다. [crayon-5d86db5468177227338614/] 3. 추가된 Nginx config을 반영한다. [crayon-5d86db5468184875227222/] 4. 80포트로 접속한 후 결과를 확인한다. 5. Error 페이지가 보일 경우, Error Log를 확인한다. Error Log에 다음과 같은 에러가 보인다면, Nginx에서 Network(당연히 &#8230; <a href="http://amoogi.azurewebsites.net/12171" class="more-link">더 보기<span class="screen-reader-text"> "[Azure] VM Nginx+Tomcat8 연동"</span></a>]]></description>
								<content:encoded><![CDATA[<p>* Nginx 설치 : <a href="http://amoogi.azurewebsites.net/11861" target="_blank">http://amoogi.azurewebsites.net/11861</a> 참조<br />
* Tomcat 설치 : <a href="http://amoogi.azurewebsites.net/12051" target="_blank">http://amoogi.azurewebsites.net/12051</a> 참조<br />
* &#8230;$ : Terminal Prompt</p>
<p><strong>1. Nginx config을 생성한다.</strong></p><pre class="crayon-plain-tag">...$ sudo su -
...$ cd /etc/nginx/conf.d
# 신규 설정 파일을 생성한다.
...$ cp default.conf tomcat.conf
# default.conf를 백업한다.
...$ mv default.conf default.conf.bak</pre><p></p>
<p><strong>2. Nginx config을 수정한다.</strong></p><pre class="crayon-plain-tag">...$ vi tomcat.conf

#tomcat.conf
server {
    listen       80;
    location / {
      # 80포트로 접속한 경우 로컬 8080 포트로 넘김
      proxy_pass         http://localhost:8080;

      # 넘겨받을 때의 버전을 지정
      proxy_http_version 1.1;

      # 넘겨받을 때의 헤더 정보를 지정
      # 호스트 명
      proxy_set_header   Host $host;
      # 클라이언트가 Host 헤더로 넘기는 오리지널 호스트명
      proxy_set_header   X_Forwarded-Host $host;      
      # 프록시 서버의 호스트명
      proxy_set_header   X-Forwarded-Server $host;
      # proxy 서버의 IP가 아닌, 실제 클라이언트이 IP정보
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      # proxy 에서 요청할때 사용하는 프로토콜 정보 (http or https)
      proxy_set_header   X-Forwarded-Proto $scheme;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

# tomcat이 여러대로 구성되어 있으면, upstream 정보로 서버 ip를 나열하고 proxy_pass로 upstream 정보를 입력하면 된다.
# 한대인 경우에 사용해도 문제는 없다.
#tomcat.conf
upstream backend {
    # ip 나열...
    server localhost:8080;
}

server {
    listen       80;
    location / {
      proxy_pass         http://backend;
      proxy_http_version 1.1;
      proxy_set_header   Host $host;
      proxy_set_header   X_Forwarded-Host $host;
      proxy_set_header   X-Forwarded-Server $host;
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header   X-Forwarded-Proto $scheme;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}


server {
    listen       80;
    location / {
      # 80포트로 접속한 경우 로컬 8080 포트로 넘김
      proxy_pass         http://localhost:8080;

      # 넘겨받을 때의 버전을 지정
      proxy_http_version 1.1;

      # 넘겨받을 때의 헤더 정보를 지정
      # 호스트 명
      proxy_set_header   Host $host;
      # 클라이언트가 Host 헤더로 넘기는 오리지널 호스트명
      proxy_set_header   X_Forwarded-Host $host;      
      # 프록시 서버의 호스트명
      proxy_set_header   X-Forwarded-Server $host;
      # proxy 서버의 IP가 아닌, 실제 클라이언트이 IP정보
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      # proxy 에서 요청할때 사용하는 프로토콜 정보 (http or https)
      proxy_set_header   X-Forwarded-Proto $scheme;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}</pre><p></p>
<p><strong>3. 추가된 Nginx config을 반영한다.</strong></p><pre class="crayon-plain-tag">...$ service nginx reload</pre><p></p>
<p><strong>4. 80포트로 접속한 후 결과를 확인한다. </strong><br />
<a href="http://amoogi.azurewebsites.net/12051/tomcat1" rel="attachment wp-att-12121"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1.png" alt="" width="1519" height="1409" class="alignnone size-full wp-image-12121" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1.png 1519w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-150x139.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-520x482.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-768x712.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-800x742.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-660x612.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p><strong>5. Error 페이지가 보일 경우, Error Log를 확인한다.</strong><br />
Error Log에 다음과 같은 에러가 보인다면, Nginx에서 Network(당연히 http)자원을 사용하지 못해 발생하는 문제이다.</p><pre class="crayon-plain-tag">... connect() to 127.0.0.1:8080 failed (13: Permission denied) ...</pre><p></p>
<p><strong>Selinux정책에 의해, 최소한의 접근만 허용하기 때문이다.</strong><br />
권한을 확인하고, 자원을 사용하게 해주어야 한다.</p>
<p></p><pre class="crayon-plain-tag">...$ getsebool -a | grep http

httpd_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_check_spam --> off
httpd_can_connect_ftp --> off
httpd_can_connect_ldap --> off
httpd_can_connect_mythtv --> off
httpd_can_connect_zabbix --> off
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
httpd_can_network_memcache --> off
httpd_can_network_relay --> off
httpd_can_sendmail --> off
httpd_dbus_avahi --> off
httpd_dbus_sssd --> off
httpd_dontaudit_search_dirs --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> off
httpd_execmem --> off
httpd_graceful_shutdown --> on
httpd_manage_ipa --> off
httpd_mod_auth_ntlm_winbind --> off
httpd_mod_auth_pam --> off
httpd_read_user_content --> off
httpd_run_ipa --> off
httpd_run_preupgrade --> off
httpd_run_stickshift --> off
httpd_serve_cobbler_files --> off
httpd_setrlimit --> off
httpd_ssi_exec --> off
httpd_sys_script_anon_write --> off
httpd_tmp_exec --> off
httpd_tty_comm --> off
httpd_unified --> off
httpd_use_cifs --> off
httpd_use_fusefs --> off
httpd_use_gpg --> off
httpd_use_nfs --> off
httpd_use_openstack --> off
httpd_use_sasl --> off
httpd_verify_dns --> off
named_tcp_bind_http_port --> off
prosody_bind_http_port --> off

# httpd_can_network_connect가 off로 되어 있다.
# 이 설정을 on으로 해주어야 한다.
# P : 리눅스 설정 파일에 반영하여, 부팅 후에도 설정값을 유지한다.
...$ setsebool -P httpd_can_network_connect 1</pre><p></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Azure] VM Tomcat 설치</title>
		<link>http://amoogi.azurewebsites.net/12051</link>
				<pubDate>Wed, 11 Jan 2017 09:23:00 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[CentOS7.3]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Tomcat8]]></category>
		<category><![CDATA[azure]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12051</guid>
				<description><![CDATA[* OS : CentOS 7.3 (설치방법은 http://amoogi.azurewebsites.net/11711 참조) * JDK : 1.8 (설치방법은 http://amoogi.azurewebsites.net/12011 참조) * &#8230;$ : Terminal Prompt 1. 보안을 위해 Tomcat을 동작시킬수 있는 group과 user를 생성한다. [crayon-5d86db546990a069563392/] 2. Tomcat Download 사이트로 이동한다. http://tomcat.apache.org/index.html 3. 설치할 Tomcat Binary의 Download URL을 복사한다. 예) http://apache.tt.co.kr/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz 4. Tomcat Binary를 Download 받는다. [crayon-5d86db546991c513747799/] 5. 설치할 디렉토리를 생성하고, &#8230; <a href="http://amoogi.azurewebsites.net/12051" class="more-link">더 보기<span class="screen-reader-text"> "[Azure] VM Tomcat 설치"</span></a>]]></description>
								<content:encoded><![CDATA[<p>* OS : CentOS 7.3 (설치방법은 <a href="http://amoogi.azurewebsites.net/11711" target="_blank">http://amoogi.azurewebsites.net/11711</a> 참조)<br />
* JDK : 1.8 (설치방법은 <a href="http://amoogi.azurewebsites.net/12011" target="_blank">http://amoogi.azurewebsites.net/12011</a> 참조)<br />
* &#8230;$ : Terminal Prompt</p>
<p><strong>1. 보안을 위해 Tomcat을 동작시킬수 있는 group과 user를 생성한다.</strong></p><pre class="crayon-plain-tag">...$ sudo groupadd tomcat

# 로그인 하지 않고(-s /bin/nologin), 
# tomcat group에 속하며(-g tomcat), 
# 홈디렉토리로 /opt/tomcat 을 가지는 (-d /opt/tomcat), user's home은 생성안한다(-M)
# tomcat이라는 user를 생성한다.
...$ sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat</pre><p></p>
<p><strong>2. Tomcat Download 사이트로 이동한다.</strong><br />
<a href="http://tomcat.apache.org/index.html" target="_blank">http://tomcat.apache.org/index.html</a></p>
<p><strong>3. 설치할 Tomcat Binary의 Download URL을 복사한다.</strong><br />
예) http://apache.tt.co.kr/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz</p>
<p><strong>4. Tomcat Binary를 Download 받는다.</strong></p><pre class="crayon-plain-tag">...$ wget http://apache.tt.co.kr/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz
--2017-01-10 08:49:17--  http://apache.tt.co.kr/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz
Resolving apache.tt.co.kr (apache.tt.co.kr)... 211.47.69.77
Connecting to apache.tt.co.kr (apache.tt.co.kr)|211.47.69.77|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9330875 (8.9M) [application/x-gzip]
Saving to: ‘apache-tomcat-8.5.9.tar.gz’

100%[===========================================================================================>] 9,330,875   5.23MB/s   in 1.7s

2017-01-10 08:49:19 (5.23 MB/s) - ‘apache-tomcat-8.5.9.tar.gz’ saved [9330875/9330875]</pre><p></p>
<p><strong>5. 설치할 디렉토리를 생성하고, 압축을 푼다.</strong></p><pre class="crayon-plain-tag">...$ sudo mkdir /opt/tomcat

# x : tar 압축풀기
# v : verbose
# f : 파일지정
# C : 경로 지정
# --strip-components=1 : 원래 경로에서 1단계 경로는 제거하고, 그 밑 sub 경로부터 풀게 한다.
...$ $ sudo tar xvf apache-tomcat-8.5.9.tar.gz -C /opt/tomcat --strip-components=1

...
apache-tomcat-8.5.9/conf/
apache-tomcat-8.5.9/conf/catalina.policy
apache-tomcat-8.5.9/conf/catalina.properties
apache-tomcat-8.5.9/conf/context.xml
apache-tomcat-8.5.9/conf/jaspic-providers.xml
apache-tomcat-8.5.9/conf/jaspic-providers.xsd
apache-tomcat-8.5.9/conf/logging.properties
apache-tomcat-8.5.9/conf/server.xml
...</pre><p></p>
<p><strong>6. 설치된 tomcat 폴더(/opt/tomct)에, 생성한 group, user 권한을 부여한다.</strong><br />
* 이하 Root 권한으로 실행한다.</p><pre class="crayon-plain-tag">...$ sudo su -

# -R : 경로와 그 하위 파일들의 사용자 그룹을 모두 변경한다.
...$ chgrp -R tomcat conf

# 해당 경로를 접근하는 그룹에 read, write, execute 권한을 부여한다.
...$ chmod g+rwx conf

# 해당 경로의 파일에 접근하는 그룹에 read 권한을 부여한다.
...$ chmod g+r conf/*

# tomcat/의 소유자를 tomcat user로 변경한다.
# -R : 경로와 그 하위 파일들의 소유자를 모두 변경한다.
...$ chown -R tomcat tomcat/</pre><p></p>
<p><strong>7. tomcat 서비스를 sytemd 데몬에 등록한다.</strong></p><pre class="crayon-plain-tag"># 아래 파일을 생성한다. 
...$ vi /etc/systemd/system/tomcat.service

# 파일 내용
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/java/default/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
# 서버 환경에 맞게 조정해 주면 된다. 서버 사양이 좋지 않아, 최저 사양으로 설정
Environment='CATALINA_OPTS=-Xms256M -Xmx256M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

# tomcat group의 tomcat user로 실행된다.
User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target</pre><p></p>
<p><strong>8.systemd 데몬을 리로드 한다.</strong></p><pre class="crayon-plain-tag">...$ systemctl daemon-reload</pre><p><strong><br />
9. 서버 부팅 시 tomcat 서비스를 로드하려면 다음과 같이 명령어를 실행한다.</strong></p><pre class="crayon-plain-tag">...$ enable tomcat
Created symlink from /etc/systemd/system/multi-user.target.wants/tomcat.service to /etc/systemd/system/tomcat.service.</pre><p></p>
<p><strong>10. 브라우저에서 접속을 확인한다. </strong><br />
* http://~:8080<br />
* 8080 포트를 Azure 네트워크 보안 그룹에서 미리 열어줘야 한다.<br />
* <a href="http://amoogi.azurewebsites.net/11711" target="_blank">http://amoogi.azurewebsites.net/11711</a> 참조)<br />
<a href="http://amoogi.azurewebsites.net/12051/tomcat1" rel="attachment wp-att-12121"><img src="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1.png" alt="" width="1519" height="1409" class="alignnone size-full wp-image-12121" srcset="http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1.png 1519w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-150x139.png 150w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-520x482.png 520w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-768x712.png 768w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-800x742.png 800w, http://amoogi.azurewebsites.net/wp-content/uploads/2017/01/tomcat1-660x612.png 660w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></a></p>
<p>11. Tomcat Web Management를 설정한다.</p><pre class="crayon-plain-tag">...$ vi /opt/tomcat/conf/tomcat-users.xml

# 추가 설정, user, password는 알아서 설정하면 된다.
<tomcat-users>
  <user username="amdin" password="admin" roles="manager-gui,admin-gui"/>
</tomcat-users></pre><p></p>
<p>12. Tomcat Service를 재실행한다.</p><pre class="crayon-plain-tag">...$ systemctl restart tomcat</pre><p></p>
<p>13. Tomcat Web Management에 접속한다.<br />
* Tomcat이 설치된 머신의 브라우저에서 접속해야 한다.<br />
* http://~:8080/manager/html</p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
		<item>
		<title>[Azure] VM Oracle JDK 설치</title>
		<link>http://amoogi.azurewebsites.net/12011</link>
				<pubDate>Tue, 10 Jan 2017 08:19:45 +0000</pubDate>
		<dc:creator><![CDATA[Woogiri]]></dc:creator>
				<category><![CDATA[TIP]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[CentOS 7.3]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[jdk 설치]]></category>

		<guid isPermaLink="false">http://amoogi.azurewebsites.net/?p=12011</guid>
				<description><![CDATA[* OS : CentOS 7.3 (설치방법은 http://amoogi.azurewebsites.net/11711 참조) * &#8230;$ : Terminal Prompt 1. 설치된 CentOS의 아키텍처 정보를 확인한다. [crayon-5d86db546a818578499693/] 2. 오라클 다운로드 사이트에서 해당 아키텍처에 해당하는 JDK 정보를 확인한다. http://www.oracle.com/technetwork/java/javase/downloads/index.html 3. 설치하려는 JDK rpm 버전 링크를 복사한다. 예) http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm 4. JDK를 다운로드 받는다. [crayon-5d86db546a828866531358/] 5. yum localinstall을 이용하여 JDK를 설치한다. [crayon-5d86db546a836626809749/] 6. 설치를 확인한다. &#8230; <a href="http://amoogi.azurewebsites.net/12011" class="more-link">더 보기<span class="screen-reader-text"> "[Azure] VM Oracle JDK 설치"</span></a>]]></description>
								<content:encoded><![CDATA[<p>* OS : CentOS 7.3 (설치방법은 <a href="http://amoogi.azurewebsites.net/11711" target="_blank">http://amoogi.azurewebsites.net/11711</a> 참조)</p>
<p>* &#8230;$ : Terminal Prompt</p>
<p><strong>1. 설치된 CentOS의 아키텍처 정보를 확인한다.</strong></p><pre class="crayon-plain-tag">...$ arch
x86_64</pre><p></p>
<p><strong>2. 오라클 다운로드 사이트에서 해당 아키텍처에 해당하는 JDK 정보를 확인한다.</strong><br />
<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" target="_blank">http://www.oracle.com/technetwork/java/javase/downloads/index.html</a></p>
<p><strong>3. 설치하려는 JDK rpm 버전 링크를 복사한다.</strong><br />
예) http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm</p>
<p><strong>4. JDK를 다운로드 받는다.</strong></p><pre class="crayon-plain-tag">...$ wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm
--2017-01-10 07:46:03--  http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm
Resolving download.oracle.com (download.oracle.com)... 23.2.16.17, 23.2.16.26
Connecting to download.oracle.com (download.oracle.com)|23.2.16.17|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm [following]
--2017-01-10 07:46:04--  https://edelivery.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.198.120.202, 2600:140e:6:396::2d3e, 2600:140e:6:381::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.198.120.202|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm?AuthParam=1484034484_e20187a4d0a3896cdf8a311e82746374 [following]
--2017-01-10 07:46:04--  http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm?AuthParam=1484034484_e20187a4d0a3896cdf8a311e82746374
Connecting to download.oracle.com (download.oracle.com)|23.2.16.17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 167741674 (160M) [application/x-redhat-package-manager]
Saving to: ‘jdk-8u112-linux-x64.rpm’

100%[===========================================================================================>] 167,741,674 9.37MB/s   in 17s

2017-01-10 07:46:21 (9.52 MB/s) - ‘jdk-8u112-linux-x64.rpm’ saved [167741674/167741674]</pre><p></p>
<p><strong>5. yum localinstall을 이용하여 JDK를 설치한다.</strong></p><pre class="crayon-plain-tag">...$ sudo yum localinstall jdk-8u112-linux-x64.rpm
Loaded plugins: fastestmirror, langpacks
Examining jdk-8u112-linux-x64.rpm: 2000:jdk1.8.0_112-1.8.0_112-fcs.x86_64
Marking jdk-8u112-linux-x64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package jdk1.8.0_112.x86_64 2000:1.8.0_112-fcs will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package                      Arch                   Version                              Repository                            Size
=====================================================================================================================================
Installing:
 jdk1.8.0_112                 x86_64                 2000:1.8.0_112-fcs                   /jdk-8u112-linux-x64                 263 M

Transaction Summary
=====================================================================================================================================
Install  1 Package

Total size: 263 M
Installed size: 263 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2000:jdk1.8.0_112-1.8.0_112-fcs.x86_64                                                                            1/1
Unpacking JAR files...
        tools.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...
  Verifying  : 2000:jdk1.8.0_112-1.8.0_112-fcs.x86_64                                                                            1/1

Installed:
  jdk1.8.0_112.x86_64 2000:1.8.0_112-fcs

Complete!</pre><p></p>
<p><strong>6. 설치를 확인한다.</strong></p><pre class="crayon-plain-tag">cd /usr/java
...$ ls -ls
total 0
0 lrwxrwxrwx. 1 root root  16 Jan 10 07:48 default -> /usr/java/latest
0 drwxr-xr-x. 9 root root 268 Jan 10 07:48 jdk1.8.0_112
0 lrwxrwxrwx. 1 root root  22 Jan 10 07:48 latest -> /usr/java/jdk1.8.0_112

...$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)</pre><p></p>
<p><strong>7. 환경변수를 설정한다.</strong></p><pre class="crayon-plain-tag">...$ vi .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export JAVA_HOME=/usr/java/default/
export JRE_HOME=/usr/java/default/jre

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH</pre><p></p>
<p>8. 설정을 반영한다.</p><pre class="crayon-plain-tag">...$ source .bash_profile</pre><p></p>
 <!-- Easy Plugin for AdSense Unfiltered [count: 3 is not less than 3] -->]]></content:encoded>
										</item>
	</channel>
</rss>
