首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    E往无前 | 人人在用的微信支付,腾讯云大数据ES如何让它低成本高可用?

    《E往无前》系列将着重展现腾讯云ES在持续深入优化客户所关心的「省!快!稳!」诉求,能够在低成本的同时兼顾高可用、高性能、高稳定等特性,可以满足微盟、小红书、微信支付等内外部大客户的核心场景需求。 E往无前 |  人人在用的微信支付,腾讯云大数据ES如何让它低成本高可用? 导语:微信支付是国家重要的关键信息基础设施,服务于几千万商户和上亿国民,可用性要求高于5个9。本案例重点介绍了ES在微信支付服务中满足金融账单数据需求的同时,如何进一步降低成本,提高可用性。 Elasticsearch(下文简称为ES)经

    02

    强制DataNode向NameNode上报blocks

    正常情况下,什么时候上报blocks,是由NameNode通过回复心跳响应的方式触发的。 一次机房搬迁中,原机房hadoop版本为2.7.2,新机房版本为2.8.0,采用先扩容再缩容的方式搬迁。由于新旧机房机型不同和磁盘数不同,操作过程搞混过hdfs-site.xml,因为两种不同的机型,hdfs-site.xml不便做到相同,导致了NameNode报大量“missing block”。 然而依据NameNode所报信息,在DataNode能找到那些被标记为“missing”的blocks。修复配置问题后,“missing block”并没有消失。结合DataNode源代码,估计是因为DataNode没有向NameNode上报blocks。 结合DataNode的源代码,发现了HDFS自带的工具triggerBlockReport,它可以强制指定的DataNode向NameNode上报块,使用方法为: hdfs dfsadmin -triggerBlockReport datanode_host:ipc_port 如:hdfs dfsadmin -triggerBlockReport 192.168.31.35:50020 正常情况下NameNode启动时,会要求DataNode上报一次blocks(通过fullBlockReportLeaseId值来控制),相关源代码如下: DataNode相关代码(BPServiceActor.java): private void offerService() throws Exception {     HeartbeatResponse resp = sendHeartBeat(requestBlockReportLease); // 向NameNode发向心跳     long fullBlockReportLeaseId = resp.getFullBlockReportLeaseId(); // 心跳响应     boolean forceFullBr = scheduler.forceFullBlockReport.getAndSet(false); // triggerBlockReport强制上报仅一次有效     if (forceFullBr) {         LOG.info("Forcing a full block report to " + nnAddr);     }     if ((fullBlockReportLeaseId != 0) || forceFullBr) {         cmds = blockReport(fullBlockReportLeaseId);         fullBlockReportLeaseId = 0;     } } // NameNode相关代码(FSNamesystem.java): /** * The given node has reported in.  This method should: * 1) Record the heartbeat, so the datanode isn't timed out * 2) Adjust usage stats for future block allocation *  * If a substantial amount of time passed since the last datanode  * heartbeat then request an immediate block report.   *  * @return an array of datanode commands  * @throws IOException */ HeartbeatResponse handleHeartbeat(DatanodeRegistration nodeReg,   StorageReport[] reports, long cacheCapacity, long cacheUsed,   int xceiverCount, int xmitsInProgress, int failedVolumes,   VolumeFailureSummary volumeFailureSummary,   boolean requestFullBlockReportLease) throws IOException {     readLock();     try {         //get datanode commands         final int maxTransfer = blockManager.getMaxReplicat

    02
    领券