作者 唐旭辉

配置修改

... ... @@ -80,6 +80,8 @@ spec:
value: "http://suplus-business-admin-dev.fjmaimaimai.com"
- name: KAFKA_HOST
value: "106.52.15.41:9092"
- name: KAFKA_CONSUMER_ID
value: "partnermg_dev"
volumes:
- name: accesslogs
emptyDir: {}
... ...
... ... @@ -78,6 +78,10 @@ spec:
value: "rsF0pL!6DwjBO735"
- name: BUSINESS_ADMIN_HOST
value: "http://suplus-business-admin-prd.fjmaimaimai.com"
- name: KAFKA_HOST
value: ""
- name: KAFKA_CONSUMER_ID
value: "partnermg_test"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
emptyDir: {}
... ...
... ... @@ -77,6 +77,8 @@ spec:
value: "http://suplus-business-admin-test.fjmaimaimai.com"
- name: KAFKA_HOST
value: "106.52.15.41:9092"
- name: KAFKA_CONSUMER_ID
value: "partnermg_test"
volumes:
- name: accesslogs
emptyDir: {}
... ...
... ... @@ -15,12 +15,16 @@ var KafkaCfg KafkaConfig
func init() {
KafkaCfg = KafkaConfig{
Servers: []string{"106.52.15.41:9092"},
ConsumerId: "partnermg",
ConsumerId: "partnermg_dev",
}
if os.Getenv("KAFKA_HOST") != "" {
kafkaHost := os.Getenv("KAFKA_HOST")
KafkaCfg.Servers = strings.Split(kafkaHost, ";")
}
if os.Getenv("KAFKA_CONSUMER_ID") != "" {
consumerId := os.Getenv("KAFKA_CONSUMER_ID")
KafkaCfg.ConsumerId = consumerId
}
}
// "192.168.190.136:9092",
... ...