HDFS-10361. Support starting StorageContainerManager as a daemon. (Contributed by Arpit Agarwal)
This commit is contained in:
parent
78bd1b2ab2
commit
63a6a1d732
|
@ -52,6 +52,7 @@ function hadoop_usage
|
||||||
hadoop_add_subcommand "oiv_legacy" "apply the offline fsimage viewer to a legacy fsimage"
|
hadoop_add_subcommand "oiv_legacy" "apply the offline fsimage viewer to a legacy fsimage"
|
||||||
hadoop_add_subcommand "oz" "command line interface for ozone"
|
hadoop_add_subcommand "oz" "command line interface for ozone"
|
||||||
hadoop_add_subcommand "portmap" "run a portmap service"
|
hadoop_add_subcommand "portmap" "run a portmap service"
|
||||||
|
hadoop_add_subcommand "scm" "run the Storage Container Manager service"
|
||||||
hadoop_add_subcommand "secondarynamenode" "run the DFS secondary namenode"
|
hadoop_add_subcommand "secondarynamenode" "run the DFS secondary namenode"
|
||||||
hadoop_add_subcommand "snapshotDiff" "diff two snapshots of a directory or diff the current directory contents with a snapshot"
|
hadoop_add_subcommand "snapshotDiff" "diff two snapshots of a directory or diff the current directory contents with a snapshot"
|
||||||
hadoop_add_subcommand "storagepolicies" "list/get/set block storage policies"
|
hadoop_add_subcommand "storagepolicies" "list/get/set block storage policies"
|
||||||
|
@ -234,6 +235,12 @@ case ${COMMAND} in
|
||||||
hadoop_debug "Appending HADOOP_PORTMAP_OPTS onto HADOOP_OPTS"
|
hadoop_debug "Appending HADOOP_PORTMAP_OPTS onto HADOOP_OPTS"
|
||||||
HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_PORTMAP_OPTS}"
|
HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_PORTMAP_OPTS}"
|
||||||
;;
|
;;
|
||||||
|
scm)
|
||||||
|
supportdaemonization="true"
|
||||||
|
CLASS='org.apache.hadoop.ozone.storage.StorageContainerManager'
|
||||||
|
hadoop_debug "Appending HADOOP_SCM_OPTS onto HADOOP_OPTS"
|
||||||
|
HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_SCM_OPTS}"
|
||||||
|
;;
|
||||||
secondarynamenode)
|
secondarynamenode)
|
||||||
supportdaemonization="true"
|
supportdaemonization="true"
|
||||||
CLASS='org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode'
|
CLASS='org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode'
|
||||||
|
|
|
@ -34,6 +34,7 @@ import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_HAN
|
||||||
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_DEFAULT;
|
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_DEFAULT;
|
||||||
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_KEY;
|
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_ADDRESS_KEY;
|
||||||
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_BIND_HOST_KEY;
|
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_LOCATION_RPC_BIND_HOST_KEY;
|
||||||
|
import static org.apache.hadoop.util.ExitUtil.terminate;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
@ -591,9 +592,14 @@ public class StorageContainerManager
|
||||||
public static void main(String[] argv) throws IOException {
|
public static void main(String[] argv) throws IOException {
|
||||||
StringUtils.startupShutdownMessage(
|
StringUtils.startupShutdownMessage(
|
||||||
StorageContainerManager.class, argv, LOG);
|
StorageContainerManager.class, argv, LOG);
|
||||||
StorageContainerManager scm = new StorageContainerManager(
|
try {
|
||||||
new OzoneConfiguration());
|
StorageContainerManager scm = new StorageContainerManager(
|
||||||
scm.start();
|
new OzoneConfiguration());
|
||||||
scm.join();
|
scm.start();
|
||||||
|
scm.join();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
LOG.error("Failed to start the StorageContainerManager.", t);
|
||||||
|
terminate(1, t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue