Skip to content

fix bkenv has no effect bug when start bookie using bin/pulsar-daemon#5675

Merged
sijie merged 6 commits intoapache:masterfrom
hangc0276:master
Nov 19, 2019
Merged

fix bkenv has no effect bug when start bookie using bin/pulsar-daemon#5675
sijie merged 6 commits intoapache:masterfrom
hangc0276:master

Conversation

@hangc0276
Copy link
Copy Markdown
Contributor

when i start bookie using bin/pulsar-daemon start bookie command, i found the bookie environment variable defined in conf/bkenv.sh has no effect, but using $PULSAR_MEM and $PULSAR_GC instead.

Then i check the bin/pulsar shell script, i found as follow:

elif [ $COMMAND == "bookie" ]; then
    PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"bookkeeper.log"}
    # Pass BOOKIE_EXTRA_OPTS option defined in pulsar_env.sh
    OPTS="$OPTS $BOOKIE_EXTRA_OPTS"
    exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.bookkeeper.proto.BookieServer --conf $PULSAR_BOOKKEEPER_CONF $@

but in pulsar_env.sh, the $BOOKIE_EXTRA_OPTS defined as follow:

# Set BOOKIE_EXTRA_OPTS option here to ensure that all pulsar scripts can work seamless with bookkeeper

# Extra options to be passed to the jvm
BOOKIE_EXTRA_OPTS="${BOOKIE_EXTRA_OPTS} -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.maxCapacity.default=1000 -Dio.netty.recycler.linkCapacity=1024"

$BOOKIE_EXTRA_OPTS do not define $BOOKIE_MEM and $BOOKIE_GC, then the pulsar script will using $PULSAR_MEM and $PULSAR_GC instead to start bookkeeper.

So, i suggest to load conf/bkenv.sh in bin/pulsar script and using $BOOKIE_EXTRA_OPTS in conf/bkenv.sh instread of $BOOKIE_EXTRA_OPTS in bin/pulsar_env.sh

Comment thread bin/pulsar
Comment thread bin/pulsar-perf
Comment thread bin/pulsar-daemon
Comment thread src/pulsar-io-gen
. "$PULSAR_HOME/conf/pulsar_env.sh"
fi

# Check bookkeeper env and load bkenv.sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same comment as above

@sijie sijie added area/broker type/bug The PR fixed a bug or issue reported a bug labels Nov 19, 2019
@sijie sijie added this to the 2.4.3 milestone Nov 19, 2019
…ty consideration, So if people already define environments in pulsar_env, those env vars will not be overridden by bkenv.sh
@merlimat
Copy link
Copy Markdown
Contributor

This change is causing several side effects and I think it should be reverted.

sijie pushed a commit that referenced this pull request Feb 8, 2020
)

### Motivation
Fixes #6131 (caused by #5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values. 

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Feb 23, 2020
…ache#6201)

### Motivation
Fixes apache#6131 (caused by apache#5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values. 

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Mar 21, 2020
…ache#6201)

### Motivation
Fixes apache#6131 (caused by apache#5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values. 

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.

(cherry picked from commit 28875d5)
tuteng pushed a commit that referenced this pull request Apr 13, 2020
)

### Motivation
Fixes #6131 (caused by #5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values. 

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.

(cherry picked from commit 28875d5)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
…ache#6201)

### Motivation
Fixes apache#6131 (caused by apache#5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values.

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.
(cherry picked from commit 28875d5)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
…ache#6201)

### Motivation
Fixes apache#6131 (caused by apache#5675):

When upgrading an existing 2.4.1 bookie cluster to 2.5.0 on kubernetes, the bookie fails to start with the following exception during initialization: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 2147483648, max: 2147483648). This is caused by the fact that the bookie environment variables `BOOKIE_MEM` and `BOOKIE_FC` defined in conf/bkenv.sh has no effect, and it is always using the defaults values. 

#### Proposed solution:
Set `BOOKIE_MEM` and `BOOKIE_GC` in the helm deployments charts and default to `PULSAR_MEM` if the `BOOKIE` settings are not set and then use the default settings if none of those environment variables are set.

#### Changes made
Helm chart deployment `values.yaml` and `values-mini.yaml` along with the `bkenv.sh` configuration script.

### Documentation
Currently, the documentation explaining the deployment process and how to change settings is lacking and need to be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker release/2.4.3 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants