您好,登錄后才能下訂單哦!
這篇文章主要介紹“application.properties配置文件的方法”,在日常操作中,相信很多人在application.properties配置文件的方法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”application.properties配置文件的方法”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
#--------------------------------DUBBO---------------------------------# nacos.home.conf=10.1xx.xx.231:8848 dubbo.application.logger=slf4j dubbo.application.qos.enable=false dubbo.application.qos.port=22222 dubbo.application.qos.accept.foreign.ip=false #項目啟動掃描包目錄 dubbo.scan.basePackages=top.suven dubbo.scan.base-packages=top.suven #微服務器注冊中心,可以使用zookeeper,也可以使用nacos做為微服務的注冊中心 #dubbo.registry.address=zookeeper://192.168.170.37:2181?backup=192.168.170.37:2182,192.168.170.37:2183 dubbo.registry.address = nacos://10.1xx.xx..231:8848?backup=10.10.10.231:8848 dubbo.jetty.directory=/data/applogs/monitor #服務器地址 spring.cloud.nacos.config.server-addr=127.0.01:8848 #默認為Public命名空間,可以省略不寫 spring.cloud.nacos.config.namespace=top.suven #指定配置群組 --如果是Public命名空間 則可以省略群組配置 spring.cloud.nacos.config.group=video_group #文件名 -- 如果沒有配置則默認為 ${spring.application.name} spring.cloud.nacos.config.prefix=member # 微服務器部署 dubbo生產端組 dubbo.provider.group=DEV # 微服務器部署 dubbo生產端組版本號 dubbo.provider.version=1.0.0 dubbo.provider.dispatcher=message # 微服務器部署 dubbo消費端組 dubbo.consumer.group=DEV # 微服務器部署 dubbo消費端組版本號 dubbo.consumer.version=1.0.0 # 微服務器部署 dubbo消費端組版本號 dubbo.consumer.timeout=60000 # 微服務器部署 dubbo消費端是否檢查可用性 dubbo.consumer.check=false # 微服務器部署 dubbo消費端組 是否懶加載 dubbo.consumer.lazy=true dubbo.protocol.name=dubbo dubbo.protocol.accepts=200 dubbo.protocol.threads=200 dubbo.protocol.threadpool=cached #監控服務 #dubbo.monitor.protocol=registry #top.dubbo.sentinel.dashboardServer=192.1xx.xx..37:8866 #top.dubbo.sentinel.openFlow=true #top.dubbo.sentinel.logPath=/data/webapps/hsz/dubbo-sentinel-log #-----------------------------------END---------------------------------# #-----------------------------------nacos start---------------------------------# nacos.config.server-addr = 10.10.10.231:8848 #-----------------------------------nacos END---------------------------------# #--------------------------------PROJECT--------------------------------# ####Jetty properties######## # acceptor線程數,生產環境建議是64 #server.jetty.acceptors=2 ## selector線程數,生產環境建議是64 #server.jetty.selectors=8 # put或post方法最大字節數 server.max-http-header-size=1000 server.jetty.max-http-post-size=1000 server.servlet.context-path=/top #配置文件傳輸 spring.servlet.multipart.enabled = true spring.servlet.multipart.file-size-threshold = 0 #單個文件的最大上限 spring.servlet.multipart.max-file-size = 10MB #單個請求的文件總大小上限 spring.servlet.multipart.max-request-size=1000MB #服務基本目錄 top.jetty.server.documentRoot=/data/server #服務最小線程池數 top.jetty.server.threadPool.minThreads=8 #服務最大線程池:建議:1000 top.jetty.server.threadPool.maxThreads=200 #服務最大線程池:建議:3000 top.jetty.server.threadPool.idleTimeout=3000 #是否在調用void dump(Appendable out, String indent)是輸出更詳細的信息:建議:false top.jetty.server.threadPool.detailedDump=false #運行服務監控數據上報 top.jetty.server.lowResources.period=1000 top.jetty.server.lowResources.idleTimeout=200 top.jetty.server.lowResources.monitorThreads=true top.jetty.server.lowResources.maxConnections=10 top.jetty.server.lowResources.maxMemory=1000 top.jetty.server.lowResources.maxLowResourcesTime=5000 #微服服務隔斷哨兵模塊 top.async.asyncCorePoolSize=20 top.async.asyncMaxPoolSize=128 top.async.asyncQueueCapacity=500 top.async.asyncThreadNamePrefix=spring-async-thread- top.async.keepAliveSeconds=60 top.async.allowCoreThreadTimeOut=false top.async.poolSize=64 #-----------------------------------END---------------------------------# #--------------------------------DOS FILTER START--------------------------------# #防dos 攻擊攔截實現配置 top.jetty.filter.dos.enabled=true top.jetty.filter.dos.config.urlPatterns=/top/*,/server/* top.jetty.filter.dos.config.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* top.jetty.filter.dos.config.delayMs=-1 top.jetty.filter.dos.config.throttledRequests=5 top.jetty.filter.dos.config.maxRequestsPerSec=20 top.jetty.filter.dos.config.remotePort=true top.jetty.filter.dos.config.maxWaitMs=50 top.jetty.filter.dos.config.maxRequestMs=30000 top.jetty.filter.dos.config.maxIdleTrackerMs=30000 #-----------------------------------DOS FILTER END---------------------------------# #--------------------------------Login Type----------------------------# ###SESSION,TOKEN,ALL #驗證服務登陸信息與方式 top.server.param.validType=TOKEN top.server.param.logAop=false #參數驗證開啟: true /false top.server.param.checkParamSign=true #-----------------------------------END---------------------------------#
#-----------------------------------datasource-------------------------------------- #數據庫統計規范的配置文件 top.datasource.druid.config.enabled=true top.datasource.druid.slave.enabled=true #top.datasource.druid.url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&emptyStringsConvertToZero=true #top.datasource.druid.username: root #top.datasource.druid.password: root # com.mysql.jdbc.Driver top.datasource.druid.enum.class=com.ds.live.base.core.db.DataSourceGroupEnum.class top.datasource.druid.initialize=true top.datasource.druid.dbType= mysql top.datasource.druid.type = com.alibaba.druid.pool.DruidDataSource top.datasource.druid.driver-class-name =com.mysql.cj.jdbc.Driver top.datasource.druid.filters = stat top.datasource.druid.max-active = 20 top.datasource.druid.initial-size = 1 top.datasource.druid.min-idle = 3 top.datasource.druid.max-wait = 600 top.datasource.druid.time-between-eviction-runs-millis = 60000 top.datasource.druid.min-evictable-idle-time-millis = 300000 top.datasource.druid.validationQuery = select 'x'; top.datasource.druid.test-while-idle = true top.datasource.druid.test-on-borrow = true top.datasource.druid.test-on-return = true top.datasource.druid.pool-prepared-statements = true spring.datasource.druid.stat-view-servlet.enabled=false spring.datasource.druid.statViewServlet.urlPattern=/druid/* # \u767D\u540D\u5355\uFF1A #spring.datasource.druid.statViewServlet.allow= # IP\u9ED1\u540D\u5355 (\u5B58\u5728\u5171\u540C\u65F6\uFF0Cdeny\u4F18\u5148\u4E8Eallow) : \u5982\u679C\u6EE1\u8DB3deny\u7684\u8BDD\u63D0\u793A:Sorry, you are not permitted to view this page. #spring.datasource.druid.statViewServlet.deny= spring.datasource.druid.statViewServlet.loginUsername=admin spring.datasource.druid.statViewServlet.loginPassword=123456 # \u662F\u5426\u80FD\u591F\u91CD\u7F6E\u6570\u636E. spring.datasource.druid.statViewServlet.resetEnable=false spring.datasource.druid.web-stat-filter.enabled=false spring.datasource.druid.webStatFilter.sessionStatEnable=false spring.datasource.druid.webStatFilter.profileEnable=false spring.datasource.druid.webStatFilter.urlPattern=/* spring.datasource.druid.webStatFilter.exclusions="*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/server/druid/* spring.filter.dos.urlPatterns=/server/* spring.filter.dos.exclusions=/druid/*,/server/druid/* #-------------------------------------END--------------------------------------
#---------------------------------REDIS---------------------------------# # 數據表對象是否緩存到redis 開關,默認為true top.redis.cluster.client.daoOpen=true # 數據表對象是否寫入緩存到redis 開關, top.redis.cluster.client.write=true # 數據表對象是否讀取緩存到redis 開關, top.redis.cluster.client.read=true #redis 連接池配置參數文件 top.redis.cluster.enabled=true top.redis.cluster.timeout = 10000 top.redis.cluster.pool.maxTotal= 1000 top.redis.cluster.pool.maxIdle= 100 top.redis.cluster.pool.minIdle= 10 top.redis.cluster.pool.maxWaitMillis= 1000 top.redis.cluster.pool.timeout= 10000 top.redis.cluster.pool.maxRedirections= 2 top.redis.cluster.pool.testOnBorrow= true top.redis.cluster.pool.testOnReturn= true #------------------------------------END----------------------------------# # redis 多聚群配置實現;參考 RedisClusterEnum 配置; top.redis.cluster.servers=10.1xx.xx.231:7001;10.1xx.xx.231:7002;10.1xx.xx.231:7003;10.1xx.xx.231:7004;10.1xx.xx.231:7005;10.1xx.xx.231:7006 #top.redis.cluster.password=8Er^_QrO top.redis.cluster.servers.one=10.1xx.xx.231:7001;10.1xx.xx.231:7002;10.1xx.xx.231:7003;10.1xx.xx.231:7004;10.1xx.xx.231:7005;10.1xx.xx.231:7006 #top.redis.cluster.password.one=8Er^_QrO
# 項目提供和聚群微服務的架構,包括日志服elk, 大數據分析采摘kafka, 服務間解籍服務rocketmq #-----------------------------------kafka-------------------------------------- # kafka service config status : true/false top.kafka.config.enabled=false # kafka service producer status : true/false top.kafka.producer.enabled=true # top.kafka.producer (acks:0,1,-1(all)) top.kafka.producer.acks=0 top.kafka.producer.retries= 0 top.kafka.producer.batchSize= 6384 top.kafka.producer.bufferMemory=33554432 top.kafka.producer.lingerMs=1 top.kafka.producer.maxBlockMs=1000 top.kafka.producer.keySerializer= org.apache.kafka.common.serialization.StringSerializer top.kafka.producer.valueSerializer= org.apache.kafka.common.serialization.StringSerializer top.kafka.producer.bootstrapServers= 10.100.0.222:9092 # top.kafka.consumer # kafka service consumer status : true/false top.kafka.consumer.enabled=true top.kafka.consumer.groupId = top top.kafka.consumer.sessionTimeoutMs= 30000 top.kafka.consumer.enableAutoCommit =true top.kafka.consumer.autoCommitIntervalms =100 top.kafka.consumer.pollTimeout =100 top.kafka.consumer.concurrency=2 top.kafka.consumer.autoOffsetReset = earliest top.kafka.consumer.keyDeserializer =org.apache.kafka.common.serialization.StringDeserializer top.kafka.consumer.valueDeserializer = org.apache.kafka.common.serialization.StringDeserializer top.kafka.consumer.bootstrapServers = 10.100.0.222:9092 #--------------------------------------END-------------------------------------- #-----------------------------ROCKER-MQ---------------------------------# top.rocketmq.config.enabled=false top.rocketmq.nameSrvAdds=10.100.0.222:9876 top.rocketmq.maxMessageSize=131072 top.rocketmq.sendMsgTimeout=3000 top.rocketmq.retryTimesWhenSendFailed=2 top.rocketmq.consumeThreadMin=20 top.rocketmq.consumeThreadMax=64 top.rocketmq.delayTimeLevel=2 top.rocketmq.client.logLevel=INFO top.rocketmq.client.logRoot=/data/server/rocket-mq-log top.rocketmq.client.logFileMaxIndex=10 spring.rocketmq.producer.enabled=false spring.rocketmq.nameServer= 10.100.0.222:9876 spring.rocketmq.producer.retry-times-when-send-async-failed=0 spring.rocketmq.producer.send-msg-timeout=300000 spring.rocketmq.producer.compress-msg-body-over-howmuch=4096 spring.rocketmq.producer.max-message-size=4194304 spring.rocketmq.producer.retry-another-broker-when-not-store-ok=false spring.rocketmq.producer.retry-times-when-send-failed=3 spring.rocketmq.producer.group=TEST_AUTH spring.rocketmq.consumer.enabled=false #----------------------------------END-----------------------------------# #-----------------------------ACTIVITY-MQ--------------------------------# #spring.activemq.broker-url=failover:(tcp://10.100.0.253:61616)?maxReconnectDelay=5000&timeout=1000 #spring.activemq.user=system #spring.activemq.password=manager #spring.activemq.packages.trust-all=false #spring.activemq.pool.enabled=false ##spring.activemq.pool.expiry-timeout=0 ##spring.activemq.pool.idle-timeout=3000 #spring.activemq.pool.max-connections=20 #-------------------------------END--------------------------------------#
到此,關于“application.properties配置文件的方法”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。