WXzhongwang commented on issue #5265:
URL: https://github.com/apache/shenyu/issues/5265#issuecomment-1793341126
and then i used docker to set up two containters as below:
```yaml
docker network create shenyu
docker run --name shenyu-admin \
-v
/Users/yuanjinxiu/shenyu-v2.6.0/shenyu-admin/ext-lib:/opt/shenyu-admin/ext-lib \
-v /Users/yuanjinxiu/shenyu-v2.6.0/shenyu-admin/logs:/opt/shenyu-admin/logs \
-e "SPRING_PROFILES_ACTIVE=mysql"\
-e
"spring.datasource.url=jdbc:mysql://host.docker.internal:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull"
\
-e "spring.datasource.username=root" \
-e "spring.datasource.password=xxx" \
-d -p 9095:9095 \
--net shenyu \
apache/shenyu-admin:2.6.0
docker run -d \
-p 9195:9195 \
--name shenyu-bootstrap \
-v
/Users/yuanjinxiu/shenyu-v2.6.0/shenyu-bootstrap/logs/:/opt/shenyu-bootstrap/logs
\
-v
/Users/yuanjinxiu/shenyu-v2.6.0/shenyu-bootstrap/conf/:/opt/shenyu-bootstrap/conf
\
-e "shenyu.register.serverLists=zookeeper:2181" \
-e "shenyu.register.registerType=zookeeper" \
-e "spring.main.allow-bean-definition-overriding=true" \
--net shenyu \
--env SHENYU_SYNC_WEBSOCKET_URLS=ws://shenyu-admin:9095/websocket \
apache/shenyu-bootstrap:2.6.0
```
the yaml of shenyu bootstrap as below:
```
server:
port: 9195
address: 0.0.0.0
compression:
enabled: true
minResponseSize: 1MB # If the response data is greater than 1MB, enable
compression.
spring:
main:
allow-bean-definition-overriding: true
application:
name: shenyu-bootstrap
codec:
max-in-memory-size: 2MB
cloud:
discovery:
enabled: false
nacos:
discovery:
server-addr: 127.0.0.1:8848 # Spring Cloud Alibaba Dubbo use this.
enabled: false
namespace: ShenyuRegisterCenter
# if you want use ribbon please config every server.
#springCloud-test:
# ribbon:
# NIWSServerListClassName:
com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList
eureka:
client:
enabled: false
serviceUrl:
defaultZone: http://localhost:8761/eureka/
instance:
prefer-ip-address: true
# security:
# oauth2:
# client:
# registration:
# <your client-registration-id>:
# client-id: <your client-id>
# client-secret: <your client-secret>
# provider:
# <your client-registration-id>:
# authorization-uri: <your authorization-uri>
# token-uri: <your access-token-uri>
# user-info-uri: <your user-info-uri>
# jwk-set-uri: <your jwk-set-uri>
management:
health:
redis:
enabled: false
elasticsearch:
enabled: false
endpoint:
health:
enabled: true
show-details: always
endpoints:
web:
exposure:
include: "*" # or health,info
shenyu:
selectorMatchCache:
## selector L1 cache
cache:
enabled: false
initialCapacity: 10000 # initial capacity in cache
maximumSize: 10000 # max size in cache
## selector L2 cache, use trie as L2 cache
trie:
enabled: false
cacheSize: 128 # the number of plug-ins
matchMode: antPathMatch
ruleMatchCache:
## rule L1 cache
cache:
enabled: true
initialCapacity: 10000 # initial capacity in cache
maximumSize: 65536 # max size in cache
## rule L2 cache, use trie as L2 cache
trie:
enabled: false
cacheSize: 1024 # the number of selectors
matchMode: antPathMatch
netty:
http:
# set to false, user can custom the netty tcp server config.
webServerFactoryEnabled: true
selectCount: 1
workerCount: 8
accessLog: false
serverSocketChannel:
soRcvBuf: 87380
soBackLog: 128
soReuseAddr: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 65536
writeBufferLowWaterMark: 32768
writeSpinCount: 16
autoRead: false
allocType: "pooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
socketChannel:
soKeepAlive: false
soReuseAddr: false
soLinger: -1
tcpNoDelay: true
soRcvBuf: 87380
soSndBuf: 16384
ipTos: 0
allowHalfClosure: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 65536
writeBufferLowWaterMark: 32768
writeSpinCount: 16
autoRead: false
allocType: "pooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
sni:
enabled: false
mod: k8s #manul
defaultK8sSecretNamespace: shenyu-ingress
defaultK8sSecretName: default-cert
# mod: manual
# certificates:
# - domain: 'localhost'
# keyCertChainFile:
'/Users/zhukunshuai/Desktop/cert/example.com+1.pem'
# keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem'
# - domain: 'example.com'
# keyCertChainFile:
'/Users/zhukunshuai/Desktop/cert/example.com+1.pem'
# keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem'
# httpclient:
# strategy: webClient # netty
# connectTimeout: 45000
# responseTimeout: 3000
# readerIdleTime: 3000
# writerIdleTime: 3000
# allIdleTime: 3000
# readTimeout: 3000
# writeTimeout: 3000
# wiretap: false
# keepAlive: false
# maxInMemorySize: 1 #1mb
# pool:
# type: ELASTIC
# name: proxy
# maxConnections: 16
# acquireTimeout: 45000
# maxIdleTime: 3000 # unit: ms
# maxLifeTime: # unit: ms
# evictionInterval: # unit: ms
# metrics: false
# proxy:
# host:
# port:
# username:
# password:
# nonProxyHostsPattern:
# ssl:
# useInsecureTrustManager: true
# keyStoreType: PKCS12
# keyStorePath: classpath:keystore.p12
# keyStorePassword: 123456
# keyStoreProvider:
# keyPassword: 123456
# trustedX509Certificates:
# handshakeTimeout:
# closeNotifyFlushTimeout:
# closeNotifyReadTimeout:
# defaultConfigurationType:
# threadPool:
# prefix: shenyu
# selectCount: 1
# workerCount: 8
# daemon: true
duplicate-response-header:
strategy: RETAIN_FIRST
headers:
- Access-Control-Allow-Origin
register:
enabled: false
registerType: zookeeper #etcd #consul
serverLists: localhost:2181 #http://localhost:2379 #localhost:8848
props:
cross:
enabled: true
allowedHeaders:
allowedMethods: "*"
allowedAnyOrigin: true # the same of Access-Control-Allow-Origin: "*"
# allowedOrigin:
# format : schema://prefix spacer domain
# Access-Control-Allow-Origin:
"http://a.apache.org,http://b.apache.org"
# spacer: "."
# domain: apache.org
# prefixes:
# - a # a.apache.org
# - b # b.apache.org
# origins:
# - c.apache.org
# - d.apache.org
# - http://e.apache.org
# originRegex: ^http(|s)://(.*\.|)abc.com$
allowedExpose: ""
maxAge: "18000"
allowCredentials: true
switchConfig:
local: true
collapseSlashes: false
file:
enabled: true
maxSize : 10
sync:
websocket:
urls: ws://shenyu-admin:9095/websocket
# allowOrigin: ws://shenyu-admin:9195
# apollo:
# appId: shenyu
# meta: http://localhost:8080
# env: dev
# clusterName: test
# namespace: application
# zookeeper:
# url: localhost:2181
# sessionTimeout: 5000
# connectionTimeout: 2000
# http:
# url: http://localhost:9095
# username:
# password:
# nacos:
# url: localhost:8848
# namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
# username:
# password:
# acm:
# enabled: false
# endpoint: acm.aliyun.com
# namespace:
# accessKey:
# secretKey:
# polaris:
# url: 127.0.0.1:8093
# namespace:
# fileGroup:
# etcd:
# url: http://localhost:2379
# consul:
# url: http://localhost:8500
# waitTime: 10000
# watchDelay: 10000
exclude:
enabled: false
paths:
- /favicon.ico
fallback:
enabled: false
paths:
- /fallback/hystrix
- /fallback/resilience4j
- /fallback/sentinel
health:
enabled: true
paths:
- /actuator
- /health_check
alert:
enabled: true
admins: localhost:9095
extPlugin:
path:
enabled: true
threads: 1
scheduleTime: 300
scheduleDelay: 30
scheduler:
enabled: false
type: fixed
threads: 16
upstreamCheck:
enabled: false
poolSize: 10
timeout: 3000
healthyThreshold: 1
unhealthyThreshold: 1
interval: 5000
printEnabled: true
printInterval: 60000
springCloudCache:
enabled: false
ribbon:
serverListRefreshInterval: 10000
metrics:
enabled: false
name : prometheus
host: 127.0.0.1
port: 8090
jmxConfig:
props:
jvm_enabled: true
# plugins:
# rate-limiter.enabled: false
local:
enabled: false
sha512Key:
"BA3253876AED6BC22D4A6FF53D8406C6AD864195ED144AB5C87621B6C233B548BAEAE6956DF346EC8C17F5EA10F35EE3CBC514797ED7DDD3145464E2A0BAB413"
websocket:
enableProxyPing: false
# sharedPool:
# enable: true
# prefix: "shenyu-shared"
# corePoolSize: 200
# maximumPoolSize: 2000
# keepAliveTime: 60000
# # 1GB
# maxWorkQueueMemory: 1073741824
# # 256MB
# maxFreeMemory: 268435456
logging:
level:
root: info
org.springframework.boot: info
org.apache.ibatis: info
org.apache.shenyu.bonuspoint: info
org.apache.shenyu.lottery: info
org.apache.shenyu: info
org.springframework.http.server.reactive: info
org.springframework.web.reactive: info
reactor.ipc.netty: info
reactor.netty: info
```
shenyu-admin start up normally, shenyu-bootstrap can start this time, but
there are some error logs occured.
Any helps would be appreciated!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]