Ozone components depends on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime.
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 | ||
---|---|---|
| ||
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.
Now you can open Run → Edit Configuration and edit the defaults:
The important settings:
...
(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.See: Run Ozone cluster from IDE