참고url)

Getting Start : https://docs.hazelcast.com/imdg/latest/getting-started.html

Download : https://hazelcast.org/imdg/download/

https://stackoverflow.com/questions/62828652/how-to-install-hazelcast-imdg-in-ubuntu-server

 

 

설치)

wget -qO - https://repository.hazelcast.com/api/gpg/key/public | sudo apt-key add -
echo "deb https://repository.hazelcast.com/debian stable main" | sudo tee -a /etc/apt/sources.list
sudo apt update && sudo apt install hazelcast

 

터미널3개 창을 열고 hz start 실행하여 Creating a Cluster.

 

 

java client source : 

//Installation notes: You have to have Hazelcast Java Client on the classpath.
//The simplest way of doing it is to put `hazelcast-all` JAR
//on the classpath, e.g. via Maven. See "Installation" chapter for details.

import com.hazelcast.client.HazelcastClient;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;

public class TesterFile {
 public static void main(String[] args) {
     // Start the client and connect to the cluster
     HazelcastInstance hz = HazelcastClient.newHazelcastClient();
     // Create a Distributed Map in the cluster
     IMap map = hz.getMap("my-distributed-map");
     //Standard Put and Get
     map.put("1", "John");
     map.put("2", "Mary");
     map.put("3", "Jane");
     // Shutdown the client
//     hz.shutdown();
    
 }

> java application으로 2회실행.

 

Cluster 관리화면

 

 

 

1. geth 

geth 란,  "go-ethereum"의 약자로 client software로 Go언어로 개발되었다.

 

dcans@dcans:~$ sudo apt-get install software-properties-common
dcans@dcans:~$ sudo add-apt-repository -y ppa:ethereum/ethereum
dcans@dcans:~$ sudo apt-get install ethereum     
dcans@dcans:~$ geth version
Geth
Version: 1.10.14-stable
Git Commit: 11a3a35097ec493d71137c9bfa433bceeedff6c0
Architecture: amd64
Go Version: go1.17.5
Operating System: linux
GOPATH=
GOROOT=go
dcans@dcans:~$ geth console
.... exit명령으로 중단
INFO [12-26|13:47:33.641] Blockchain stopped 

 

 

refer : https://roots2019.tistory.com/251

          https://steemit.com/@pangol

 

블록체인 Dapp 만들기 #1

블록체인 기반 탈중앙형 플랫폼 비즈니스 서비스를 만들어 보고자 합니다. 블록체인은 매일 큰 이슈를 불러오고 있는데 정작 그 기술과 쓰임새를 제대로 이해하는 사람들은 없는 것 같아 아쉬

roots2019.tistory.com

 

2. truffle 

truffle : ethereum framework, solidity소스코드 compile, deploy작업 지원.

