Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As a result, it's easy to start All the components in IDE (eg. IntelliJ) as the right classpath (without provided scope) has already been set.

(1) First of all you need a log4j.properties and an ozone-site.xml to configure the components.

(2) Save this file as log4j.properties to your disk;

Code Block
titlelog4j.properties
log4j.rootLogger=INFO,stdout
log4j.threshold=ALL
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
log4j.logger.io.jagertraecing=DEBUG

(3) Save this to an ozone-site.xml:

Code Block
<configuration>
<property><name>hdds.profiler.endpoint.enabled</name><value>true</value></property>    
<property><name>ozone.scm.block.client.address</name><value>localhost</value></property>
<property><name>ozone.scm.datanode.id.dir</name><value>/tmp</value></property>
<property><name>ozone.scm.client.address</name><value>localhost</value></property>
<property><name>ozone.metadata.dirs</name><value>/tmp/metadata</value></property>
<property><name>ozone.scm.names</name><value>localhost</value></property>
<property><name>ozone.om.address</name><value>localhost</value></property>
<property><name>ozone.enabled</name><value>true</value></property>
</configuration>

As you can see everything is configured to run on localhost and use /tmp to store metadata.

(4) Now you can start the components. Start with the SCM (as OM depends on SCM). The easiest way to create a new Configuration is to open the StorageContainerManager class and try to run it. First time it will be failed but it creates a new StorageContainerManager entry in the run menu.

Image Removed

Now you can open RunEdit Configuration and edit the defaults:

Image Removed

The important settings:

...

Since HDDS-1715 we have provide ready-to-use IntelliJ run configurations.

To start Ozone from Intellij you need the following:

(1) Stop your Intellij

(2) Execute the helper shell script:

Code Block
./hadoop-ozone/dev-support/intellij/install-runconfigs.sh

Note: helper script doesn't do any special, just copy the committed runners to the right location in your intellij project folder.

(3) Start IntelliJ

As a result you can find the new run entries under the Run menu:

Image Added

To run ozone, you can use the installed Run configurations in the following order:

  1. StorageContainerManagerInit (to initialize the SCM dir)
  2. StorageContainerManger (to start SCM)
  3. OzoneManagerInit (to initialize OM, it requires SCM)
  4. OzoneManager
  5. Datanode

Note: as of now we support only one datanode, but supporting multiple datanode processes can be added

(5) Do the same for OzoneManager

Note: OzoneManager can be initialized (with adding temporary the --init flag) only if the SCM is running.

(6) Start the datanode. The main class is HddsDatanodeService in this case.

Note1: with the provided configuration only one datanode is supported due to the port conflicts.

Note2: GenericCli doesn't support the -conf flag, yet. (see HDDS-1192). As of now you should copy the ozone-site.xml to the classpath.

Code Block
 cp ozone-site.xml hadoop-hdds/container-service/src/main/resources 

But please, don't forget to delete if before commit.

(6) Main class of the S3 REST Gateway is org.apache.hadoop.ozone.s3.Gateway. It also requires the copy of ozone-site.xml to the classpath.