如何在RegionServer中强制区域脱机?

时间:2019-06-21 23:50:39

标签: hbase

最近的构建版本引起了一个问题,其中某些区域保持离线状态。 HBase不会自动重新分配它们,因此需要人工干预才能将它们带入。我正在尝试调查此问题,并且需要复制这种情况,在这种情况下,我需要强制脱机分配某些区域,而HBase Master不会自动将其调出。

我正在使用的HBase版本是0.98。我知道我尝试了一种import os import glob from pathlib import Path import pandas as pd import pandas import csv import numpy as np from pandas import DataFrame import sys, argparse, csv hashes=pd.read_csv(r'C:\Users\Sajid\Desktop\original.csv', usecols=[0]) #hashes in original.csv names=pd.read_csv(r'C:\Users\Sajid\Desktop\original.csv', usecols=[1]) this=pd.read_csv(r'C:\Users\Sajid\Desktop\csv files\modifiedFlights.csv', usecols=[4])# hashes in modifiedFlights.csv for i in hashes: for y in this: if i == y: results_row=pd.read_csv(r'C:\Users\Sajid\Desktop\original.csv', usecols=[1], userows=[i]) with open(r'C:\Users\Sajid\Desktop\csv files\modifiedFlights.csv','r') as csvinput: with open(r'C:\Users\Sajid\Desktop\out.csv', 'w') as csvoutput: writer = csv.writer(csvoutput) for row in csv.reader(csvinput): writer.writerow(row+[result_row]) 方法,但是该区域仍然保持活动状态。基本上,我想做的就是将其脱机,然后使用offline函数,以便主机了解它并随机分配一个区域。

unassign

我检查了日志的输出,它使许多区域脱机,但是值private void bringRegionOffline(HBaseAdmin admin, HRegionInfo hri) { Random rand = new Random(); if (rand.nextBoolean()) { try { admin.offline(hri.getRegionName()); } catch (IOException e) {} } } // The following code snippet is what gets executed on a daemon thread every 30 seconds. I set it up so it only runs once. for (TableName tn : admin.listTableNames()) { for (HRegionInfo hri : admin.getTableRegions(tn)) { bringRegionOffline(admin, hri); LOGGER.info("{} bought offline. Status now is: {}", hri.getRegionNameAsString(), hri.isOffline()); } } 始终为false。

0 个答案:

没有答案