Skip to main content

Initializing Cluster

After installing the binaries, the next step is to initialize the cluster. This section provides instructions on how to initialize a new Ozone cluster.

Initialize configurations

Ozone relies on a configuration file called ozone-site.xml. To generate a template that you can replace with proper values, please run the following command. This will generate a template called ozone-site.xml at the specified path (directory).

export OZONE_HOME=/path/to/ozone
export PATH=$PATH:$OZONE_HOME/bin
export OZONE_CONF_DIR=$OZONE_HOME/etc/ozone

ozone genconf $OZONE_CONF_DIR

Let us look at the settings inside the generated file (ozone-site.xml) and how they control Ozone. Once the right values are defined, this file is ready for use.

  • ozone.metadata.dirs Allows Administrators to specify where the metadata must reside. Usually you pick your fastest disk (SSD if you have them on your nodes). OzoneManager, SCM and Datanode will write the metadata to this path. This is a required setting, if this is missing Ozone will fail to come up.

    Here is an example,

       <property>
    <name>ozone.metadata.dirs</name>
    <value>/data/disk1/meta</value>
    </property>
  • ozone.scm.names Storage Container Manager (SCM) is a distributed block service which is used by Ozone. This property allows Datanodes to discover SCM's address. Datanodes send heartbeat to SCM. Until HA feature is complete, we configure ozone.scm.names to be a single machine.

    Here is an example,

        <property>
    <name>ozone.scm.names</name>
    <value>scm.ozone.apache.org</value>
    </property>
  • ozone.scm.datanode.id.dir Datanodes generate a Unique ID called Datanode ID. This identity is written to the file datanode.id in a directory specified by this path. Datanodes will create this path if it doesn't exist already.

    Here is an example,

       <property>
    <name>ozone.scm.datanode.id.dir</name>
    <value>/data/disk1/meta/node</value>
    </property>
  • ozone.om.address OM server address. This is used by OzoneClient and Ozone File System.

    Here is an example,

        <property>
    <name>ozone.om.address</name>
    <value>ozonemanager.ozone.apache.org</value>
    </property>

Ozone Settings Summary

SettingValueComment
ozone.metadata.dirsfile pathThe metadata will be stored here.
ozone.scm.namesSCM server nameHostname:port or IP:port address of SCM.
ozone.scm.block.client.addressSCM server name and portUsed by services like OM
ozone.scm.client.addressSCM server name and portUsed by client-side
ozone.scm.datanode.addressSCM server name and portUsed by Datanode to talk to SCM
ozone.om.addressOM server nameUsed by Ozone handler and Ozone file system.
hdds.datanode.dirfile pathHDDS Datanodes store data in this directory.

Initialize the cluster

info

For simplicity, here we show the steps for non-HA cluster (1 OM, 1 SCM). To configure OM HA or to convert from non-HA to HA, see the OM HA documentation. To configure SCM HA or to convert from non-HA to HA, see the SCM HA documentation.

For Production Deployments

It is highly recommended to set up an HA-enabled cluster from the beginning for production environments. While it is possible to convert a non-HA cluster to an HA cluster, it is a complex procedure.

Before we boot up the Ozone cluster, we need to initialize both SCM and Ozone Manager.

ozone scm --init

This allows SCM to create the cluster Identity and initialize its state. The init command initializes the metadata directory specified in $ozone.metadata.dirs. Init command is executed only once, that allows SCM to create all the required on-disk structures to work correctly.

ozone --daemon start scm

Once we know SCM is up and running, we can create an Object Store for our use. This is done by running the following command.

ozone om --init

Once Ozone Manager is initialized, we are ready to run the name service.

ozone --daemon start om

At this point Ozone's name services, the Ozone Manager, and the block service SCM are both running.

info

SCM start will fail if on-disk data structures are missing; If SCM is not running, om --init command will fail. So please make sure you have done both scm --init and om --init commands.

Now we need to start the Datanodes. Please run the following command on each Datanode.

ozone --daemon start datanode

At this point SCM, Ozone Manager and Datanodes are up and running.

Congratulations!, You have set up a functional Ozone cluster.