Skip to content

Conversation

@gaozhangmin
Copy link
Contributor

It seems that, We configured params for broker gc log, but not used.
turn on broker gc log.

@Anonymitaet
Copy link
Member

Thanks for your contribution. For this PR, do we need to update docs?

@gaozhangmin
Copy link
Contributor Author

Thanks for your contribution. For this PR, do we need to update docs?

I think there is no need to update docs

@gaozhangmin
Copy link
Contributor Author

Anyone can review it?

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Jul 13, 2021
@gaozhangmin
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@michaeljmarshall PTAL

@gaozhangmin
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

Looks like a good change. Before we merge this, we should update the bookkeeper shell script and the Pulsar shell script to document the new environment variables.

pulsar/bin/bookkeeper

Lines 99 to 106 in 3b76784

Environment variables:
BOOKIE_LOG_CONF Log4j configuration file (default $DEFAULT_LOG_CONF)
BOOKIE_CONF Configuration file (default: $DEFAULT_CONF)
BOOKIE_EXTRA_OPTS Extra options to be passed to the jvm
BOOKIE_EXTRA_CLASSPATH Add extra paths to the bookkeeper classpath
ENTRY_FORMATTER_CLASS Entry formatter class to format entries.
BOOKIE_PID_DIR Folder where the Bookie server PID file should be stored
BOOKIE_STOP_TIMEOUT Wait time before forcefully kill the Bookie server instance, if the stop is not successful

pulsar/bin/pulsar

Lines 158 to 173 in 3b76784

Environment variables:
FUNCTIONS_LOG_CONF Function Log4j configuration file (default $DEFAULT_FUNCTIONS_LOG_CONF)
PULSAR_LOG_CONF Log4j configuration file (default $DEFAULT_LOG_CONF)
PULSAR_BROKER_CONF Configuration file for broker (default: $DEFAULT_BROKER_CONF)
PULSAR_BOOKKEEPER_CONF Configuration file for bookie (default: $DEFAULT_BOOKKEEPER_CONF)
PULSAR_ZK_CONF Configuration file for zookeeper (default: $DEFAULT_ZK_CONF)
PULSAR_CONFIGURATION_STORE_CONF Configuration file for global configuration store (default: $DEFAULT_CONFIGURATION_STORE_CONF)
PULSAR_WEBSOCKET_CONF Configuration file for websocket proxy (default: $DEFAULT_WEBSOCKET_CONF)
PULSAR_PROXY_CONF Configuration file for Pulsar proxy (default: $DEFAULT_PROXY_CONF)
PULSAR_WORKER_CONF Configuration file for functions worker (default: $DEFAULT_WORKER_CONF)
PULSAR_STANDALONE_CONF Configuration file for standalone (default: $DEFAULT_STANDALONE_CONF)
PULSAR_PRESTO_CONF Configuration directory for Pulsar Presto (default: $DEFAULT_PULSAR_PRESTO_CONF)
PULSAR_EXTRA_OPTS Extra options to be passed to the jvm
PULSAR_EXTRA_CLASSPATH Add extra paths to the pulsar classpath
PULSAR_PID_DIR Folder where the pulsar server PID file should be stored
PULSAR_STOP_TIMEOUT Wait time before forcefully kill the pulsar server instance, if the stop is not successful

We also need to update the CLI tools web page: https://github.com/apache/pulsar/blob/master/site2/docs/reference-cli-tools.md

@gaozhangmin
Copy link
Contributor Author

gaozhangmin commented Sep 26, 2021

test failed reason: Unrecognized option: -Xlog:gc:logs/pulsar_gc_%p.log:time,uptime:filecount=10,filesize=20M
I cannot figure out why.

@gaozhangmin gaozhangmin force-pushed the broker_gc_log branch 2 times, most recently from 38ce3ce to ce012fe Compare September 26, 2021 12:23
@michaeljmarshall
Copy link
Member

@gaozhangmin - I think you still need to update the documentation here: https://github.com/apache/pulsar/blob/master/site2/docs/reference-cli-tools.md.

@gaozhangmin
Copy link
Contributor Author

gaozhangmin commented Sep 30, 2021

@gaozhangmin - I think you still need to update the documentation here: https://github.com/apache/pulsar/blob/master/site2/docs/reference-cli-tools.md.

@michaeljmarshall DOCS added

@eolivelli eolivelli modified the milestones: 2.9.0, 2.10.0 Oct 6, 2021
@BewareMyPower
Copy link
Contributor

@michaeljmarshall Could you take a look again?

@BewareMyPower
Copy link
Contributor

BewareMyPower commented Oct 19, 2021

Could you check my comments? It looks like pulsar-client-cpp/pulsar-test-service-start.sh cannot run successfully after this change.

@gaozhangmin
Copy link
Contributor Author

