logo icon
洁骏Lib库App配置文件说明

洁骏Lib库App配置文件说明 创建时间:2023-09-01 12:47:33
App配置,配置可以支持文件形式和nacos形式混合 -------- 1. 使用文件配置 ```yaml env: test app: name: Webhook type: web logger: level: debug encoding: json outputPaths: - stdout - logs/webhook errorOutputPaths: - stderr initialFields: app: Webhook encoderConfig: #messageKey: msg levelKey: level nameKey: name TimeKey: time #CallerKey: caller #FunctionKey: func StacktraceKey: stacktrace LineEnding: "\n" errlog: level: warn encoding: json outputPaths: - stdout #- logs/webhook errorOutputPaths: - stderr initialFields: app: Webhook encoderConfig: #messageKey: msg levelKey: level nameKey: name TimeKey: time CallerKey: caller FunctionKey: func StacktraceKey: stacktrace LineEnding: "\n" redis: - name: pubRedis address: [ "pubredis:6379" ] user: pwd: master: mysql: - name: pubMysql address: pubmysql port: 3306 user: test pwd: ******* ssl: disable db: ch123 sql_log: yes read_timeout: 100 conn_timeout: 100 write_timeout: 100 char_set: utf8mb4 max_idle_conns: 10 max_open_conns: 500 pulsar: - name: pubPulsar address: [ "pubpulsar:6650" ] nacos: - name: nacosConf url: http://nacosconf:8848/nacos contextPath: /nacos ns: public user: dev pwd: ****** redis: name: base address: [ "pubEs:6379" ] user: pwd: master: elastic: - name: pubEs host: [ "pubEs:9200" ] user: elastic pwd: SLmOE+pJcwsxbFrf-rzh read_timeout: 600ms conn_timeout: 80ms default_max_window_result: 0 default_track_total_hits: 0 auto_detect: false max_window_result: test: 1000 track_total_hits: test: 2000 ``` 2. 使用nacos 配置 ```yaml env: test app: name: Webhook type: web logger: level: debug encoding: json outputPaths: - stdout - logs/webhook errorOutputPaths: - stderr initialFields: app: Webhook encoderConfig: #messageKey: msg levelKey: level nameKey: name TimeKey: time #CallerKey: caller #FunctionKey: func StacktraceKey: stacktrace LineEnding: "\n" errlog: level: warn encoding: json outputPaths: - stdout #- logs/webhook errorOutputPaths: - stderr initialFields: app: Webhook encoderConfig: #messageKey: msg levelKey: level nameKey: name TimeKey: time CallerKey: caller FunctionKey: func StacktraceKey: stacktrace LineEnding: "\n" redisNacos: name: nacosConf did: redis group: redis ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 mysqlNacos: name: nacosConf did: mysql group: mysql ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 pulsarNacos: name: nacosConf did: pulsar group: pulsar ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 topicNacos: - name: nacosConf did: topic group: topic ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 elasticNacos: name: nacosConf did: elastic group: elastic ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 nacos: - name: nacosConf url: http://nacosconf:8848/nacos contextPath: /nacos ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712 user: dev pwd: 123456 redis: name: base address: [ "pubEs:6379" ] user: pwd: master: ``` 3. nacos 配置截图 ![nacos 配置说明](https://upload.ch123.com.cn/tmp/news/info/23_09_01/7196846415434715266_7238406f70cf319250d685402aebac05.png "nacos 配置说明") 1) redis在nacos的配置 ![redis配置](https://upload.ch123.com.cn/tmp/news/info/23_09_01/4753503634619691853_f03e0a9eae7ad4c4c213da404b7bc185.png "redis配置") 2) mysql在nacos的配置 ![mysql在nacos中的配置](https://upload.ch123.com.cn/tmp/news/info/23_09_01/9087143146939310168_c0fd919765de5e03562c69a341b9f992.png "mysql在nacos中的配置") 3) pulsar在nacos中的配置 ![pulsar的配置](https://upload.ch123.com.cn/tmp/news/info/23_09_01/4312949091340267164_8b3547cffa27216a264baa8b9faa1f04.png "pulsar的配置") 4) topic在nacos中的配置 ![topic的配置](https://upload.ch123.com.cn/tmp/news/info/23_09_01/1353155535169432636_aad0092be5554683bd05ea35827ea602.png "topic的配置") 5) elastic在nacos中的配置 ![elastic的配置](https://upload.ch123.com.cn/tmp/news/info/23_09_01/3507188191920726988_45003dfb078aff11e19f0fd9aeef63d0.png "elastic的配置")