[
https://issues.apache.org/jira/browse/HDDS-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262754#comment-17262754
]
Janus Chow commented on HDDS-4289:
----------------------------------
Thanks [~elek] .
I was trying to do the unit test by raising a request with Hadoop27RpcTransport
to a HA-OM cluster, but the original construction of OjectStore gets Class
loading problem, caused by the META-INF.service config. Could you give some
advice?
{code:java}
# org.apache.hadoop.ozone.om.TestOzoneManagerHAWithData
@Test
public void testNonOMHAClientOnHACluster() throws IOException {
ClientId clientId = ClientId.randomId();
UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
ObjectStore objectStore = getObjectStore();
// Get the leader OM
String leaderOMNodeId = OmFailoverProxyUtil
.getFailoverProxyProvider(objectStore.getClientProxy())
.getCurrentProxyOMNodeId();
OzoneManager leaderOM = getCluster().getOzoneManager(leaderOMNodeId);
// Get follower OMs
String followerOM1NodeId = leaderOM.getPeerNodes().get(0).getOMNodeId();
String serviceId = leaderOM.getOMServiceId();
OzoneConfiguration nonOMHAConf = getConf();
String followerOM1AddressConfKey = OmUtils.addKeySuffixes(
OMConfigKeys.OZONE_OM_ADDRESS_KEY, serviceId, followerOM1NodeId);
nonOMHAConf.set(OMConfigKeys.OZONE_OM_ADDRESS_KEY,
getConf().get(followerOM1AddressConfKey));
OmTransport transport = new Hadoop27OmTransportFactory()
.createOmTransport(nonOMHAConf, ugi, serviceId);
OzoneManagerProtocol ozoneManagerClient =
new OzoneManagerProtocolClientSideTranslatorPB(
transport, clientId.toString());
String ownerName = "owner" + RandomStringUtils.randomNumeric(5);
String adminName = "admin" + RandomStringUtils.randomNumeric(5);
String volumeName = "volume" + RandomStringUtils.randomNumeric(5);
OmVolumeArgs omVolumeArgs = new OmVolumeArgs.Builder().setVolume(volumeName)
.setAdminName(adminName).setCreationTime(Time.now())
.setOwnerName(ownerName).build();
try {
ozoneManagerClient.createVolume(omVolumeArgs);
} catch (IOException e){
GenericTestUtils.assertExceptionContains(
"Hadoop2 Filesystem jar doesn't support OM-HA", e);
}
}
{code}
> Throw exception from hadoop2 filesystem jar in HA environment
> -------------------------------------------------------------
>
> Key: HDDS-4289
> URL: https://issues.apache.org/jira/browse/HDDS-4289
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: OM HA
> Reporter: Marton Elek
> Assignee: Janus Chow
> Priority: Major
> Labels: newbie
>
> Thanks for Tamas Pleszkan for reporting this problem.
> ozone-filesystem-hadoop2 doesn't support OM-HA (today) as the used
> Hadoop3OmTransport uses FailoverProxyProvider which is not available in
> hadoop2.
> Long-term we need a custom failover mechanism, but this jira suggests to
> improve the error handling. `Hadoop27OmTransportFactory` should throw an
> exception if HA is used.
> Used command:
> {code}
> spark-submit --master yarn --deploy-mode client --executor-memory 1g --conf
> "spark.yarn.access.hadoopFileSystems=o3fs://bucket.hdfs.ozone1/" --jars
> "/opt/cloudera/parcels/CDH-7.1.3-1.cdh7.1.3.p0.4992530/jars/hadoop-ozone-filesystem-hadoop2-0.5.0.7.1.3.0-100.jar"
> SparkWordCount.py o3fs://bucket.hdfs.ozone1/words 2
> {code}
> Current exception:
> {code}
> Caused by:
> org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ozone.om.exceptions.OMNotLeaderException):
> OM:om2 is not the leader. Suggested leader is OM:om1.
> {code}
> Expected exception: Unsupported operation exception with meaningful hint to
> use hadoop3 filesystem jar.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]