apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.09k stars 8.73k forks source link

1.6.1版本k8s启动成功,但服务没注册到nacos;docker服务注册正常 #5385

Open luojiasheng opened 1 year ago

luojiasheng commented 1 year ago

参照官网k8s部署手册进行部署服务,发现服务成功启动,nacos上服务列表没有;docker方式正常。 11:28:49.882 INFO --- [ main] io.seata.server.ServerApplication : Starting ServerApplication using Java 1.8.0_342 on seata-server-68b7c8b885-ztjg7 with PID 1 (/seata-server/classes started by root in /seata-server) 11:28:49.885 INFO --- [ main] io.seata.server.ServerApplication : No active profile set, falling back to 1 default profile: "default" 11:28:51.081 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 7091 (http) 11:28:51.090 INFO --- [ main] o.a.coyote.http11.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-7091"] 11:28:51.091 INFO --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 11:28:51.091 INFO --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62] 11:28:51.170 INFO --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 11:28:51.170 INFO --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1245 ms 11:28:51.859 INFO --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 11:28:52.027 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.028 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/'] with [] 11:28:52.028 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.css']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.028 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.css'] with [] 11:28:52.028 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.js']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.028 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.js'] with [] 11:28:52.028 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.html']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.html'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.map']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.map'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.svg']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.svg'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.png']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.png'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.ico']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.ico'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/console-fe/public/**']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.029 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/console-fe/public/**'] with [] 11:28:52.029 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/api/v1/auth/login']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 11:28:52.030 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/api/v1/auth/login'] with [] 11:28:52.056 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will not secure any request 11:28:52.087 INFO --- [ main] o.a.coyote.http11.Http11NioProtocol : Starting ProtocolHandler ["http-nio-7091"] 11:28:52.102 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 7091 (http) with context path '' 11:28:52.110 INFO --- [ main] io.seata.server.ServerApplication : Started ServerApplication in 3.121 seconds (JVM running for 3.668) 11:28:52.353 INFO --- [ main] i.s.core.rpc.netty.NettyServerBootstrap : Server started, service listen port: 30091 11:28:52.362 INFO --- [ main] io.seata.server.ServerRunner : seata server started in 250 millSeconds

另外发现 中文和英文语言得k8s部署配置也不大相同

slievrly commented 1 year ago

@luojiasheng Is the configuration file using type conf or properties, yml ?

luojiasheng commented 1 year ago

@luojiasheng Is the configuration file using type conf or properties, yml ?

` apiVersion: v1 kind: Service metadata: name: seata-server namespace: default labels: k8s-app: seata-server spec: type: NodePort ports:


apiVersion: apps/v1 kind: Deployment metadata: name: seata-server namespace: default labels: k8s-app: seata-server spec: replicas: 1 selector: matchLabels: k8s-app: seata-server template: metadata: labels: k8s-app: seata-server spec: containers:

apiVersion: v1 kind: ConfigMap metadata: name: seata-server-config data: application.yml: | server: port: 7091

spring:
  application:
    name: seata-server

logging:
  config: classpath:logback-spring.xml
  file:
    path: ${user.home}/logs/seata

console:
  user:
    username: seata
    password: seata

seata:
  config:
    type: nacos
    nacos:
      server-addr: 172.17.96.111:8848
      namespace: dev
      #group: SEATA_GROUP
      group: WECHAT_MALL_GROUP
      username:
      password:
      context-path:
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key:
      #secret-key:
      data-id: wm_seata_server.properties
  registry:
    type: nacos
    nacos:
      application: seata-server
      server-addr: 172.17.96.111:8848
      #group: SEATA_GROUP
      group: WECHAT_MALL_GROUP
      namespace: dev
      cluster: wmCluster
      username:
      password:
      context-path:
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key:
      #secret-key:
  store:
    mode: db
    db:
      datasource: hikari
      db-type: mysql
      driver-class-name: com.mysql.jdbc.Driver
      url: jdbc:mysql://172.17.96.111:3306/seata_server?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true
      user: root
      password: Fj39sl20@
      min-conn: 10
      max-conn: 100
      global-table: global_table
      branch-table: branch_table
      lock-table: lock_table
      distributed-lock-table: distributed_lock
      query-limit: 1000
      max-wait: 5000
  server:
      service-port: 30091
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login

`

chinaboy007 commented 1 year ago

我也遇到了 就解决办法