peer와 orderer의 설정 파일에서 listenAddress, metrics provider와 TLS 설정을 확인 및 변경한다.
peer: fabric-samples/config/core.yaml
################################################################################# Operations section################################################################################operations:# host and port for the operations serverlistenAddress:127.0.0.1:9443# TLS configuration for the operations endpointtls:# TLS enabledenabled:false# path to PEM encoded server certificate for the operations servercert:file:# path to PEM encoded server key for the operations serverkey:file:# most operations service endpoints require client authentication when TLS# is enabled. clientAuthRequired requires client certificate authentication# at the TLS layer to access all resources.clientAuthRequired:false# paths to PEM encoded ca certificates to trust for client authenticationclientRootCAs:files: []################################################################################# Metrics section################################################################################metrics:# metrics provider is one of statsd, prometheus, or disabledprovider:prometheus# statsd configurationstatsd:# network type: tcp or udpnetwork:udp# statsd server addressaddress:127.0.0.1:8125# the interval at which locally cached counters and gauges are pushed# to statsd; timings are pushed immediatelywriteInterval:10s# prefix is prepended to all emitted statsd metricsprefix:
orderer: fabric-samples/config/orderer.yaml
################################################################################## Orderer Configuration## - This controls the type and configuration of the orderer.#################################################################################General:# Listen address: The IP on which to bind to listen. (Prometheus)ListenAddress:127.0.0.1:8443# Listen port: The port on which to bind to listen.ListenPort:7050# TLS: TLS settings for the GRPC server.TLS:Enabled:false# PrivateKey governs the file location of the private key of the TLS certificate.PrivateKey:tls/server.key# Certificate governs the file location of the server TLS certificate.Certificate:tls/server.crtRootCAs: - tls/ca.crtClientAuthRequired:falseClientRootCAs:################################################################################# Metrics section################################################################################metrics:# metrics provider is one of statsd, prometheus, or disabledprovider:prometheus# statsd configurationstatsd:# network type: tcp or udpnetwork:udp# statsd server addressaddress:127.0.0.1:8125# the interval at which locally cached counters and gauges are pushed# to statsd; timings are pushed immediatelywriteInterval:10s# prefix is prepended to all emitted statsd metricsprefix:
모니터링을 위한 container(peer 및 orderer) 환경 변수 설정: ~/fabric-samples/first-network/base/docker-compose-base.yaml
CORE_OPERATIONS_LISTENADDRESS
CORE_METRICS_PROVIDER
# 환경 변수 설정 1(orderer)orderer.example.com:container_name:orderer.example.comextends:file:peer-base.yamlservice:orderer-baseenvironment: - ORDERER_OPERATIONS_LISTENADDRESS=orderer.example.com:8443 - ORDERER_METRICS_PROVIDER=prometheusvolumes: - ../channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block - ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp - ../crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls - orderer.example.com:/var/hyperledger/production/ordererports: - 7050:7050# 환경 변수 설정 2(아래는 peer0.org1.example.com): 모니터링을 원하는 피어의 environmnet 섹션에 환경 변수를 동일하게 추가peer0.org1.example.com:container_name:peer0.org1.example.comextends:file:peer-base.yamlservice:peer-baseenvironment: - CORE_PEER_ID=peer0.org1.example.com - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 - CORE_PEER_LISTENADDRESS=0.0.0.0:7051 - CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052 - CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052 - CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:8051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 - CORE_PEER_LOCALMSPID=Org1MSP - CORE_OPERATIONS_LISTENADDRESS=peer0.org1.example.com:9443 - CORE_METRICS_PROVIDER=prometheusvolumes: - /var/run/:/host/var/run/ - ../crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp - ../crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls - peer0.org1.example.com:/var/hyperledger/productionports: - 7051:7051