Could you check my comments? It looks like pulsar-client-cpp/pulsar-test-service-start.sh cannot run successfully after this change.

@BewareMyPower Sure, I will check later.

@gaozhangmin
Copy link
Contributor Author

gaozhangmin commented Oct 19, 2021

Could you check my comments? It looks like pulsar-client-cpp/pulsar-test-service-start.sh cannot run successfully after this change.

@BewareMyPower Sure, I will check later.

@BewareMyPower I tested locally pulsar-client-cpp/pulsar-test-service-start.sh, successfully run without error.

@gaozhangmin
Copy link
Contributor Author

/pulsarbot run-failure-checks

@gaozhangmin gaozhangmin force-pushed the broker_gc_log branch 3 times, most recently from 966c4e2 to d0d389b Compare October 19, 2021 11:15
@BewareMyPower
Copy link
Contributor

Could you check my comments? It looks like pulsar-client-cpp/pulsar-test-service-start.sh cannot run successfully after this change.

@BewareMyPower Sure, I will check later.

@BewareMyPower I tested locally pulsar-client-cpp/pulsar-test-service-start.sh, successfully run without error.

Did you use Java 11? The CI env is a docker container based on Ubuntu 16.04 and Java 11.

$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.16.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.16.04, mixed mode, sharing)

@gaozhangmin
Copy link
Contributor Author

gaozhangmin commented Oct 19, 2021

Could you check my comments? It looks like pulsar-client-cpp/pulsar-test-service-start.sh cannot run successfully after this change.

@BewareMyPower Sure, I will check later.

@BewareMyPower I tested locally pulsar-client-cpp/pulsar-test-service-start.sh, successfully run without error.

Did you use Java 11? The CI env is a docker container based on Ubuntu 16.04 and Java 11.

$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.16.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.16.04, mixed mode, sharing)

I tested without PULSAR_GC_LOG successfully, I don't know why this jdk11 cannot recognize xlog:gc

@BewareMyPower
Copy link
Contributor

I will take a look at this issue tomorrow.

@BewareMyPower
Copy link
Contributor

I found the problem. It's because when the standalone starts, it chooses the /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java rather than /usr/bin/java.

$ /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.16.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.16.04, mixed mode, sharing)

I think it's caused by wrong JAVA_HOME variable.

@BewareMyPower
Copy link
Contributor

You can modify pulsar-client-cpp/run-unit-tests.sh line 26 from

./pulsar-test-service-start.sh

to

JAVA_HOME=/usr ./pulsar-test-service-start.sh 

Then bin/pulsar would choose /usr/bin/java rather than the original $JAVA_HOME/bin/java.

@gaozhangmin
Copy link
Contributor Author

/pulsarbot run-failure-checks

@gaozhangmin
Copy link
Contributor Author

You can modify pulsar-client-cpp/run-unit-tests.sh line 26 from

./pulsar-test-service-start.sh

to

JAVA_HOME=/usr ./pulsar-test-service-start.sh 

Then bin/pulsar would choose /usr/bin/java rather than the original $JAVA_HOME/bin/java.

Thx. It worked.

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

LGTM

@gaozhangmin
Copy link
Contributor Author

@codelipenghui PTAL again

@codelipenghui codelipenghui merged commit c94c0aa into apache:master Nov 24, 2021
@codelipenghui codelipenghui changed the title broker gc log Fix broker gc log options Nov 24, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021

# Extra options to be passed to the jvm
PULSAR_EXTRA_OPTS=${PULSAR_EXTRA_OPTS:-" -Dpulsar.allocator.exit_on_oom=true -Dio.netty.recycler.maxCapacity.default=1000 -Dio.netty.recycler.linkCapacity=1024"}
PULSAR_EXTRA_OPTS="${PULSAR_EXTRA_OPTS:-" -Dpulsar.allocator.exit_on_oom=true -Dio.netty.recycler.maxCapacity.default=1000 -Dio.netty.recycler.linkCapacity=1024"} ${PULSAR_GC_LOG}"
Copy link
Member

Choose a reason for hiding this comment

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

This change seems to break pulsar-perf when running it in the docker container.

example failure:

root@e187af4bc610:/pulsar# ./bin/pulsar-perf produce
[0.000s][error][logging] Error opening log file 'logs/pulsar_gc_119.log': No such file or directory
[0.000s][error][logging] Initialization of output 'file=logs/pulsar_gc_%p.log' using options 'filecount=10,filesize=20M' failed.
Invalid -Xlog option '-Xlog:gc*:logs/pulsar_gc_%p.log:time,uptime:filecount=10,filesize=20M', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Copy link
Member

Choose a reason for hiding this comment

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

I created #13022 with a minimal fix to the issue.

lhotari added a commit to lhotari/pulsar that referenced this pull request Nov 29, 2021
- create /pulsar/logs directory since it's now required for
  running pulsar-perf after apache#11285 changes
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants