Installation

Bare Metal

qianmoQqianmoQ· 更新于 2026-09-23· 阅读 22 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

This guide covers setting up Apache Ozone on physical or virtual machines. Choose between manual installation or automated deployment using the Ozone Installer tool.

Ozone Components

  1. Ozone Manager (OM) - Manages the namespace (volumes, buckets, keys)
  2. Storage Container Manager (SCM) - Block manager that provides blocks for data writes
  3. Datanodes (DN) - Store containers and handle data read/write operations
  4. Recon (Optional) - Management and monitoring interface
  5. S3 Gateway (S3G) (Optional) - Provides S3-compatible API access to Ozone

Learn more: Ozone Architecture Overview

Prerequisites

All Nodes:

  • Linux OS (RHEL/CentOS 7+, Ubuntu 20.04+)
  • Java 11 or Java 17 (OpenJDK)
  • Minimum 4 GB RAM
  • SSH access
  • Network connectivity between nodes

For Manual Installation:

  • Root/sudo access on all nodes
  • wget or curl for downloading binaries

For Automated Installation:

  • Controller node: Python 3.10-3.12, Ansible Community 10.x
  • Managed nodes: Python 3.7+, sudo access

Method 1: Manual Installation

note

We will be using /opt/ozone as the base directory for Ozone configs and binaries, and /data/ozone for the application data and metadata in all of our examples. Feel free to use any path as per your environment.

Step 1: Install Java


jdk_version=11



sudo yum install -y java-${jdk_version}-openjdk-devel





sudo apt-get update

sudo apt-get install -y openjdk-${jdk_version}-jdk





java -version

Set JAVA_HOME:




sudo update-alternatives --config java





export JAVA_HOME=/usr/lib/jvm/java-11-openjdk

export PATH=$PATH:$JAVA_HOME/bin

Step 2: Create Service User




sudo groupadd ozone

sudo useradd -g ozone -m -s /bin/bash ozone





sudo mkdir -p /data/ozone/{metadata,datanode/id,datanode/data}

sudo chown -R ozone:ozone /data/ozone





sudo mkdir -p /opt/ozone

sudo chown ozone:ozone /opt/ozone

Step 3: Download and Extract Ozone

Check GitHub releases for the latest version.




sudo su - ozone





wget https://downloads.apache.org/ozone/2.1.0/ozone-2.1.0.tar.gz





tar -xzf ozone-2.1.0.tar.gz -C /opt/

ln -s /opt/ozone /opt/ozone-2.1.0

cd /opt/ozone

Step 4: Generate and Configure




bin/ozone genconf /opt/ozone/etc/hadoop/

Edit /opt/ozone/etc/hadoop/ozone-site.xml:


<configuration>

  <property>

    <name>ozone.metadata.dirs</name>

    <value>/data/ozone/metadata</value>

  </property>



  <property>

    <name>ozone.scm.names</name>

    <value>scm-host.example.com</value>

  </property>



  <property>

    <name>ozone.om.address</name>

    <value>om-host.example.com</value>

  </property>



  <property>

    <name>ozone.scm.datanode.id.dir</name>

    <value>/data/ozone/datanode/id</value>

  </property>



  <property>

    <name>hdds.datanode.dir</name>

    <value>/data/ozone/datanode/data</value>

  </property>



  <property>

    <name>ozone.replication</name>

    <value>3</value>



  </property>





  <property>

    <name>ozone.s3g.http-address</name>

    <value>0.0.0.0:9878</value>

  </property>

</configuration>

Configuration Resources:

Copy ozone-site.xml to all nodes.

Step 5: Initialize Services




bin/ozone scm --init





bin/ozone om --init

Step 6: Start Services




bin/ozone --daemon start scm





bin/ozone --daemon start om





bin/ozone --daemon start datanode





bin/ozone --daemon start recon





bin/ozone --daemon start s3g

Step 7: Verify Installation




jps







bin/ozone sh volume create /vol1

bin/ozone sh bucket create /vol1/bucket1

echo "Hello Ozone" > /tmp/test.txt

bin/ozone sh key put /vol1/bucket1/key1 /tmp/test.txt

bin/ozone sh key list /vol1/bucket1

Stop Services (when needed)


bin/ozone --daemon stop s3g

bin/ozone --daemon stop datanode

bin/ozone --daemon stop om

bin/ozone --daemon stop scm

bin/ozone --daemon stop recon

Method 2: Automated Installation (Recommended)

The ozone-installer is an Ansible-based tool that automates Ozone deployment. It handles Java installation, user creation, and all configuration steps automatically.

Installation Steps

1. Clone and setup:


git clone https://github.com/apache/ozone-installer.git

cd ozone-installer

pip install -r requirements.txt

2. Run the installer:




python3 ozone_installer.py -H hostname.example.com -v 2.1.0





python3 ozone_installer.py -H "host{1..5}.example.com" -v 2.1.0





python3 ozone_installer.py -F hosts.txt -v 2.1.0





python3 ozone_installer.py -H hosts -v 2.1.0 --python-interpreter /usr/bin/python3.9





python3 ozone_installer.py --clean -H hosts -v 2.1.0

What Gets Installed

Automated setup includes:

  • Java 11 or 17 installation (if not present)
  • Service user (ozone) creation
  • Directory structure setup
  • Ozone binary installation and configuration
  • S3 Gateway setup

Non-HA (1-2 nodes):

  • First host: OM + SCM + Recon (+ S3G if enabled)
  • All hosts: Datanodes

HA (3+ nodes):

  • First 3 hosts: OM + SCM (HA)
  • First host: Recon + S3G (if enabled)
  • All hosts: Datanodes

Default paths:

  • Install: /opt/ozone
  • Data: /data/ozone
  • Service user: ozone:ozone

For more details, see the ozone-installer repository.

References

评论

登录后参与评论

正在加载评论…