Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the bash script #29

Merged
merged 5 commits into from
Jul 8, 2022
Merged

Optimize the bash script #29

merged 5 commits into from
Jul 8, 2022

Conversation

zuston
Copy link
Member

@zuston zuston commented Jul 5, 2022

What changes were proposed in this pull request?

Optimzie the bash script when deploying.

Main changelog

  1. Use the bin/hadoop to get the hadoop deps.
  2. Separate the log file for coordinator and server.

Why are the changes needed?

To be compatible with the other hadoop distribution Including Apache Hadoop, like CDH.

Does this PR introduce any user-facing change?

Yes.

How was this patch tested?

Manual test.

@zuston
Copy link
Member Author

zuston commented Jul 5, 2022

@jerqi Could u help review this? I found the current deploy script is not compatible with our internal Hadoop distribution.
This PR is to solve this.

log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
log4j.appender.RollingAppender=org.apache.log4j.RollingFileAppender
log4j.appender.RollingAppender.File=./logs/shuffle_server.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we introduce a environment variable like LOG_PATH in start script?
In log4j.properties, we use the environment variable to help coordinator and server to write log in different paths.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my test cases, i make the coordinator and shuffle server deployed to one node. So i think it's better to separate the log file.
Although the log file content looks same now, but separation will make log content change more easily.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, We don't recommend to deploy coordinator and server in one node.
If we deploy multiple servers in one node, do we need configurations conf/log4j.shuffle_server.properties.1,conf/log4j.shuffle_server.properties.2?
Second, Hadoop DataNode and Hadoop NodeManager can be deployed in one node, but they share one log4j.properties.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Got it.

Besides, why we dont recommend to deploy in one node? Can u share some info? As i know, the coordinator is lightweight

Copy link
Contributor

@jerqi jerqi Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are too many applications, the server will occupy all the network bandwidth and coordinator will be unstable.

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2022

Codecov Report

Merging #29 (cc7456b) into master (37beb1f) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master      #29      +/-   ##
============================================
- Coverage     56.83%   56.80%   -0.04%     
+ Complexity     1204     1203       -1     
============================================
  Files           152      152              
  Lines          8401     8401              
  Branches        813      813              
============================================
- Hits           4775     4772       -3     
- Misses         3368     3370       +2     
- Partials        258      259       +1     
Impacted Files Coverage Δ
...org/apache/uniffle/server/ShuffleFlushManager.java 76.70% <0.00%> (-1.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37beb1f...cc7456b. Read the comment docs.

@zuston zuston requested a review from jerqi July 8, 2022 05:01
echo "No env HADOOP_HOME."
exit 1
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verify this patch offline, find this error
企业微信截图_1e5275e2-2a30-4989-b128-841b3140f665
When I add

export JAVA_HOME

here.
It's ok.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JAVA_HOME has been set in rss-env.sh.
I can't reproduce it.

LOG_CONF_FILE="./conf/log4j.properties"
LOG_PATH="./logs/coordinator.log"
if [ -f ${LOG_CONF_FILE} ]; then
ARGS="$ARGS -Dlog4j.configuration=file:${LOG_CONF_FILE} -DLOG_PATH=${LOG_PATH}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Dlog.path=${LOG_PATH} may be better. The style will be consistent with -Dlog4j.configuration.

@@ -22,7 +22,7 @@ log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
log4j.appender.RollingAppender=org.apache.log4j.RollingFileAppender
log4j.appender.RollingAppender.File=./logs/rss.log
log4j.appender.RollingAppender.File=${LOG_PATH}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use log.path, we should modify this place, too.

@zuston zuston requested a review from jerqi July 8, 2022 10:49
Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jerqi jerqi merged commit ae674a6 into apache:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants