fenixsoft / microservice_arch_kubernetes Goto Github PK
View Code? Open in Web Editor NEW基于Kubernetes实现的微服务架构示例工程。《凤凰架构》的配套组件。
Home Page: https://icyfenix.cn
License: Apache License 2.0
基于Kubernetes实现的微服务架构示例工程。《凤凰架构》的配套组件。
Home Page: https://icyfenix.cn
License: Apache License 2.0
kubectl get pods -o wide -A
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
bookstore-microservices bookstore-microservices-domain-account-586bfcf795-xwns8 1/1 Running 0 25m 172.16.104.18 node2
bookstore-microservices bookstore-microservices-domain-payment-586b9b464-rpkpm 1/1 Running 0 25m 172.16.166.141 node1
bookstore-microservices bookstore-microservices-domain-security-557d78bb5b-mqk8f 1/1 Running 0 25m 172.16.104.20 node2
bookstore-microservices bookstore-microservices-domain-warehouse-6c6d6886f9-z8bms 1/1 Running 0 25m 172.16.166.137 node1
bookstore-microservices bookstore-microservices-platform-gateway-665dddcd8c-mpds8 1/1 Running 2 (18m ago) 25m 172.16.104.24 node2
kubectl get svc -A
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
bookstore-microservices account ClusterIP 10.104.226.115 80/TCP 25m
bookstore-microservices gateway NodePort 10.98.218.93 8080:30080/TCP 25m
bookstore-microservices payment ClusterIP 10.105.222.242 80/TCP 25m
bookstore-microservices security ClusterIP 10.109.133.33 80/TCP 25m
bookstore-microservices warehouse ClusterIP 10.105.147.22 80/TCP 25m
部署成功了,但是实际登录192.168.159.130:30080时,报http500错误
接收到未处理的异常:
HTTP Code:500, 信息:[Internal Server Error] Connect to warehouse:80 [warehouse/10.105.147.22] failed: Connection refused (Connection refused)
报错信息:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007f6a2fc8f9bc, pid=1, tid=7
#
# JRE version: OpenJDK Runtime Environment (12.0+29) (build 12-ea+29)
# Java VM: OpenJDK 64-Bit Server VM (12-ea+29, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64)
# Problematic frame:
# v ~StubRoutines::updateBytesCRC32
#
# Core dump will be written. Default location: //core.1 (max size 1024 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# //hs_err_pid1.log
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Run: kubectl apply -f https://raw.githubusercontent.com/fenixsoft/microservice_arch_kubernetes/master/bookstore.yml
Got in pods log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x00007fe41a2b69bc, pid=1, tid=7
#
# JRE version: OpenJDK Runtime Environment (12.0+29) (build 12-ea+29)
# Java VM: OpenJDK 64-Bit Server VM (12-ea+29, mixed mode, sharing, tiered, compressed oops, serial gc, linux-amd64)
# Problematic frame:
# v ~StubRoutines::updateBytesCRC32
#
# Core dump will be written. Default location: //core.1 (max size 1024 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# //hs_err_pid1.log
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Maybe it's a JDK bug, and I can avoid this by adding -XX:UseSSE=2 to JAVA_TOOL_OPTIONS temporarily
account module下的有个包名错了, applicaiton -->application
Build Failed. No push access to specified image repository. Trying running with
--default-repo
flag.
请问下,按照 readme.md 克隆到本地,按照构建命令构建,skaffold dev
报错如上,需要做什么配置吗?
以下是按照构建部分输出:
./mvnw package
[INFO]
[INFO] bookstore-microservices-kubernetes ................. SUCCESS [ 0.952 s]
[INFO] bookstore-microservices-platform-gateway ........... SUCCESS [ 1.391 s]
[INFO] bookstore-microservices-library-infrastructure ..... SUCCESS [ 0.460 s]
[INFO] bookstore-microservices-library-testing ............ SUCCESS [ 0.211 s]
[INFO] bookstore-microservices-domain-security ............ SUCCESS [ 15.275 s]
[INFO] bookstore-microservices-domain-payment ............. SUCCESS [ 14.341 s]
[INFO] bookstore-microservices-domain-account ............. SUCCESS [ 14.164 s]
[INFO] bookstore-microservices-domain-warehouse ........... SUCCESS [ 14.414 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:01 min
[INFO] Finished at: 2021-06-01T15:34:02+08:00
[INFO] ------------------------------------------------------------------------
skaffold dev
Listing files to watch...
- icyfenix/bookstore-kubernetes-domain-warehouse
- icyfenix/bookstore-kubernetes-domain-security
- icyfenix/bookstore-kubernetes-domain-account
- icyfenix/bookstore-kubernetes-domain-payment
- icyfenix/bookstore-kubernetes-platform-gateway
……
……
……
Checking cache...
- icyfenix/bookstore-kubernetes-domain-warehouse: Not found. Building
- icyfenix/bookstore-kubernetes-domain-security: Not found. Building
- icyfenix/bookstore-kubernetes-domain-account: Not found. Building
- icyfenix/bookstore-kubernetes-domain-payment: Not found. Building
- icyfenix/bookstore-kubernetes-platform-gateway: Not found. Building
Starting build...
……
……
……
Successfully built 85cb40a7b4bd
Successfully tagged icyfenix/bookstore-kubernetes-domain-warehouse:latest
The push refers to repository [docker.io/icyfenix/bookstore-kubernetes-domain-warehouse]
fe767f9494ae: Preparing
e10fdc20c652: Preparing
503e53e365f3: Preparing
Building [icyfenix/bookstore-kubernetes-domain-security]...
Building [icyfenix/bookstore-kubernetes-domain-account]...
Building [icyfenix/bookstore-kubernetes-domain-payment]...
Building [icyfenix/bookstore-kubernetes-platform-gateway]...
Build Failed. No push access to specified image repository. Trying running with `--default-repo` flag.
周老师好,通过下面的命令启动整个集群:
kubectl apply -f bookstore.yml
其他都显示正常启动,就是bookstore-microservices-platform-gateway服务启动不了,是不是这个镜像有问题?因为我看到这个镜像的下载次数比其他镜像的多一倍。
基于minikube环境:
[root@k8s microservice_arch_kubernetes]# minikube version
minikube version: v1.7.2
commit: 50d543b5fcb0e1c0d7c27b1398a9a9790df09dfb
pod的日志如下:
[root@k8s microservice_arch_kubernetes]# kubectl logs bookstore-microservices-platform-gateway-84b7c776dd-k2sd4 -n bookstore-microservices
Picked up JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n,quiet=y
______ _ ____ __ _____ __
/ ____/__ ____ (_) __ / __ )____ ____ / /_/ ___// /_____ ________
/ /_ / _ \/ __ \/ / |/_/ / __ / __ \/ __ \/ __/\__ \/ __/ __ \/ ___/ _ \
/ __/ / __/ / / / /> < / /_/ / /_/ / /_/ / /_ ___/ / /_/ /_/ / / / __/
/_/ \___/_/ /_/_/_/|_| /_____/\____/\____/\__//____/\__/\____/_/ \___/
API Gateway
2021-07-22 14:39:15.572 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2021-07-22 14:39:15.813 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2021-07-22 14:39:15.827 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:148) ~[spring-cloud-config-client-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52) ~[spring-cloud-context-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locateCollection(ConfigServicePropertySourceLocator.java:163) ~[spring-cloud-config-client-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:97) ~[spring-cloud-context-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
at com.github.fenixsoft.bookstore.gateway.GatewayApplication.main(GatewayApplication.java:19) ~[classes!/:1.0.0-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[gateway.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[gateway.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[gateway.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[gateway.jar:1.0.0-SNAPSHOT]
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/gateway/default": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:748) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:583) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:264) ~[spring-cloud-config-client-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:107) ~[spring-cloud-config-client-2.2.2.RELEASE.jar!/:2.2.2.RELEASE]
... 17 common frames omitted
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[na:na]
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[na:na]
at java.base/java.net.Socket.connect(Socket.java:591) ~[na:na]
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[na:na]
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[na:na]
at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[na:na]
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1242) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075) ~[na:na]
at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1009) ~[na:na]
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:739) ~[spring-web-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
... 21 common frames omitted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.