Skip to content

Commit

Permalink
[Issue:5687] Add prefix for new keys from Env (apache#5790)
Browse files Browse the repository at this point in the history
Signed-off-by: xiaolong.ran <[email protected]>

Fixes apache#5687 

### Motivation

When the user wants to add new keys for Env, adding fails if no prefix is added. 

Currently, add new keys for Env use the script of [apply-config-from-env.py](https://github.com/apache/pulsar/commits/master/docker/pulsar/scripts/apply-config-from-env.py), to ensure that the env set by the user can take effect, add the prefix(**PULSAR_PREFIX_**) for all keys.

### Modifications

- Add prefix for new keys from Env
  • Loading branch information
wolfstudy authored and jiazhai committed Dec 6, 2019
1 parent eec4fa5 commit d74c1ac
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 77 deletions.
14 changes: 7 additions & 7 deletions deployment/kubernetes/aws/bookkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ metadata:
name: bookie-config
data:
PULSAR_MEM: "\"-Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -verbosegc -XX:G1LogLevel=finest -Xms28g -Xmx28g -XX:MaxDirectMemorySize=28g\""
dbStorage_writeCacheMaxSizeMb: "2048" # Write cache size (direct memory)
dbStorage_readAheadCacheMaxSizeMb: "2048" # Read cache size (direct memory)
dbStorage_rocksDB_blockCacheSize: "4294967296"
journalMaxSizeMB: "2048"
zkServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
useHostNameAsBookieID: "true"
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "2048" # Write cache size (direct memory)
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "2048" # Read cache size (direct memory)
PULSAR_PREFIX_dbStorage_rocksDB_blockCacheSize: "4294967296"
PULSAR_PREFIX_journalMaxSizeMB: "2048"
PULSAR_PREFIX_zkServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_useHostNameAsBookieID: "true"
---
apiVersion: apps/v1beta1
kind: StatefulSet
Expand Down
14 changes: 7 additions & 7 deletions deployment/kubernetes/aws/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ data:
# better GC behavior at high throughput
PULSAR_MEM: "\" -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem -Xms12g -Xmx12g -XX:MaxDirectMemorySize=14g -Dpulsar.root.logger=DEBUG,FILE \""
PULSAR_GC: "\" -XX:+UseG1GC -XX:MaxGCPauseMillis=10\""
zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
clusterName: us-east
managedLedgerDefaultEnsembleSize: "2"
managedLedgerDefaultWriteQuorum: "2"
managedLedgerDefaultAckQuorum: "2"
deduplicationEnabled: "false"
PULSAR_PREFIX_zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_clusterName: us-east
PULSAR_PREFIX_managedLedgerDefaultEnsembleSize: "2"
PULSAR_PREFIX_managedLedgerDefaultWriteQuorum: "2"
PULSAR_PREFIX_managedLedgerDefaultAckQuorum: "2"
PULSAR_PREFIX_deduplicationEnabled: "false"
---
##
## Broker deployment definition
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes/aws/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ metadata:
name: pulsar-proxy-config
data:
PULSAR_MEM: "\" -Xms4g -Xmx4g -XX:MaxDirectMemorySize=4g\""
brokerServiceURL: pulsar://broker:6650
brokerWebServiceURL: http://broker:8080
clusterName: pulsar-eks
PULSAR_PREFIX_brokerServiceURL: pulsar://broker:6650
PULSAR_PREFIX_brokerWebServiceURL: http://broker:8080
PULSAR_PREFIX_clusterName: pulsar-eks

---
apiVersion: apps/v1beta1
Expand Down
8 changes: 4 additions & 4 deletions deployment/kubernetes/generic/k8s-1-9-and-above/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ metadata:
name: bookie-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
zkServers: zookeeper
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
PULSAR_PREFIX_zkServers: zookeeper
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
---
##
## Define the Bookie headless service
Expand Down
14 changes: 7 additions & 7 deletions deployment/kubernetes/generic/k8s-1-9-and-above/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ data:
# Tune for available memory. Increase the heap up to 24G to have
# better GC behavior at high throughput
PULSAR_MEM: "\" -Xms64m -Xmx128m -XX:MaxDirectMemorySize=128m\""
zookeeperServers: zookeeper
configurationStoreServers: zookeeper
clusterName: local
PULSAR_PREFIX_zookeeperServers: zookeeper
PULSAR_PREFIX_configurationStoreServers: zookeeper
PULSAR_PREFIX_clusterName: local
# change the managed ledger settings if you have more bookies
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultWriteQuorum: "1"
managedLedgerDefaultAckQuorum: "1"
PULSAR_PREFIX_managedLedgerDefaultEnsembleSize: "1"
PULSAR_PREFIX_managedLedgerDefaultWriteQuorum: "1"
PULSAR_PREFIX_managedLedgerDefaultAckQuorum: "1"
# enable pulsar functions
functionsWorkerEnabled: "true"
PULSAR_PREFIX_functionsWorkerEnabled: "true"
PF_pulsarFunctionsCluster: local
---
##
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes/generic/k8s-1-9-and-above/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ metadata:
name: proxy-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx128m -XX:MaxDirectMemorySize=128m\""
zookeeperServers: zookeeper
configurationStoreServers: zookeeper
clusterName: local
PULSAR_PREFIX_zookeeperServers: zookeeper
PULSAR_PREFIX_configurationStoreServers: zookeeper
PULSAR_PREFIX_clusterName: local
---
##
## Expose all nodes on port so that you can reach cluster from outside k8
Expand Down
8 changes: 4 additions & 4 deletions deployment/kubernetes/generic/original/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ metadata:
name: bookie-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
zkServers: zookeeper
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
PULSAR_PREFIX_zkServers: zookeeper
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
---

## BookKeeper servers need to access the local disks and the pods
Expand Down
14 changes: 7 additions & 7 deletions deployment/kubernetes/generic/original/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ data:
# Tune for available memory. Increase the heap up to 24G to have
# better GC behavior at high throughput
PULSAR_MEM: "\" -Xms64m -Xmx128m -XX:MaxDirectMemorySize=128m\""
zookeeperServers: zookeeper
configurationStoreServers: zookeeper
clusterName: local
PULSAR_PREFIX_zookeeperServers: zookeeper
PULSAR_PREFIX_configurationStoreServers: zookeeper
PULSAR_PREFIX_clusterName: local
# change the managed ledger settings if you have more bookies
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultWriteQuorum: "1"
managedLedgerDefaultAckQuorum: "1"
PULSAR_PREFIX_managedLedgerDefaultEnsembleSize: "1"
PULSAR_PREFIX_managedLedgerDefaultWriteQuorum: "1"
PULSAR_PREFIX_managedLedgerDefaultAckQuorum: "1"
# enable pulsar functions
functionsWorkerEnabled: "true"
PULSAR_PREFIX_functionsWorkerEnabled: "true"
PF_pulsarFunctionsCluster: local
---
##
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes/generic/original/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ metadata:
name: proxy-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx128m -XX:MaxDirectMemorySize=128m\""
zookeeperServers: zookeeper
configurationStoreServers: zookeeper
clusterName: local
PULSAR_PREFIX_zookeeperServers: zookeeper
PULSAR_PREFIX_configurationStoreServers: zookeeper
PULSAR_PREFIX_clusterName: local
---
##
## Proxy deployment definition
Expand Down
10 changes: 5 additions & 5 deletions deployment/kubernetes/google-kubernetes-engine/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ metadata:
data:
PULSAR_MEM: "\" -Xms4g -Xmx4g -XX:MaxDirectMemorySize=4g\""
PULSAR_GC: "\" -XX:+UseG1GC \""
dbStorage_writeCacheMaxSizeMb: "1024"
dbStorage_readAheadCacheMaxSizeMb: "1024"
zkServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
useHostNameAsBookieID: "true"
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "1024"
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "1024"
PULSAR_PREFIX_zkServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_useHostNameAsBookieID: "true"
---
apiVersion: apps/v1beta1
kind: StatefulSet
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes/google-kubernetes-engine/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ metadata:
data:
PULSAR_MEM: "\" -Xms8g -Xmx8g -XX:MaxDirectMemorySize=4g\""
PULSAR_GC: "\" -XX:+UseG1GC \""
zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
clusterName: pulsar-gke
PULSAR_PREFIX_zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_clusterName: pulsar-gke
---
##
## Broker deployment definition
Expand Down
6 changes: 3 additions & 3 deletions deployment/kubernetes/google-kubernetes-engine/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ metadata:
name: pulsar-proxy-config
data:
PULSAR_MEM: "\" -Xms4g -Xmx4g -XX:MaxDirectMemorySize=4g\""
zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
clusterName: pulsar-gke
PULSAR_PREFIX_zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_configurationStoreServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper
PULSAR_PREFIX_clusterName: pulsar-gke

---
apiVersion: apps/v1beta1
Expand Down
20 changes: 10 additions & 10 deletions deployment/kubernetes/helm/pulsar/values-mini.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ bookkeeper:
##
configData:
PULSAR_MEM: "\"-Xms128m -Xmx256m -XX:MaxDirectMemorySize=128m -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -verbosegc -XX:G1LogLevel=finest\""
dbStorage_writeCacheMaxSizeMb: "32"
dbStorage_readAheadCacheMaxSizeMb: "32"
journalMaxSizeMB: "2048"
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
useHostNameAsBookieID: "true"
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "32"
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "32"
PULSAR_PREFIX_journalMaxSizeMB: "2048"
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_useHostNameAsBookieID: "true"
## Bookkeeper configmap
## templates/bookkeeper-service.yaml
##
Expand Down Expand Up @@ -187,11 +187,11 @@ broker:
configData:
PULSAR_MEM: "\"-Xms128m -Xmx256m -XX:MaxDirectMemorySize=128m -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem\""
PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\""
managedLedgerDefaultEnsembleSize: "2"
managedLedgerDefaultWriteQuorum: "2"
managedLedgerDefaultAckQuorum: "2"
deduplicationEnabled: "false"
exposeTopicLevelMetricsInPrometheus: "true"
PULSAR_PREFIX_managedLedgerDefaultEnsembleSize: "2"
PULSAR_PREFIX_managedLedgerDefaultWriteQuorum: "2"
PULSAR_PREFIX_managedLedgerDefaultAckQuorum: "2"
PULSAR_PREFIX_deduplicationEnabled: "false"
PULSAR_PREFIX_exposeTopicLevelMetricsInPrometheus: "true"
## Broker service
## templates/broker-service.yaml
##
Expand Down
22 changes: 11 additions & 11 deletions deployment/kubernetes/helm/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ bookkeeper:
##
configData:
PULSAR_MEM: "\"-Xms15g -Xmx15g -XX:MaxDirectMemorySize=15g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -verbosegc -XX:G1LogLevel=finest\""
dbStorage_writeCacheMaxSizeMb: "2048"
dbStorage_readAheadCacheMaxSizeMb: "2048"
dbStorage_rocksDB_blockCacheSize: "268435456"
journalMaxSizeMB: "2048"
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
useHostNameAsBookieID: "true"
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "2048"
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "2048"
PULSAR_PREFIX_dbStorage_rocksDB_blockCacheSize: "268435456"
PULSAR_PREFIX_journalMaxSizeMB: "2048"
PULSAR_PREFIX_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
PULSAR_PREFIX_useHostNameAsBookieID: "true"
## Bookkeeper configmap
## templates/bookkeeper-service.yaml
##
Expand Down Expand Up @@ -209,11 +209,11 @@ broker:
configData:
PULSAR_MEM: "\"-Xms15g -Xmx15g -XX:MaxDirectMemorySize=15g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem\""
PULSAR_GC: "\"-XX:+UseG1GC -XX:MaxGCPauseMillis=10\""
managedLedgerDefaultEnsembleSize: "3"
managedLedgerDefaultWriteQuorum: "3"
managedLedgerDefaultAckQuorum: "2"
deduplicationEnabled: "false"
exposeTopicLevelMetricsInPrometheus: "true"
PULSAR_PREFIX_managedLedgerDefaultEnsembleSize: "3"
PULSAR_PREFIX_managedLedgerDefaultWriteQuorum: "3"
PULSAR_PREFIX_managedLedgerDefaultAckQuorum: "2"
PULSAR_PREFIX_deduplicationEnabled: "false"
PULSAR_PREFIX_exposeTopicLevelMetricsInPrometheus: "true"
## Broker service
## templates/broker-service.yaml
##
Expand Down

0 comments on commit d74c1ac

Please sign in to comment.