             smart contract를 쉽게 테스트 할 수 있는 방법제공.

 

~ npm install -g truffle

dcans@dcans:~$ truffle version
Truffle v5.4.26 (core: 5.4.26)
Solidity v0.5.16 (solc-js)
Node v10.19.0
Web3.js v1.5.3
dcans@dcans:~$ 

 

3. ganache-cli 설치

ganache란, 가나슈는 이더리움 기반 블록체인 디앱 개발에 사용하는 개인용 블록체인으로 테스트 목적으로 PC에 설치해서 사용할 수 있다.

 

dcans@dcans:~$ sudo npm install -g ganache-cli
/usr/local/bin/ganache-cli -> /usr/local/lib/node_modules/ganache-cli/cli.js

> keccak@3.0.1 install /usr/local/lib/node_modules/ganache-cli/node_modules/keccak
> node-gyp-build || exit 0


> secp256k1@4.0.2 install /usr/local/lib/node_modules/ganache-cli/node_modules/secp256k1
> node-gyp-build || exit 0

+ ganache-cli@6.12.2
added 101 packages from 182 contributors in 11.529s
dcans@dcans:~$ 

 

dcans@dcans:~$ ganache-cli version
Ganache CLI v6.12.2 (ganache-core: 2.13.2)

Available Accounts (10개의 테스트 계정)
==================
(0) 0x98E804A6984c405B60c39bA7A2896f11EfAFfceb (100 ETH)
(1) 0xa27342217C808c5D044fff5AbcDA3f9C0ba4D154 (100 ETH)
(2) 0xA393dD19711014F75dDeFb954759737FD2B4329C (100 ETH)
(3) 0xE4132911167e4412B0492Dca731ffAEb64Eaa93f (100 ETH)
(4) 0x85151de1AF1a885A5c8B49b27cf2C4927f78CFe5 (100 ETH)
(5) 0x936208e2D3498502F00919bFc589d77e1109248A (100 ETH)
(6) 0x585B2BA68133eE15BcC90777Bd99c4FE3ACBBf10 (100 ETH)
(7) 0x7FbcF7598F1029645f3cf68818C65bDBacfea307 (100 ETH)
(8) 0x9A5a065E805f73eD70d71A5D7Ed81Ef94d81E6b4 (100 ETH)
(9) 0x3C4A081378408F43b46e911271C4C7564892d0eA (100 ETH)

Private Keys
==================
(0) 0xec80c48e6d27c664c4162d843cdb1b17f6fa24aab5ac73da637636514aca662f
(1) 0xe3392e20c260f732cf716bf821e984e8f2d34f0e6c5bb0df200d2886ea7e420f
(2) 0x201d570ef89b92c2451df91459842b8ec8460ac59ed7b0b2015005b6327c598f
(3) 0xbcde4e1f21920a01ebb5b9fea0e3d15ed2df0c56b5cbea906ab97b7a16b4c476
(4) 0xaa94bde342ad9e030084bfc47429eb81c6256c8603ead0bd7b72f3a55227d285
(5) 0x78cd50e2885d606726960ccdb8f6b2e3445a9d28ba143fd2eabd2dd68d981012
(6) 0x6841b44ffd2546fea33f00e2a695e81d1ca7e0eaf03a9c4d7d80445be6d6e123
(7) 0x5adb03c74394f864420ea39aeb827ed0622bfdcae2b97e62b59c3ae11c72d6c7
(8) 0xd97c2572e4a1fe26f42e8e0c5f64f1329053e80884bb59eb77c593f1813c6748
(9) 0x958aba2a124d004d103d714cec39e042d673ef95b97634ad76371ed6a54b623e

HD Wallet
==================
Mnemonic:      sorry tragic keep tank glow where apology surprise stem dragon found daring
Base HD Path:  m/44'/60'/0'/0/{account_index}

Gas Price
==================
20000000000

Gas Limit
==================
6721975

Call Gas Limit
==================
9007199254740991

Listening on 127.0.0.1:8545

8545  => Json-RPC(remote procedure call)를 받아들이는 포트

 

refer : https://sabarada.tistory.com/12?category=792127

로그파일
 > kafka producer(broker에게 특정 topic에 대한 데이타 push)
 > kafka consumer는 broker에게 특정 topic을 pull로 가져감.

아래 예시는
"로그(consumer데이타) => FILE tail => kafka producer(broker에게 전달)" 파이프 라인으로
콘솔로 consumer를 모니터링 하고 해당 데이타를 pjm1.log파일로 저장
콘솔로 pruducer로 json데이타를 broker에게 전달. 해당데이타는 무한루프 로직으로 데이타 생성함.
 

 

 

comsumer콘솔 :

~/kafka/logs$ ~/kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic pjm1 --from-beginning > pjm1.log

 

producer콘솔 :
echo '[  {    "name": "jinmyung",    "age": 500,    "secretIdentity": "Andrew",    "powers": [      "Radiation resistance",      "Turning tiny",      "Radiation blast"    ]  }]'  | ~/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic pjm1

 

 

'빅데이타' 카테고리의 다른 글

streamsets 사용하기  (0) 2021.11.21
kafka 설치 및 실행  (0) 2021.11.21

+ Recent posts