<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yunho Chung on Medium]]></title>
        <description><![CDATA[Stories by Yunho Chung on Medium]]></description>
        <link>https://medium.com/@yunhochung?source=rss-7a5cc655e81c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Yunho Chung on Medium</title>
            <link>https://medium.com/@yunhochung?source=rss-7a5cc655e81c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 15:08:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yunhochung/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hedera Hashgraph — 시작하기]]></title>
            <link>https://yunhochung.medium.com/hedera-hashgraph-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-934077ba5b8d?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/934077ba5b8d</guid>
            <category><![CDATA[hedera]]></category>
            <category><![CDATA[hashgraph]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Sun, 25 Oct 2020 14:50:51 GMT</pubDate>
            <atom:updated>2020-10-25T14:50:51.133Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hedera Hashgraph — 시작하기</h3><p>이글은 지난 Hyperledger Meetup Korea #26에서 발표하였던 “Getting Started with Hedera Hashgraph”자료를 편집하였습니다.</p><ul><li>발표 자료 — <a href="https://www.slideshare.net/secret/cjZHc3OoZ1KtQ4">https://www.slideshare.net/secret/cjZHc3OoZ1KtQ4</a></li><li>실습 자료 — <a href="https://github.com/hlkug/meetup/tree/master/202010/hands-on/getting_started">https://github.com/hlkug/meetup/tree/master/202010/hands-on/getting_started</a></li></ul><h3>0. 참고</h3><ul><li>Coding With Cooper - <a href="https://www.youtube.com/playlist?list=PLcaTa5RR9SuA__8rzCKru8Y_F6iMJPEUD">https://www.youtube.com/playlist?list=PLcaTa5RR9SuA__8rzCKru8Y_F6iMJPEUD</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHtRpAinK26VG0tA47q7yA.png" /></figure><h3>1. 준비사항</h3><h3>1.1 Account 생성</h3><p>Hedera 계정은 Private Key, Public Key, Account ID로 구성 되며 아래 사이트를 통해 발급 받을 수 있습니다.</p><ul><li><a href="https://portal.hedera.com/">https://portal.hedera.com</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HBWSDys2fWrn-zqbs_7LKw.png" /></figure><p>회원 가입 후 실습을 위해 테스트넷(Testnet) Account를 발급 받습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQcXUg-lRV_4CdpJFDkTog.png" /></figure><pre>{<br>    &quot;operator&quot;: {<br>        &quot;accountId&quot;: &quot;0.0.1688&quot;,<br>        &quot;publicKey&quot;: &quot;302a300506032b65700321008c999110d6&quot;,<br>        &quot;privateKey&quot;: &quot;302e020100300506032b6570042204209be&quot;<br>    },<br>    &quot;network&quot;: {<br>        &quot;0.testnet.hedera.com:50211&quot;: &quot;0.0.3&quot;,<br>        &quot;1.testnet.hedera.com:50211&quot;: &quot;0.0.4&quot;,<br>        &quot;2.testnet.hedera.com:50211&quot;: &quot;0.0.5&quot;,<br>        &quot;3.testnet.hedera.com:50211&quot;: &quot;0.0.6&quot;<br>    }<br>}</pre><h3>1.2 테스트 환경 구성</h3><h3>1.2.1 Hedera SDK</h3><p>Hedera에서 공식적으로 Java/JavaScript/Go SDK를 커뮤니티차원에서 C/iOS/Python/Rust/.NET SDK를 지원하고 있습니다. <a href="https://docs.hedera.com/guides/docs/sdks">https://docs.hedera.com/guides/docs/sdks</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RN29aKQ4LkXzZvkNtUfbRg.png" /></figure><h3>1.2.2 Microsoft Visual Studio Code(VS Code), Node.js 설치</h3><p>본 실습에서는 Hedera JavaScript SDK기반으로 진행됩니다.</p><ul><li>Microsoft Visual Studio Code 설치 - <a href="https://code.visualstudio.com/download">https://code.visualstudio.com/download</a></li><li>Node.js -<a href="https://nodejs.org/">https://nodejs.org</a></li></ul><h3>1.2.3 실습 소스 다운로드</h3><pre>$ git clone https://github.com/hlkug/meetup.git<br><br>$ cd meetup/202010/hands-on<br>$ ls</pre><h3>1.2.4 VS Code에서 소스 코드 열기</h3><p>1.2.3 에서 다운로드 받은 소스 폴더를 VS Code에서 오픈합니다.</p><ul><li>File -&gt; Open : meetup/202010/hands-on/getting_started</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5IbHs9TKv66CsryzWnxdg.png" /></figure><h3>1.2.5 패키지(라이브러리) 설치</h3><p>VS Code에서 Terminal 창을 오픈한 후 실습에 필요한 패키지를 설치합니다.</p><pre># 초기화<br>$ npm init -y<br>Wrote to /Users/yunho.chung/Git/hlkug/meetup/202010/hands-on/getting_started/package.json:<br><br>{<br>  &quot;name&quot;: &quot;getting_started&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;description&quot;: &quot;&quot;,<br>  &quot;main&quot;: &quot;hedera-client.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;<br>  },<br>  &quot;keywords&quot;: [],<br>  &quot;author&quot;: &quot;&quot;,<br>  &quot;license&quot;: &quot;ISC&quot;<br>}<br><br># Hedera SDK 라이브러리 다운로드<br>$ npm install --save @hashgraph/sdk<br><br># dotenv 라이브러리 다운로드<br>$ npm install --save dotenv</pre><h3>1.2.6 Account 정보 설정</h3><p>.env 파일에 본인의 Account 정보를 설정합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*kprCDkYiNlzp6PQbcWpBiQ.png" /></figure><h3>2. Cryptocurrency</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPZtLDCFJhq9P78XR1F5UA.png" /></figure><h3>2.1 Balance 확인</h3><ul><li>파일: cryptocurrency/getbalance.js</li></ul><pre>const HederaClient = require(&#39;./hedera-client&#39;);<br>const { AccountBalanceQuery } = require(&#39;@hashgraph/sdk&#39;);<br><br>async function getBalance() {<br>    const balance = new AccountBalanceQuery()<br>        .setAccountId(process.env.ACCOUNT_ID)<br>        .execute(HederaClient);<br>        <br>    console.log(`${HederaClient._operatorAccount} balance = ${(await balance).value()}`);<br>}<br><br>getBalance();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency<br>$ node getbalance.js<br>process.env.ACCOUNT_ID:  0.0.1688<br>0.0.1688 balance = 10000</pre><h3>2.2 HBar(tinybar) 송금</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*I209Kcd5kHz4qte-f5hRXg.png" /></figure><ul><li>파일: cryptocurrency/transferhbar.js</li></ul><pre>require(&#39;dotenv&#39;).config();<br>const HederaClient = require(&#39;./hedera-client&#39;);<br><br>const { Client, CryptoTransferTransaction } = require(&quot;@hashgraph/sdk&quot;);<br><br>async function transferHbar() {<br>    const myClient =  HederaClient; //Client.forTestnet();<br>    myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br><br>    const transactionId = await new CryptoTransferTransaction()<br>        .addSender(process.env.ACCOUNT_ID, 100)<br>        .addRecipient(&#39;0.0.3&#39;, 100)<br>        .execute(myClient);<br>    console.log(&#39;tx id:&#39;, transactionId);<br>    // const transactionReceipt = await transactionId.getReceipt(myClient);<br>    // console.log(&#39;reciept: &#39;, transactionReceipt);<br><br>    const record = await transactionId.getRecord(myClient);<br>    console.log(&#39;reciept: &#39;, record);<br>}<br><br>transferHbar();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency<br><br># 송금전 Balance 확인<br>$ node getbalance.js <br>process.env.ACCOUNT_ID:  0.0.1688<br>0.0.1688 balance = 9999.98474956<br><br># HBar 송금(100 tinybar)<br>$ node transferhbar.js<br>process.env.ACCOUNT_ID:  0.0.1688<br>tx id: 0.0.1688@1602079806.560000000<br><br>reciept:  {<br>  &quot;status&quot;: &quot;SUCCESS&quot;<br>}<br><br>record:  TransactionRecord {<br>  receipt: {<br>    &quot;status&quot;: &quot;SUCCESS&quot;<br>  },<br>  transactionHash: Uint8Array(48) [<br>    179,  97, 249,  70, 134,  18, 141, 177, 223,<br>    117, 124, 101,   5, 137, 143, 179, 107, 169,<br>     98, 177, 234, 111, 240, 183, 117, 243, 104,<br>    137, 119, 102, 201, 114, 216, 216, 227,  87,<br>      4, 131, 197,  63, 127,  55,  78,  82, 129,<br>    228, 104,  15<br>  ],<br>  consensusTimestamp: Time { seconds: 1602079817, nanos: 34017000 },<br>  transactionId: 0.0.1688@1602079806.560000000,<br>  transactionMemo: &#39;&#39;,<br>  transactionFee: 0.00254112,<br>  transfers: [<br>    { accountId: 0.0.3, amount: 0.00015597 },<br>    { accountId: 0.0.98, amount: 0.00238615 },<br>    { accountId: 0.0.1688, amount: -0.00254212 }<br>  ],<br>  [Symbol(callResult)]: null,<br>  [Symbol(callResultIsCreate)]: false<br>}<br><br># 송금후 Balance 확인<br>$ node getbalance.js<br>process.env.ACCOUNT_ID:  0.0.1688<br>0.0.1688 balance = 9999.97966608</pre><ul><li>트랜잭션 확인</li><li><a href="https://testnet.dragonglass.me/">https://testnet.dragonglass.me</a> 에서 트랜잭션을 확인합니다.</li><li><a href="https://testnet.dragonglass.me/hedera/accounts/%7B%EB%B3%B8%EC%9D%B8">https://testnet.dragonglass.me/hedera/accounts/{본인</a> Account ID}</li><li>예&gt; <a href="https://testnet.dragonglass.me/hedera/accounts/0.0.1688">https://testnet.dragonglass.me/hedera/accounts/0.0.1688</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saRSapsDdzFMgrUEfEMenw.png" /></figure><ul><li>트랜잭션 수수료</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sha-sydCSjWtbts_c1ja4w.png" /></figure><h3>2.3 다중 서명(Multi-Signature)</h3><p>Account는 다수개의 Key(Private/Public)를 가질 수 있으며 HBar를 송금하거나 트랜잭션을 발생 시킬 때 특정 키의 서명이 필요함을 설정할 수 있습니다.(Account 생성시..)</p><p>예&gt; 직원이 트랜잰션을 생성한 후 관리자에게 보내 서명을 받고 서명 받은 트랜잭션 실행</p><ul><li>참고 자료</li><li>Hedera Technical Insights: Hierarchical Multi-Signature support in Hedera</li><li><a href="https://hedera.com/blog/hierarchical-multi-signature-support-in-hedera">https://hedera.com/blog/hierarchical-multi-signature-support-in-hedera</a></li><li>Keys &amp; Signatures on Hedera Hashgraph</li><li><a href="https://medium.com/@sreejithkaimal/keys-signatures-on-hedera-hashgraph-e173814456d5">https://medium.com/@sreejithkaimal/keys-signatures-on-hedera-hashgraph-e173814456d5</a></li></ul><h3>Step 1. Submitter, Approver 키 생성 및 Account 생성</h3><ul><li>파일: cryptocurrency/multisig/1.createaccount.js</li></ul><pre>require(&#39;dotenv&#39;).config({ path: &#39;../../.env&#39; });<br>const HederaClient = require(&#39;../../hedera-client&#39;);<br><br>const { Client, CryptoTransferTransaction, Ed25519PrivateKey, ThresholdKey, AccountCreateTransaction } = require(&quot;@hashgraph/sdk&quot;);<br><br>async function createAccount() {<br>    const myClient =  HederaClient; //Client.forTestnet();<br>    myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br><br>    // Generate our key lists<br>    const privateKeyList = [];<br>    const publicKeyList = [];<br><br>    // Submitter 개인키,공개키 생성<br>    const submitterPrivateKey = await Ed25519PrivateKey.generate();<br>    const submitterPublicKey = submitterPrivateKey.publicKey;<br>    privateKeyList.push(submitterPrivateKey);<br>    publicKeyList.push(submitterPublicKey);<br>    console.log(`Submitter Private Key: ${submitterPrivateKey}`);<br>    console.log(`Submitter Public Key: ${submitterPublicKey}`);<br><br>    console.log(&#39;&#39;);<br><br>     // Approver 개인키,공개키 생성<br>     const approverPrivateKey = await Ed25519PrivateKey.generate();<br>     const approverPublicKey = approverPrivateKey.publicKey;<br>     privateKeyList.push(approverPrivateKey);<br>     publicKeyList.push(approverPublicKey);<br>     console.log(`Approver Private Key: ${approverPrivateKey}`);<br>     console.log(`Approver Public Key: ${approverPublicKey}`);<br><br>    // Submitter와 Approver의 서명이 있어야 트랜잭션을 발생시킬 수 있도록<br>    // Threshold Key목록에 Submitter, Approver 공개키 저장<br>    const thresholdKey = new ThresholdKey(2); // Define min # of sigs<br>    for (const element of publicKeyList) {<br>        thresholdKey.add(element);<br>    }<br><br>    // 새로운 Account 생성<br>    const accountCreateTransaction = await new AccountCreateTransaction()<br>        .setKey(thresholdKey)<br>        .setInitialBalance(1000000000) // 초기 발란스 100<br>        .execute(myClient);<br><br>    const receipt = await accountCreateTransaction.getReceipt(myClient);<br><br>    console.log(&#39;\nAccound ID:&#39;, receipt.getAccountId().toString());<br>}<br><br>createAccount();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency/multisig<br><br># Submitter, Approver Key 생성<br>$ node 1.createaccount.js <br>Submitter Private Key: 302e020100300506032b65700422042038e905d9e1f1b595a8a0a95ab92373e6d07b09a66f4388a2e2e7cd2d2d8b7e5c<br>Submitter Public Key: 302a300506032b657003210049a804b9b322c290baa016af7cb6cae0ab5cca180ff63397f2f2d6253db157d2<br><br>Approver Private Key: 302e020100300506032b6570042204201358c83c3515a675a1441249e211f7db00ca5191bdce59ec1c49407fac62f3c8<br>Approver Public Key: 302a300506032b65700321008d530186fbd058bf4eba839b52a5c2227aa6d96786647e4fa842e0888d4cc4e6<br><br># 트랜잭션 발생시 Submitter, Approver 서명이 필수로 설정한 계정 생성<br>Accound ID: 0.0.86195</pre><h3>Step 2. Submitter가 서명한 트랜잭션 파일로 저장</h3><p>Hbar 송금과 관련된 트랜잭션을 생성한 후 Submitter Private Key로 서명한 후 파일로 저장합니다.</p><ul><li>파일: cryptocurrency/multisig/2.createtxbysubmitter.js</li><li><em>Step 1.에서 생성한 Account ID와 Submitter Private Key 값을 사용합니다.</em></li></ul><pre>require(&#39;dotenv&#39;).config({ path: &#39;../../.env&#39; });<br>fs = require(&#39;fs&#39;);<br><br>const HederaClient = require(&#39;../../hedera-client&#39;);<br><br>const { Client, CryptoTransferTransaction, AccountBalanceQuery, Ed25519PrivateKey } = require(&quot;@hashgraph/sdk&quot;);<br><br>async function ccreateTxBySubmitter() {<br>    const accountId = &#39;&#39;; # Step 1에서 생성한 Account ID<br>    const submitterPrivateKeyStr = &#39;&#39;; #Step 1에서 생성한 Submitter Private Key<br><br>    const myClient =  HederaClient; //Client.forTestnet();<br>    // myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br>    myClient.setOperator(accountId, submitterPrivateKeyStr);<br><br>    // 트랜잭션 생성<br>    const tx = await new CryptoTransferTransaction()<br>        .addSender(accountId, 5)<br>        .addRecipient(&#39;0.0.3&#39;, 5)<br>        .build(myClient);<br><br>    const submitterPrivateKey = await Ed25519PrivateKey.fromString(<br>        submitterPrivateKeyStr<br>    );<br><br>    // Submitter의 Private Key로 서명<br>    tx.sign(submitterPrivateKey);<br>    <br>    fs.writeFile(&#39;signedtxbysumitter.base64&#39;, Buffer.from(tx.toBytes()).toString(&#39;base64&#39;), function (err) {<br>        if (err) return console.log(err);<br>        console.log(&#39;Saved to signedtxbysumitter.base64 file.&#39;);<br>    });<br><br>    // console.log(tx)<br><br>    <br>}<br><br>ccreateTxBySubmitter();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency/multisig<br><br># Submitter가 서명한 트랜잭션을 파일로 저장<br>$ node 2.createtxbysubmitter.js <br>Saved to signedtxbysumitter.base64 file.</pre><h3>Step 3. Approver가 서명한 트랜잭션 파일로 저장</h3><p>Step 3.에서 Submitter가 서명한 후 저장한 트랜잭션에 Approver의 Private Key로 서명한 후 파일로 저장합니다.</p><ul><li>파일: cryptocurrency/multisig/3.signtxbyapprover.js</li><li><em>Step 1.에서 생성한 Account ID와 Approver Private Key 값을 사용합니다.</em></li></ul><pre>require(&#39;dotenv&#39;).config({ path: &#39;../../.env&#39; });<br>fs = require(&#39;fs&#39;);<br><br>const HederaClient = require(&#39;../../hedera-client&#39;);<br><br>const { Client, CryptoTransferTransaction, AccountBalanceQuery, Ed25519PrivateKey, Transaction } = require(&quot;@hashgraph/sdk&quot;);<br><br>async function signTxByApprover() {<br>    const accountId = &#39;&#39;; # Step 1에서 생성한 Account ID<br>    const approverPrivateKeyStr = &#39;&#39;; #Step 1에서 생성한 Approver Private Key<br><br>    const myClient =  HederaClient; //Client.forTestnet();<br>    // myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br>    myClient.setOperator(accountId, approverPrivateKeyStr);<br><br>   <br>    let balance = new AccountBalanceQuery()<br>        .setAccountId(accountId)<br>        .execute(myClient);<br>        <br>    console.log(`${accountId} balance = ${(await balance).value()}`);<br><br>    fs.readFile(&#39;signedtxbysumitter.base64&#39;, &#39;utf8&#39;, async function (err, data) {<br>        if (err) {<br>          return console.log(err);<br>        }<br><br>        const approverPrivateKey = await Ed25519PrivateKey.fromString(<br>            approverPrivateKeyStr<br>        );<br><br>        // Approver Private Key로 서명<br>        const tx = await Transaction.fromBytes(Buffer.from(data, &#39;base64&#39;));<br>        tx.sign(approverPrivateKey);<br><br>        fs.writeFile(&#39;signedtxbysumitterbyapprover.base64&#39;, Buffer.from(tx.toBytes()).toString(&#39;base64&#39;), function (err) {<br>            if (err) return console.log(err);<br>            console.log(&#39;Saved to signedtxbysumitterbyapprover.base64 file.&#39;);<br>        });<br>    });<br>}<br><br>signTxByApprover();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency/multisig<br><br># Approver가 서명한 트랜잭션을 파일로 저장<br>$ node 3.signtxbyapprover.js <br>0.0.86195 balance = 10<br>Saved to signedtxbysumitterbyapprover.base64 file.</pre><h3>Step 4. Submitter,Approver가 서명한 트랜잭션을 Submitter가 실행</h3><p>Step 2,3을 통해 Submitter, Approver 서명이 포함된 트랜잭션을 Submitter가 실행합니다.</p><ul><li>파일: cryptocurrency/multisig/4.executetxbysubmmitter.js</li><li><em>Step 1.에서 생성한 Account ID와 Submitter Private Key 값을 사용합니다.</em></li></ul><pre>require(&#39;dotenv&#39;).config({ path: &#39;../../.env&#39; });<br>fs = require(&#39;fs&#39;);<br><br>const HederaClient = require(&#39;../../hedera-client&#39;);<br><br>const { Client, CryptoTransferTransaction, AccountBalanceQuery, Ed25519PrivateKey, Transaction } = require(&quot;@hashgraph/sdk&quot;);<br><br>async function executeTxBySubmitter() {<br>    const accountId = &#39;0.0.86195&#39;;<br>    const submitterPrivateKeyStr = &#39;302e020100300506032b65700422042038e905d9e1f1b595a8a0a95ab92373e6d07b09a66f4388a2e2e7cd2d2d8b7e5c&#39;;<br><br>    const myClient =  HederaClient; //Client.forTestnet();<br>    // myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br>    myClient.setOperator(accountId, submitterPrivateKeyStr);<br><br>   <br>    let balance = new AccountBalanceQuery()<br>        .setAccountId(accountId)<br>        .execute(myClient);<br>        <br>    console.log(`${accountId} balance = ${(await balance).value()}`);<br><br>    fs.readFile(&#39;signedtxbysumitterbyapprover.base64&#39;, &#39;utf8&#39;, async function (err, data) {<br>        if (err) {<br>          return console.log(err);<br>        }<br>        <br>        const tx = await Transaction.fromBytes(Buffer.from(data, &#39;base64&#39;));<br>        const transactionId = await tx.execute(myClient);<br><br>        console.log(&#39;tx id:&#39;, transactionId);<br>        const transactionReceipt = await transactionId.getReceipt(myClient);<br>        console.log(&#39;\nreciept: &#39;, transactionReceipt);<br><br>        // const record = await transactionId.getRecord(myClient);<br>        // console.log(&#39;\nrecord: &#39;, record);<br><br>        balance = new AccountBalanceQuery()<br>            .setAccountId(accountId)<br>            .execute(myClient);<br>            <br>        console.log(`${accountId} balance = ${(await balance).value()}`);      });<br><br>   <br>}<br><br>executeTxBySubmitter();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/cryptocurrency/multisig<br><br># Hbar 송금 트랜잭션 실행<br>$ node 4.executetxbysubmmitter.js <br>0.0.86195 balance = 10<br>tx id: 0.0.86195@1603636033.900000000<br><br>reciept:  {<br>  &quot;status&quot;: &quot;SUCCESS&quot;<br>}<br>0.0.86195 balance = 9.99578438</pre><h3>3. File Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbvSqqfLoUYiF70GCIqBwA.png" /></figure><h3>3.1 파일 생성 &amp; 읽기</h3><ul><li>파일: fileservice/create_read.js</li></ul><pre>const { Client, FileCreateTransaction, FileContentsQuery, FileInfoQuery, FileDeleteTransaction, Ed25519PrivateKey, Hbar } = require(&quot;@hashgraph/sdk&quot;);<br>require(&#39;dotenv&#39;).config({ path: &#39;../.env&#39; });<br><br>async function main() {<br>  console.log(&#39;process.env.ACCOUNT_ID:&#39;, process.env.ACCOUNT_ID);<br><br>  const operatorAccount = process.env.ACCOUNT_ID;<br>  const operatorPrivateKey = Ed25519PrivateKey.fromString(process.env.PRIVATE_KEY);<br>  const operatorPublicKey = operatorPrivateKey.publicKey;<br><br>  if (operatorPrivateKey == null || operatorAccount == null) {<br>    throw new Error(<br>      &quot;environment variables OPERATOR_KEY and OPERATOR_ID must be present&quot;<br>    );<br>  }<br><br>  const client = Client.forTestnet()<br>  client.setOperator(operatorAccount, operatorPrivateKey);<br><br>  // 파일 생성<br>  const transactionId = await new FileCreateTransaction()<br>    .setContents(&quot;Hello, Hedera&#39;s file service!&quot;)<br>    .addKey(operatorPublicKey) // Defines the &quot;admin&quot; of this file<br>    .setMaxTransactionFee(new Hbar(15))<br>    .execute(client);<br><br>  const receipt = await transactionId.getReceipt(client);  <br>  const fileId = receipt.getFileId();<br>  console.log(&#39;tx id:&#39;, receipt);<br>  console.log(&quot;new file id = &quot;, fileId);<br><br>  // 파일 읽기<br>  const fileContents = await new FileContentsQuery()<br>    .setFileId(fileId)<br>    .execute(client);<br><br>  console.log(`file contents: ${new TextDecoder().decode(fileContents)}`);<br><br>  // 파일 정보 조회<br>  const fileInfo = await new FileInfoQuery()<br>    .setFileId(fileId)<br>    .execute(client);<br><br>  console.log(&#39;fileInfo:&#39;, fileInfo);<br>}<br><br>main();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/fileservice<br>$ node create_read.js <br>process.env.ACCOUNT_ID: 0.0.1688<br>tx id: {<br>  &quot;status&quot;: &quot;SUCCESS&quot;,<br>  &quot;fileId&quot;: &quot;0.0.64778&quot;<br>}<br>new file id =  0.0.64778<br><br>file contents: Hello, Hedera&#39;s file service!<br><br>fileInfo: {<br>  fileId: 0.0.64778,<br>  size: 29,<br>  expirationTime: 2021-01-06T22:14:16.000Z,<br>  isDeleted: false,<br>  keys: [<br>    302a300506032b65700321008c999110d6f068098ec344ecaaaaaba346a90a205ea7b15de6fdb6d82b7ddab8<br>  ]<br>}</pre><h3>3.2 파일 생성 &amp; 삭제</h3><ul><li>파일: fileservice/create_delete.js</li></ul><pre>const { Client, FileCreateTransaction, FileContentsQuery, FileInfoQuery, FileDeleteTransaction, Ed25519PrivateKey, Hbar } = require(&quot;@hashgraph/sdk&quot;);<br>require(&#39;dotenv&#39;).config({ path: &#39;../.env&#39; });<br><br>async function main() {<br>  console.log(&#39;process.env.ACCOUNT_ID:&#39;, process.env.ACCOUNT_ID);<br><br>  const operatorAccount = process.env.ACCOUNT_ID;<br>  const operatorPrivateKey = Ed25519PrivateKey.fromString(process.env.PRIVATE_KEY);<br>  const operatorPublicKey = operatorPrivateKey.publicKey;<br><br>  if (operatorPrivateKey == null || operatorAccount == null) {<br>    throw new Error(<br>      &quot;environment variables OPERATOR_KEY and OPERATOR_ID must be present&quot;<br>    );<br>  }<br><br>  const client = Client.forTestnet()<br>  client.setOperator(operatorAccount, operatorPrivateKey);<br><br>  // 파일 생성<br>  const transactionId = await new FileCreateTransaction()<br>    .setContents(&quot;Hello, Hedera&#39;s file service!&quot;)<br>    .addKey(operatorPublicKey) // Defines the &quot;admin&quot; of this file<br>    .setMaxTransactionFee(new Hbar(15))<br>    .execute(client);<br><br>  const receipt = await transactionId.getReceipt(client);  <br>  const fileId = receipt.getFileId();<br>  console.log(&#39;tx id:&#39;, receipt);<br>  console.log(&quot;new file id = &quot;, fileId);<br><br>  // 파일 삭제<br>  const deleteFileTransactionId = await new FileDeleteTransaction()<br>  .setFileId(fileId) // Define which file to delete<br>  .setMaxTransactionFee(new Hbar(100))<br>  .execute(client); // Presumes the client is the file&#39;s admin key<br><br>  // After deletion, the receipt should NOT contain a file ID<br>  const deleteFileReceipt = await deleteFileTransactionId.getReceipt(client);<br>  console.log(&quot;deleted file receipt, won&#39;t contain a file ID &quot;, JSON.stringify(deleteFileReceipt) + &quot;\n&quot;);  <br>}<br><br>main();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/fileservice<br>$ node create_delete.js <br>process.env.ACCOUNT_ID: 0.0.1688<br>tx id: {<br>  &quot;status&quot;: &quot;SUCCESS&quot;,<br>  &quot;fileId&quot;: &quot;0.0.64779&quot;<br>}<br>new file id =  0.0.64779<br>deleted file receipt, won&#39;t contain a file ID  {&quot;status&quot;:&quot;SUCCESS&quot;}</pre><ul><li>트랜잭션 확인</li><li><a href="https://testnet.dragonglass.me/">https://testnet.dragonglass.me</a> 에서 트랜잭션을 확인합니다.</li><li><a href="https://testnet.dragonglass.me/hedera/accounts/%7B%EB%B3%B8%EC%9D%B8">https://testnet.dragonglass.me/hedera/accounts/{본인</a> Account ID}</li><li>예&gt; <a href="https://testnet.dragonglass.me/hedera/accounts/0.0.1688">https://testnet.dragonglass.me/hedera/accounts/0.0.1688</a></li></ul><h3>4. Smart Contract</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hWrFjmLg4YEmHHs1eaumg.png" /></figure><h3>4.1 스마트 컨트랙트 배포 및 함수 실행</h3><ul><li>제약 사항</li><li>Hedera smart contracts support Solidity versions up to v0.5.9.</li><li>Each smart contract has a maximum state size of 1MB which can store up to approximately 16,000 key-value pairs.</li><li>파일: smartcontract/create_get_set.js</li></ul><pre>/**<br>* Solidity Support<br>Hedera smart contracts support Solidity versions up to v0.5.9.<br> <br>* Smart Contract State Size<br>Each smart contract has a maximum state size of 1MB which can store up to approximately 16,000 key-value pairs.<br> */<br>const { <br>    Client, FileCreateTransaction, ContractCreateTransaction,<br>    ContractFunctionParams, ContractCallQuery, ContractExecuteTransaction,<br>    Ed25519PrivateKey,<br>    Hbar <br>} = require(&quot;@hashgraph/sdk&quot;);<br>require(&#39;dotenv&#39;).config({ path: &#39;../.env&#39; });<br><br>async function main() {<br>    const operatorAccount = process.env.ACCOUNT_ID;<br>    const operatorPrivateKey = Ed25519PrivateKey.fromString(process.env.PRIVATE_KEY);<br><br>    // `Client.forMainnet()` is provided for connecting to Hedera mainnet<br>    const client = Client.forTestnet();<br><br>    // Defaults the operator account ID and key such that all generated transactions will be paid for<br>    // by this account and be signed by this key<br>    client.setOperator(operatorAccount, operatorPrivateKey);<br><br><br>    const smartContract = require(&quot;./stateful.json&quot;);<br>    const smartContractByteCode = smartContract.contracts[ &quot;stateful.sol:StatefulContract&quot; ].bin;<br><br>    console.log(&quot;contract bytecode size:&quot;, smartContractByteCode.length, &quot;bytes&quot;);<br><br>    // 파일 생성(스마트 컨트랙트)<br>    const byteCodeFileId = (await (await new FileCreateTransaction()<br>        .setMaxTransactionFee(new Hbar(3))<br>        .addKey(operatorPrivateKey.publicKey)<br>        .setContents(smartContractByteCode)<br>        .execute(client))<br>        .getReceipt(client))<br>        .getFileId();<br><br>    console.log(&quot;contract bytecode file:&quot;, byteCodeFileId.toString());<br><br>    // 스마트 컨트랙트 생성(with File ID)<br>    const record = await (await new ContractCreateTransaction()<br>        .setMaxTransactionFee(new Hbar(100))<br>        // Failing to set this to an adequate amount<br>        // INSUFFICIENT_GAS<br>        .setGas(2000) // ~1260<br>        // Failing to set parameters when parameters are required<br>        // CONTRACT_REVERT_EXECUTED<br>        .setConstructorParams(new ContractFunctionParams()<br>            .addString(&quot;hello from hedera&quot;))<br>        .setBytecodeFileId(byteCodeFileId)<br>        .execute(client))<br>        .getRecord(client);<br><br>    const newContractId = record.receipt.getContractId();<br><br>    console.log(&quot;contract create gas used:&quot;, record.getContractCreateResult().gasUsed);<br>    console.log(&quot;contract create transaction fee:&quot;, record.transactionFee.asTinybar());<br>    console.log(&quot;contract:&quot;, newContractId.toString());<br><br>    // getMessage() 함수 호출(Query...)<br>    let callResult = await new ContractCallQuery()<br>        .setContractId(newContractId)<br>        .setGas(1000) // ~897<br>        .setFunction(&quot;getMessage&quot;, null)<br>        .execute(client);<br><br>    console.log(&quot;\ncall gas used:&quot;, callResult.gasUsed);<br>    console.log(&quot;message:&quot;, callResult.getString(0));<br><br>    // setMessage() 함수 호출(Transaction...)<br>    const getRecord = await (await new ContractExecuteTransaction()<br>        .setContractId(newContractId)<br>        .setGas(7000) // ~6016<br>        .setFunction(&quot;setMessage&quot;, new ContractFunctionParams()<br>            .addString(&quot;hello from hedera again!&quot;))<br>        .execute(client))<br>        // [getReceipt] or [getRecord] waits for consensus before continuing<br>        //      and will throw an exception<br>        //      on an error received during that process like INSUFFICENT_GAS<br>        .getRecord(client);<br><br>    console.log(&quot;\nexecute gas used:&quot;, getRecord.getContractExecuteResult().gasUsed);<br><br>    // getMessage() 함수 호출(Query...)<br>    callResult = await new ContractCallQuery()<br>        .setContractId(newContractId)<br>        .setGas(1000) // ~897<br>        .setFunction(&quot;getMessage&quot;, null)<br>        .execute(client);<br><br>    console.log(&quot;\ncall gas used:&quot;, callResult.gasUsed);<br>    console.log(&quot;message:&quot;, callResult.getString(0));<br><br>    client.close();<br>}<br><br>main();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/smartcontract<br>$ node create_get_set.js <br>contract bytecode size: 2478 bytes<br>contract bytecode file: 0.0.64783<br>contract create gas used: 1260<br>contract create transaction fee: BigNumber { s: 1, e: 9, c: [ 1262941963 ] }<br>contract: 0.0.64784<br><br>call gas used: 897<br>message: hello from hedera<br><br>execute gas used: 6016<br><br>call gas used: 897<br>message: hello from hedera again!</pre><ul><li>트랜잭션 확인</li><li><a href="https://testnet.dragonglass.me/">https://testnet.dragonglass.me</a> 에서 트랜잭션을 확인합니다.</li><li><a href="https://testnet.dragonglass.me/hedera/accounts/%7B%EB%B3%B8%EC%9D%B8">https://testnet.dragonglass.me/hedera/accounts/{본인</a> Account ID}</li><li>예&gt; <a href="https://testnet.dragonglass.me/hedera/accounts/0.0.1688">https://testnet.dragonglass.me/hedera/accounts/0.0.1688</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QePzq2IMwrkhYwQeVpNzYg.png" /></figure><h3>5. Consensus Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*ZMJooVmveb2OUQDA3uFz0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLcGO5oHAxL48m5ZhN_-YA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XxR8J0BT9-eN20gVr0ZKw.png" /></figure><h3>5.1 토픽 생성 및 Submit/Subscribe</h3><ul><li>파일: consensusservice/submit_subscribe.js</li></ul><pre>require(&#39;dotenv&#39;).config({ path: &#39;../.env&#39; });<br><br>const {<br>    Client, MirrorClient, MirrorConsensusTopicQuery,<br>    FileCreateTransaction, ContractCreateTransaction, Hbar, Ed25519PrivateKey,<br>    ContractFunctionParams, ContractCallQuery, ContractExecuteTransaction,<br>    ConsensusMessageSubmitTransaction,<br>    ConsensusTopicCreateTransaction<br>} = require(&quot;@hashgraph/sdk&quot;);<br>const HederaClient = require(&#39;../hedera-client&#39;);<br><br>async function main() {<br>    // const myClient = Client.forTestnet();<br>    const myClient = HederaClient;<br><br>    myClient.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);<br><br>    const transactionId = await new ConsensusTopicCreateTransaction().execute(myClient);<br>    const transactionReceipt = await transactionId.getReceipt(myClient);<br>    const topicId = transactionReceipt.getConsensusTopicId();<br><br>    console.log(&#39;topid id = &#39;, topicId);<br><br>    await sleep(5000); // Consensus에서 생성된 토픽을 미러노드에서 인지할 수 있게 delay<br>    // const myMirrorClient = new MirrorClient(&#39;hcs.testnet.mirrornode.hedera.com:5600&#39;);<br>    const myMirrorClient = new MirrorClient(&#39;api.testnet.kabuto.sh:50211&#39;);<br><br>    new MirrorConsensusTopicQuery()<br>    .setTopicId(topicId)<br>    .subscribe(<br>        myMirrorClient, <br>        (message) =&gt; console.log(&#39;&lt;&lt;&lt; Received message from Mirror Node:&#39;, message.toString()),<br>        (error) =&gt; console.log(`Error: ${error.toString()}`));<br><br>    for(let i = 1; i &lt; 4; i++) {<br>        let hcsMessage = await new ConsensusMessageSubmitTransaction().setTopicId(topicId).setMessage(`Hello, HCS! From Message ${i}`).execute(myClient);<br>        let hcsMessageReceipt = await hcsMessage.getReceipt(myClient);<br><br>        console.log(`&gt;&gt;&gt; Sent message ${i}: ${hcsMessageReceipt.toString()}`);<br>    }<br>}<br><br>function sleep(ms) {<br>    return new Promise((resolve) =&gt; setTimeout(resolve, ms));<br>}<br><br>main();</pre><ul><li>실행</li></ul><pre>$ cd $SOURCE_HOME/consensusservice<br>$ node submit_subsccribe.js <br>process.env.ACCOUNT_ID:  0.0.1688<br>topid id =  0.0.66074<br>&gt;&gt;&gt; Sent message 1: {<br>  &quot;status&quot;: &quot;SUCCESS&quot;,<br>  &quot;consensusTopicRunningHash&quot;: &quot;145,180,159,133,26,126,45,234,255,143,136,89,122,202,186,66,154,64,215,26,95,60,13,90,8,94,167,131,249,47,34,244,57,200,175,15,106,178,67,43,175,49,138,194,102,36,255,38&quot;,<br>  &quot;consensusTopicSequenceNumber&quot;: 1<br>}<br>&lt;&lt;&lt; Received message from Mirror Node: Hello, HCS! From Message 1<br>&gt;&gt;&gt; Sent message 2: {<br>  &quot;status&quot;: &quot;SUCCESS&quot;,<br>  &quot;consensusTopicRunningHash&quot;: &quot;107,32,234,35,80,59,99,230,84,44,64,204,189,34,2,36,13,169,117,203,27,236,37,36,34,44,154,187,254,9,29,212,83,245,177,39,14,247,105,170,159,69,153,13,201,32,87,179&quot;,<br>  &quot;consensusTopicSequenceNumber&quot;: 2<br>}<br>&lt;&lt;&lt; Received message from Mirror Node: Hello, HCS! From Message 2<br>&gt;&gt;&gt; Sent message 3: {<br>  &quot;status&quot;: &quot;SUCCESS&quot;,<br>  &quot;consensusTopicRunningHash&quot;: &quot;253,240,50,138,90,128,164,147,253,190,48,61,8,19,139,189,22,18,160,83,91,17,188,22,83,18,44,176,42,121,5,242,77,159,212,190,140,104,148,130,220,234,231,83,185,144,218,19&quot;,<br>  &quot;consensusTopicSequenceNumber&quot;: 3<br>}<br>&lt;&lt;&lt; Received message from Mirror Node: Hello, HCS! From Message 3</pre><ul><li>트랜잭션 확인</li><li><a href="https://testnet.dragonglass.me/">https://testnet.dragonglass.me</a> 에서 트랜잭션을 확인합니다.</li><li><a href="https://testnet.dragonglass.me/hedera/accounts/%7B%EB%B3%B8%EC%9D%B8">https://testnet.dragonglass.me/hedera/accounts/{본인</a> Account ID}</li><li>예&gt; <a href="https://testnet.dragonglass.me/hedera/accounts/0.0.1688">https://testnet.dragonglass.me/hedera/accounts/0.0.1688</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugZl9yZ6zLijVPL2Uivnxw.png" /></figure><ul><li><a href="https://explorer.kabuto.sh/testnet">https://explorer.kabuto.sh/testnet</a> 에서 트랜잭션을 확인합니다.</li><li><a href="https://explorer.kabuto.sh/testnet/id/%7B%EB%B3%B8%EC%9D%B8">https://explorer.kabuto.sh/testnet/id/{본인</a> Account ID}</li><li>예&gt; <a href="https://explorer.kabuto.sh/testnet/id/0.0.1688">https://explorer.kabuto.sh/testnet/id/0.0.1688</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1sCNTFydoHdR0WV--sqIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wu-W5Fg-SyrRBhRpnIyiLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hIXS9nKhwBowsA8_cbr9w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=934077ba5b8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[이더리움] Pending, Queued Transaction?]]></title>
            <link>https://yunhochung.medium.com/%EC%9D%B4%EB%8D%94%EB%A6%AC%EC%9B%80-pending-queued-transaction-4ca4cffc6bd0?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ca4cffc6bd0</guid>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 03:44:11 GMT</pubDate>
            <atom:updated>2020-06-01T03:44:11.651Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://ethereum.stackexchange.com/questions/3831/what-is-the-max-size-of-transactions-can-clients-like-geth-keep-in-txpool">What is the max size of transactions can clients like geth keep in txpool?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ca4cffc6bd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[쿠버네티스(k8s) 설치 및 클러스터 구성하기]]></title>
            <link>https://yunhochung.medium.com/%EC%BF%A0%EB%B2%84%EB%84%A4%ED%8B%B0%EC%8A%A4-k8s-%EC%84%A4%EC%B9%98-%EB%B0%8F-%ED%81%B4%EB%9F%AC%EC%8A%A4%ED%84%B0-%EA%B5%AC%EC%84%B1%ED%95%98%EA%B8%B0-dc64e2fb44ae?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc64e2fb44ae</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Mon, 15 Apr 2019 15:11:05 GMT</pubDate>
            <atom:updated>2019-09-03T10:02:58.346Z</atom:updated>
            <content:encoded><![CDATA[<h3>0. 시스템 사양</h3><p>Master 노드 최소 사양 — CPU: 2Core, RAM: 2G<br>Workder 노드 최소 사양 — CPU: 1Core, RAM: 1G</p><h3>1. 선 작업 수행(시스템 패키지 업데이트, k8s 사용자 생성)</h3><p>k8s 클러스터에 참여하는 모든 노드에서 시스템 패키지 업데이트를 수행합니다.</p><pre>$ sudo apt-get update<br>$ sudo apt-get upgrade<br>$ sudo apt-get install linux-image-extra-virtual<br>$ sudo reboot</pre><p>k8s 클러스터의 <strong>Master 노드</strong>에 k8s 클러스터를 관리할 사용자를 추가합니다.</p><pre>$ sudo useradd -s /bin/bash -m k8s-admin<br>$ sudo passwd k8s-admin<br>$ sudo usermod -aG sudo k8s-admin</pre><h3>2. 도커 설치</h3><p>k8s는 k8s서비스 및 어플리케이션을 위해 사용되는 컨테이너 실행을 위해 도커를 필요로 합니다.</p><p>k8s 클러스터에 참여하는 모든 노드에 도커를 설치합니다.</p><p>‘19년 2월 20일기준으로 설치된 버전이 18.06이하인 경우 삭제후 재설치 바랍니다.</p><ul><li>도커 삭제</li></ul><pre>$ sudo apt-get remove docker docker-engine docker.i docker-ce docker-ce-cli</pre><ul><li>도커 설치</li></ul><pre>$ sudo apt-get update<br>$ sudo apt-get install \<br>    apt-transport-https \<br>    ca-certificates \<br>    curl \<br>    software-properties-common<br>$ sudo curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo apt-key add -<br>$ sudo add-apt-repository \<br>    &quot;deb [arch=amd64] <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> \<br>    $(lsb_release -cs) \<br>    stable&quot;<br>$ sudo apt-get update<br>$ sudo apt-cache madison docker-ce<br>  docker-ce | 5:18.09.5~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 5:18.09.4~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 5:18.09.3~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 5:18.09.2~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 5:18.09.1~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 5:18.09.0~3-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.06.3~ce~3-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.06.2~ce~3-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.06.1~ce~3-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.06.0~ce~3-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.03.1~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 18.03.0~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.12.1~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.12.0~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.09.1~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.09.0~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.06.2~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.06.1~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.06.0~ce-0~ubuntu | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.03.3~ce-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.03.2~ce-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.03.1~ce-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br> docker-ce | 17.03.0~ce-0~ubuntu-xenial | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> xenial/stable amd64 Packages<br>​<br>$ sudo apt-get install docker-ce=18.06.3~ce~3-0~ubuntu # validated 버전 18.06(&#39;19 2/20)<br>​<br>$ sudo usermod -aG docker k8s-admin</pre><pre># Docker Service의 cgroup driver를 systemd로 변경<br>$ cat &gt; /etc/docker/daemon.json &lt;&lt;EOF<br>{<br>  &quot;exec-opts&quot;: [&quot;native.cgroupdriver=systemd&quot;],<br>  &quot;log-driver&quot;: &quot;json-file&quot;,<br>  &quot;log-opts&quot;: {<br>    &quot;max-size&quot;: &quot;100m&quot;<br>  },<br>  &quot;storage-driver&quot;: &quot;overlay2&quot;<br>}<br>EOF</pre><pre># Docker Service 설정 디렉토리 생성<br>$ mkdir -p /etc/systemd/system/docker.service.d</pre><pre># Docker Service 재시작<br>$ systemctl daemon-reload<br>$ systemctl restart docker</pre><h3>3. k8s 설치 — Master, Worker 노드</h3><p>k8s 클러스터 구성에 참여하는 노드중 마스터 노드에 k8s 패키지를 설치합니다.</p><pre>$ sudo apt install apt-transport-https <br>$ sudo curl -s <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | sudo apt-key add<br>$ sudo add-apt-repository &quot;deb <a href="https://apt.kubernetes.io/">https://apt.kubernetes.io/</a> kubernetes-$(lsb_release -cs) main&quot; <br>$ sudo apt update <br>$ sudo apt install kubelet=1.14.6-00 kubeadm=1.14.6-00 \<br>kubectl=1.14.6-00<br>$ which kubelet<br>/usr/bin/kubelet<br>$ which kubeadm<br>/usr/bin/kubeadm</pre><p>Swap을 사용하는 경우 k8s 클러스터가 구동되지 않습니다.</p><p>swapoff 명령어를 사용하거나 /etc/fstab 파일에서 swap부분을 주석처리(재부팅 필요)합니다.</p><pre>$ sudo swapoff -a<br># 또는<br>$ sudo vi /etc/fstab<br>#UUID=8a99a48d-076b-4c85-ac3c-bc950e5ce829 none            swap    sw              0       0</pre><h3>4. k8s 초기화 — Master 노드</h3><p>k8s 클러스터 초기화를 위해 <strong>root</strong> 계정으로 로그인합니다.<br>그리고, k8s 클러스터 초기화를 위해 아래 환경 변수를 설정합니다.</p><pre>root@node1:~# export API_ADDR=&quot;192.168.56.2&quot; # Master 서버 외부 IP<br>root@node1:~# export DNS_DOMAIN=&quot;k8s.local&quot;<br>root@node1:~# export POD_NET=&quot;10.100.0.0/16&quot; # k8s 클러스터 POD Network CIDR</pre><p>브릿지되어있는 네트워크 트래픽을 iptables체인으로 전달될 수 있도록 아래 명령어를 실행합니다.</p><pre>root@node1:~# sysctl net.bridge.bridge-nf-call-iptables=1</pre><p>k8s 클러스터를 초기화합니다.</p><pre>root@node1:~# kubeadm init --pod-network-cidr ${POD_NET} \<br>--apiserver-advertise-address ${API_ADDR} \<br>--service-dns-domain &quot;${DNS_DOMAIN}&quot; <br>[init] Using Kubernetes version: v1.14.1<br>[preflight] Running pre-flight checks<br>[preflight] Pulling images required for setting up a Kubernetes cluster<br>[preflight] This might take a minute or two, depending on the speed of your internet connection<br>[preflight] You can also perform this action in beforehand using &#39;kubeadm config images pull&#39;<br>[kubelet-start] Writing kubelet environment file with flags to file &quot;/var/lib/kubelet/kubeadm-flags.env&quot;<br>[kubelet-start] Writing kubelet configuration to file &quot;/var/lib/kubelet/config.yaml&quot;<br>[kubelet-start] Activating the kubelet service<br>[certs] Using certificateDir folder &quot;/etc/kubernetes/pki&quot;<br>[certs] Generating &quot;front-proxy-ca&quot; certificate and key<br>[certs] Generating &quot;front-proxy-client&quot; certificate and key<br>[certs] Generating &quot;etcd/ca&quot; certificate and key<br>[certs] Generating &quot;etcd/server&quot; certificate and key<br>[certs] etcd/server serving cert is signed for DNS names [node1 localhost] and IPs [192.168.56.2 127.0.0.1 ::1]<br>[certs] Generating &quot;etcd/peer&quot; certificate and key<br>[certs] etcd/peer serving cert is signed for DNS names [node1 localhost] and IPs [192.168.56.2 127.0.0.1 ::1]<br>[certs] Generating &quot;etcd/healthcheck-client&quot; certificate and key<br>[certs] Generating &quot;apiserver-etcd-client&quot; certificate and key<br>[certs] Generating &quot;ca&quot; certificate and key<br>[certs] Generating &quot;apiserver-kubelet-client&quot; certificate and key<br>[certs] Generating &quot;apiserver&quot; certificate and key<br>[certs] apiserver serving cert is signed for DNS names [node1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.k8s.local] and IPs [10.96.0.1 192.168.56.2]<br>[certs] Generating &quot;sa&quot; key and public key<br>[kubeconfig] Using kubeconfig folder &quot;/etc/kubernetes&quot;<br>[kubeconfig] Writing &quot;admin.conf&quot; kubeconfig file<br>[kubeconfig] Writing &quot;kubelet.conf&quot; kubeconfig file<br>[kubeconfig] Writing &quot;controller-manager.conf&quot; kubeconfig file<br>[kubeconfig] Writing &quot;scheduler.conf&quot; kubeconfig file<br>[control-plane] Using manifest folder &quot;/etc/kubernetes/manifests&quot;<br>[control-plane] Creating static Pod manifest for &quot;kube-apiserver&quot;<br>[control-plane] Creating static Pod manifest for &quot;kube-controller-manager&quot;<br>[control-plane] Creating static Pod manifest for &quot;kube-scheduler&quot;<br>[etcd] Creating static Pod manifest for local etcd in &quot;/etc/kubernetes/manifests&quot;<br>[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory &quot;/etc/kubernetes/manifests&quot;. This can take up to 4m0s<br>[apiclient] All control plane components are healthy after 19.506119 seconds<br>[upload-config] storing the configuration used in ConfigMap &quot;kubeadm-config&quot; in the &quot;kube-system&quot; Namespace<br>[kubelet] Creating a ConfigMap &quot;kubelet-config-1.14&quot; in namespace kube-system with the configuration for the kubelets in the cluster<br>[upload-certs] Skipping phase. Please see --experimental-upload-certs<br>[mark-control-plane] Marking the node node1 as control-plane by adding the label &quot;node-role.kubernetes.io/master=&#39;&#39;&quot;<br>[mark-control-plane] Marking the node node1 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]<br>[bootstrap-token] Using token: kakych.0ebc0g9vbl6xo8hp<br>[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles<br>[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials<br>[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token<br>[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster<br>[bootstrap-token] creating the &quot;cluster-info&quot; ConfigMap in the &quot;kube-public&quot; namespace<br>[addons] Applied essential addon: CoreDNS<br>[addons] Applied essential addon: kube-proxy</pre><pre>Your Kubernetes control-plane has initialized successfully!</pre><pre>To start using your cluster, you need to run the following as a regular user:</pre><pre>mkdir -p $HOME/.kube<br>  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>  sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><pre>You should now deploy a pod network to the cluster.<br>Run &quot;kubectl apply -f [podnetwork].yaml&quot; with one of the options listed at:<br>  <a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/">https://kubernetes.io/docs/concepts/cluster-administration/addons/</a></pre><pre>Then you can join any number of worker nodes by running the following on each as root:</pre><pre>kubeadm join 192.168.56.2:6443 --token kakych.0ebc0g9vbl6xo8hp \<br>    --discovery-token-ca-cert-hash sha256:8a0feaa2cea150cadb56f36f39c18cc5650852faee252092d39298ccda928344</pre><p>위 출력된 결과중 마지막 라인 <strong>kubeadm join…</strong> 이부분은 Worker 노드에서 k8s 클러스터에 조인할 때 사용됩니다. k8s 클러스터 관리 사용자 계정인 <strong>k8s-admin</strong> 으로 서버에 로그인 합니다.</p><pre>k8s-admin@node1:~$</pre><p>k8s Master 노드에 접속하기 위해 설정 정보를 <strong>k8s-admin</strong> 계정에 설정합니다.</p><pre>k8s-admin@node1:~$ \rm -rf $HOME/.k8s<br>k8s-admin@node1:~$ mkdir -p $HOME/.k8s<br>k8s-admin@node1:~$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.k8s/config<br>k8s-admin@node1:~$ sudo chown $(id -u):$(id -g) $HOME/.k8s/config<br>k8s-admin@node1:~$ export KUBECONFIG=$HOME/.k8s/config<br>k8s-admin@node1:~$ echo &quot;export KUBECONFIG=$HOME/.k8s/config&quot; | tee -a ~/.bashrc</pre><h3>5. Calico Pod Network 배포하기</h3><p>CNI(Container Network Interface)는 컨테이너와 컨테이너 네트워크 구현체 사이의 표준 API 입니다.</p><ul><li>Introduction to the Container Network Interface (CNI) — <a href="https://www.slideshare.net/weaveworks/introduction-to-the-container-network-interface-cni">https://www.slideshare.net/weaveworks/introduction-to-the-container-network-interface-cni</a></li><li>Cluster Networking — <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/">https://kubernetes.io/docs/concepts/cluster-administration/networking/</a></li></ul><p>CNI 구현체는 ACI, Weave Net, Calico등등 다양하게 지원하고 있으며 이 문서에서는 Calico 프로젝트를 이용해서 구현하는 방법에 대하여 설명합니다.</p><pre>k8s-admin@node1:~$ wget wget <a href="https://docs.projectcalico.org/v3.7/manifests/calico.yaml">https://docs.projectcalico.org/v3.7/manifests/calico.yaml</a></pre><pre>k8s-admin@node1:~$ vi calico.yaml<br> - name: CALICO_IPV4POOL_CIDR<br>              value: &quot;10.100.0.0/16&quot; # POD Network CIDR로 변경합니다<br>​<br>k8s-admin@node1:~$ kubectl apply -f calico.yaml</pre><p>정상적으로 Calico Pod 이 실행되는 지 아래 명령어로 확인합니다.</p><pre>k8s-admin@node1:~$ watch kubectl get pods --all-namespaces<br>Every 2.0s: kubectl get pods --all-namespaces                            Tue Apr 16 00:27:49 2019</pre><pre>NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE<br>kube-system   calico-kube-controllers-f6ff9cbbb-tbfcn   1/1     Running   0          28m<br>kube-system   calico-node-d6np5                         1/1     Running   0          28m<br>kube-system   coredns-584795fc57-6h4hd                  1/1     Running   2          28m<br>kube-system   coredns-584795fc57-r7xk7                  1/1     Running   2          28m<br>kube-system   etcd-node1                                1/1     Running   0          27m<br>kube-system   kube-apiserver-node1                      1/1     Running   0          25m<br>kube-system   kube-controller-manager-node1             1/1     Running   1          27m<br>kube-system   kube-proxy-6679q                          1/1     Running   0          28m<br>kube-system   kube-scheduler-node1                      1/1     Running   1          27m</pre><p>Calico Pod이 정상적으로 실행된 경우 <strong>STATUS</strong> 값이 Running으로 출력됩니다. 오류가 발생한 경우 <strong>kubectl describe</strong> 명령어를 사용하여 해당 컨테이너의 상태를 확인하여 조치를 취합니다.</p><p>Master 노드에도 Pod을 배포하려면 아래와 같은 명령어를 실행합니다.</p><pre>k8s-admin@master:~$ kubectl taint nodes --all node-role.kubernetes.io/master-<br>node/node1 untainted</pre><h3>6. k8s 초기화 — Worker 노드</h3><p>Master노드에서 k8s 클러스터 초기화후 화면에 출력된 <strong>kubeadm join</strong> 명령어를 k8s 클러스터에 조인하려는 Workder 노드에서<strong> root권한</strong>으로 실행합니다.</p><pre>root@node2:~# kubeadm join 192.168.56.2:6443 --token kakych.0ebc0g9vbl6xo8hp \<br>    --discovery-token-ca-cert-hash sha256:8a0feaa2cea150cadb56f36f39c18cc5650852faee252092d39298ccda928344<br>[preflight] Running pre-flight checks<br>[preflight] Reading configuration from the cluster...<br>[preflight] FYI: You can look at this config file with &#39;kubectl -n kube-system get cm kubeadm-config -oyaml&#39;<br>[kubelet-start] Downloading configuration for the kubelet from the &quot;kubelet-config-1.14&quot; ConfigMap in the kube-system namespace<br>[kubelet-start] Writing kubelet configuration to file &quot;/var/lib/kubelet/config.yaml&quot;<br>[kubelet-start] Writing kubelet environment file with flags to file &quot;/var/lib/kubelet/kubeadm-flags.env&quot;<br>[kubelet-start] Activating the kubelet service<br>[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...</pre><pre>This node has joined the cluster:<br>* Certificate signing request was sent to apiserver and a response was received.<br>* The Kubelet was informed of the new secure connection details.</pre><pre>Run &#39;kubectl get nodes&#39; on the control-plane to see this node join the cluster.</pre><p>Master 노드에서 아래 명령어로 노드 상태를 확인합니다.</p><pre>k8s-admin@node1:~$ kubectl get no<br>NAME    STATUS   ROLES    AGE    VERSION<br>node1   Ready    master   22m    v1.14.1<br>node2   Ready    &lt;none&gt;   9m4s   v1.14.1</pre><h3>7. Pod 테스트</h3><p>k8s 클러스터가 정상적으로 구성되었는 지 Busybox Pod을 배포합니다. Busybox 컨테이너는 CLI 역할을 합니다.</p><pre>k8s-admin@node1:~$ wget <a href="https://raw.githubusercontent.com/infrabricks/kubernetes-standalone/master/examples/busybox.yml">https://raw.githubusercontent.com/infrabricks/kubernetes-standalone/master/examples/busybox.yml</a><br>​<br>k8s-admin@node1:~$ vi busybox.yml<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: busybox<br>  namespace: default<br>spec:<br>  containers:<br>  - image: busybox:1.28 # 1.28 버전 사용. 다른 버전 nslookup 오류<br>    command:<br>      - sleep<br>      - &quot;3600&quot;<br>    imagePullPolicy: IfNotPresent<br>    name: busybox<br>  restartPolicy: Always<br>  <br>k8s-admin@node1:~$ kubectl apply -f busybox.yml<br>pod/busybox created<br>k8s-admin@node1:~$ kubectl get pod<br>NAME                       READY   STATUS        RESTARTS   AGE<br>busybox                    1/1     Running       0          95s<br>​<br>k8s-admin@node1:~$ kubectl exec -it busybox -- nslookup google.com<br>Server:    10.96.0.10<br>Address 1: 10.96.0.10 kube-dns.kube-system.svc.k8s.local<br>​<br>Name:      google.com<br>Address 1: 2404:6800:4008:c06::8a tk-in-x8a.1e100.net<br>Address 2: 64.233.188.102 tk-in-f102.1e100.net<br>Address 3: 64.233.188.101 tk-in-f101.1e100.net<br>Address 4: 64.233.188.138 tk-in-f138.1e100.net<br>Address 5: 64.233.188.113 tk-in-f113.1e100.net<br>Address 6: 64.233.188.139 tk-in-f139.1e100.net<br>Address 7: 64.233.188.100 tk-in-f100.1e100.net<br>​<br>k8s-admin@node1:~$ kubectl exec -it busybox -- nslookup busybox<br>Server:    10.96.0.10<br>Address 1: 10.96.0.10 kube-dns.kube-system.svc.k8s.local<br>​<br>Name:      busybox<br>Address 1: 192.168.166.210 busybox</pre><h3>8. k8s 클러스터 삭제</h3><p>k8s 클러스터 삭제를 하기 위해서는 각 노드(Master, Worker)에서 <strong>root권한</strong>으로 아래 명령어를 실행합니다.</p><pre>root@node1:~# kubeadm reset<br>root@node1:~# iptables -F &amp;&amp; iptables -t nat -F &amp;&amp; iptables -t mangle -F &amp;&amp; iptables -X</pre><pre>root@node2:~# kubeadm reset<br>root@node2:~# iptables -F &amp;&amp; iptables -t nat -F &amp;&amp; iptables -t mangle -F &amp;&amp; iptables -X</pre><h3>#참고 문서</h3><ul><li><a href="https://computingforgeeks.com/how-to-setup-3-node-kubernetes-cluster-on-ubuntu-18-04-with-weave-net-cni/">https://computingforgeeks.com/how-to-setup-3-node-kubernetes-cluster-on-ubuntu-18-04-with-weave-net-cni/</a></li><li><a href="https://arisu1000.tistory.com/27828">https://arisu1000.tistory.com/27828</a></li><li><a href="https://www.slideshare.net/JamesAhn/k8s-06-sample">https://www.slideshare.net/JamesAhn/k8s-06-sample</a></li><li><a href="https://hiseon.me/2018/08/23/ubuntu-kubernetes-install/">https://hiseon.me/2018/08/23/ubuntu-kubernetes-install/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc64e2fb44ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[쿠버네티스(k8s) — 오프라인에서 CoreDNS 운영을 위한 설정]]></title>
            <link>https://yunhochung.medium.com/%EC%BF%A0%EB%B2%84%EB%84%A4%ED%8B%B0%EC%8A%A4-k8s-%EC%98%A4%ED%94%84%EB%9D%BC%EC%9D%B8%EC%97%90%EC%84%9C-coredns-%EC%9A%B4%EC%98%81%EC%9D%84-%EC%9C%84%ED%95%9C-%EC%84%A4%EC%A0%95-ae2c185d426c?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae2c185d426c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[coredns]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Sun, 14 Apr 2019 15:15:01 GMT</pubDate>
            <atom:updated>2019-04-14T15:15:01.915Z</atom:updated>
            <content:encoded><![CDATA[<h3>쿠버네티스(k8s) — 오프라인에서 CoreDNS 운영을 위한 설정</h3><p>k8s 클러스터 구성시 배포되는 CoreDNS pod에 기본적으로 upstream DNS 서버를 사용하게 되어있어 인터넷 접속이 되지 않는 오프라인 환경에서는 정상적으로 실행되지 않습니다.</p><pre>$ kubectl get pods --all-namespaces<br>NAMESPACE     NAME                                 READY   STATUS             RESTARTS   AGE<br>kube-system   coredns-576cbf47c7-822v6             0/1     CrashLoopBackOff   11         24m<br>kube-system   coredns-576cbf47c7-n9tw9             0/1     CrashLoopBackOff   11         24m<br>kube-system   etcd-k8s-master                      1/1     Running            1          23m<br>kube-system   kube-apiserver-k8s-master            1/1     Running            1          23m<br>kube-system   kube-controller-manager-k8s-master   1/1     Running            1          23m<br>kube-system   kube-flannel-ds-amd64-qbff2          1/1     Running            1          20m<br>kube-system   kube-proxy-4bbbk                     1/1     Running            1          24m<br>kube-system   kube-scheduler-k8s-master            1/1     Running            1          23m</pre><p>오프라인 환경에서 CoreDNS를 사용하기 위해 CoreDNS의 ConfigMAP을 아래와 같이 수정해야 합니다.</p><pre>$ kubectl -n kube-system edit configmap coredns<br># .:53 섹션 내용만 아래와 같이 변경합니다.<br># 변경 내용 저장 후 자동으로 CoreDNS Pod이 재 배포되나 수분이 지나도 안되는 경우 해당 Pod을 삭제하시면 됩니다.</pre><pre>.:53 {<br>    errors<br>    health<br>    kubernetes cluster.local in-addr.arpa ip6.arpa {<br>       pods insecure<br>    }<br>    prometheus :9153<br>    cache 30<br>    reload<br>    loadbalance<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae2c185d426c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ubuntu NTP 클라이언트, 서버 구성]]></title>
            <link>https://yunhochung.medium.com/ubuntu-ntp-%ED%81%B4%EB%9D%BC%EC%9D%B4%EC%96%B8%ED%8A%B8-%EC%84%9C%EB%B2%84-%EA%B5%AC%EC%84%B1-72fec40b3b7a?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72fec40b3b7a</guid>
            <category><![CDATA[ntp]]></category>
            <category><![CDATA[ubuntu-server]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Wed, 03 Apr 2019 05:43:52 GMT</pubDate>
            <atom:updated>2019-04-03T05:43:52.259Z</atom:updated>
            <content:encoded><![CDATA[<p>외부 네트워크와 단절된 환경에서 클러스터링 구성시 각 서버간의 시간 동기화가 필요하다. 시간 동기화를 위해 보통 NTP(Network Time Protocol)를 사용한다.</p><h3>NTP 프로그램(데몬) 설치</h3><p>각 서버에 ntp 프로그램(데몬)을 설치한다.</p><pre>$ apt-get install ntp</pre><h3>NTP 서버 구성</h3><p>NTP 서버 역할을 하게될 서버의 설정을 아래와 같이 변경한 후 NTP 데몬을 재시작한다.</p><pre>$ vi /etc/ntp.conf<br>server 127.127.1.0 # 로컬 NTP 서버. 127.0.0.1 이 아님<br>restrict default nomodify notrap noquery<br>restrict 127.0.0.1<br>restrict 192.168.137.0 mask 255.255.255.0 nomodify notrap # NTP서버에 접속할 클라이언트 네트워크</pre><pre>$ /etc/init.d/ntp restart<br>[ ok ] Restarting ntp (via systemctl): ntp.service.</pre><pre># timedatectl 데몬의 시간 동기화 중지<br>$ timedatectl set-ntp no </pre><h3>NTP 클라이언트 구성</h3><p>시간 동기화가 필요한 서버의 NTP 설정을 아래와 같이 변경 한 후 NTP 데몬을 재시작한다.</p><pre>$ vi /etc/ntp.conf<br>server 192.168.137.2 # NTP 서버 주소</pre><pre>$ /etc/init.d/ntp restart<br>[ ok ] Restarting ntp (via systemctl): ntp.service.</pre><pre># timedatectl 데몬의 시간 동기화 중지<br>$ timedatectl set-ntp no</pre><pre>$ ntpq -p<br>     remote           refid      st t when poll reach   delay   offset  jitter<br>==============================================================================<br>*node1           LOCAL(0)         6 u  313 1024  377    0.308   -0.008   0.026</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72fec40b3b7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[펌] Hyperledger Update for Q1 2019]]></title>
            <link>https://yunhochung.medium.com/%ED%8E%8C-hyperledger-update-for-q1-2019-1f17252aa879?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f17252aa879</guid>
            <category><![CDATA[hyperledger-fabric]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Fri, 29 Mar 2019 23:09:15 GMT</pubDate>
            <atom:updated>2019-03-29T23:09:15.953Z</atom:updated>
            <content:encoded><![CDATA[<p>[펌] Hyperledger Update for Q1 2019</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fembed%3Fid%3D1rE6KSdJnF8MZkgQ42T_hktGbzK3mdbYmUyqZ3x6y6fc%26size%3Dl&amp;url=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fd%2F1rE6KSdJnF8MZkgQ42T_hktGbzK3mdbYmUyqZ3x6y6fc%2Fedit&amp;image=https%3A%2F%2Flh4.googleusercontent.com%2FaxEBDUwLqZLA8bMYVkV0wMKpvOdmwieyFrnozV-q2Ai0NFBKlDOAW1rxZQcgqhnBYdXXSQ%3Dw1200-h630-p&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=google" width="700" height="559" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe70cb2b0d5af43a5514454cf745ac50/href">https://medium.com/media/fe70cb2b0d5af43a5514454cf745ac50/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f17252aa879" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[펌] Hyperlegder Fabric 1.4— Private Data collection Hands-on]]></title>
            <link>https://yunhochung.medium.com/%ED%8E%8C-hyperlegder-fabric-v1-4-private-data-collection-hands-on-d0e1f810912b?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0e1f810912b</guid>
            <category><![CDATA[hyperledger-fabric]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Fri, 29 Mar 2019 08:30:07 GMT</pubDate>
            <atom:updated>2019-03-29T23:09:56.471Z</atom:updated>
            <content:encoded><![CDATA[<p>[펌] Hyperlegder Fabric 1.4— Private Data collection Hands-on</p><p><a href="https://hackernoon.com/understanding-blockchain-private-data-a-hands-on-example-eacc3efe4ad6">Understanding Blockchain Private Data. A Hands-on Example</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0e1f810912b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[펌] Cloud-Native Development Tools with k8s]]></title>
            <link>https://yunhochung.medium.com/%ED%8E%8C-cloud-native-development-toos-with-k8s-839d6e09e219?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/839d6e09e219</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Fri, 29 Mar 2019 07:11:03 GMT</pubDate>
            <atom:updated>2019-04-03T05:03:32.432Z</atom:updated>
            <content:encoded><![CDATA[<p>[펌] Cloud-Native Development Tools with k8s</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2F138dL1Oha5O4Mx&amp;url=https%3A%2F%2Fwww.slideshare.net%2FGyuSeokLee1%2Fkubernetes-cloud-native-development-tools-k8s-day-korea-2019-gyuseok-lee%3Ffrom_m_app%3Dios&amp;image=https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fkubernetescloud-nativedevelopmenttoolsk8sdaykoreagyuseoklee20190329v1-190329044934-thumbnail-4.jpg%3Fcb%3D1553835584&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4d1d8636d305d41533bbc83bb063681/href">https://medium.com/media/f4d1d8636d305d41533bbc83bb063681/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=839d6e09e219" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[펌] 모두를 위한 딥러닝 시즌 2]]></title>
            <link>https://yunhochung.medium.com/%ED%8E%8C-%EB%AA%A8%EB%91%90%EB%A5%BC-%EC%9C%84%ED%95%9C-%EB%94%A5%EB%9F%AC%EB%8B%9D-%EC%8B%9C%EC%A6%8C-2-ac6df90a2d51?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac6df90a2d51</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Thu, 28 Mar 2019 08:44:18 GMT</pubDate>
            <atom:updated>2019-03-28T08:44:18.045Z</atom:updated>
            <content:encoded><![CDATA[<p>[펌] 모두를 위한 딥러닝 시즌 2</p><p><a href="https://deeplearningzerotoall.github.io/season2/">모두를 위한 딥러닝 시즌 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac6df90a2d51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[펌] Optimizing Go code without a blindfold]]></title>
            <link>https://yunhochung.medium.com/%ED%8E%8C-optimizing-go-code-without-a-blindfold-af4f0c99350f?source=rss-7a5cc655e81c------2</link>
            <guid isPermaLink="false">https://medium.com/p/af4f0c99350f</guid>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Yunho Chung]]></dc:creator>
            <pubDate>Thu, 28 Mar 2019 08:38:55 GMT</pubDate>
            <atom:updated>2019-03-28T08:38:55.588Z</atom:updated>
            <content:encoded><![CDATA[<p>[펌] Optimizing Go code without a blindfold</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fembed%3Fid%3D1cUVp8OuzOW4lzClsiptgacW7nSFkcgvhLRVAOgVPpYg%26size%3Dl&amp;url=https%3A%2F%2Fdocs.google.com%2Fpresentation%2Fd%2F1cUVp8OuzOW4lzClsiptgacW7nSFkcgvhLRVAOgVPpYg%2Fmobilepresent%3Fslide%3Did.g54b9fd6434_0_52&amp;image=https%3A%2F%2Flh5.googleusercontent.com%2Fr09UKa5ym3qVTWQqzkyapvE2d-OrR-PcycHyI-rOt1u2s1JGwHl8vP-VMeyGAalF38kpig%3Dw1200-h630-p&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=google" width="700" height="559" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ac09060c2e87a1ccb5cbb701263ae6a/href">https://medium.com/media/4ac09060c2e87a1ccb5cbb701263ae6a/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af4f0c99350f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>