apache/seata-naming-server

Sponsored OSS

By The Apache Software Foundation

Updated 5 days ago

Apache Seata(incubating) Naming Server

Image
0

10K+

apache/seata-naming-server repository overview

What is Seata Naming Server

Seata Naming Server is the naming service and service discovery component in the Seata microservices architecture, providing features such as service registration, service discovery, cluster management, and health checking.

Quick Start

Start a seata-naming-server instance

$ docker run --name seata-naming-server -p 8081:8081 apache/seata-naming-server:latest

Important Note: If no configuration file is specified or console password is not configured, the naming-server image will automatically generate a random password at startup and display it in the console logs. Please use the following command to view the generated password:

$ docker logs seata-naming-server | grep "auto-generated password"

Start with environment variables

$ docker run --name seata-naming-server \
        -p 8081:8081 \
        -e SERVER_PORT=8081 \
        -e SEATA_SECURITY_SECRETKEY=TXlDdXN0b21TZWNyZXRLZXlGb3JTZWF0YUpXVDIwMjQ= \
        -e SEATA_SECURITY_TOKEN_VALIDITY=1800000 \
        apache/seata-naming-server

Start with custom configuration file

$ docker run --name seata-naming-server \
        -p 8081:8081 \
        -v /PATH/TO/CONFIG_FILE/application.yml:/seata-namingserver/conf/application.yml \
        apache/seata-naming-server

Docker Compose Startup

Minimal Executable Configuration Example

version: "3"

services:
  seata-naming-server:
    image: apache/seata-naming-server:latest
    container_name: seata-naming-server
    hostname: seata-naming-server
    ports:
      - "8081:8081"
      - "10055:10055"  # JMX port (optional)
    environment:
      - SERVER_PORT=8081
      - SEATA_SECURITY_SECRETKEY=TXlDdXN0b21TZWNyZXRLZXlGb3JTZWF0YUpXVDIwMjQ=
      - SEATA_SECURITY_TOKEN_VALIDITY=1800000
    volumes:
      - ./logs:/logs/seata

Notes:

  • This configuration uses the default console account (username: seata)
  • If no password is configured, the system will automatically generate a random password and display it in the logs
  • View the generated password with docker logs seata-naming-server | grep "auto-generated password"

Container command line and log viewing

$ docker exec -it seata-naming-server sh
$ docker logs -f seata-naming-server

View auto-generated password

$ docker logs seata-naming-server 2>&1 | grep "auto-generated password"

Using Custom Configuration File

The default configuration file path is /seata-namingserver/conf. It is recommended to use custom configuration files by mounting volumes:

$ docker run --name seata-naming-server \
        -p 8081:8081 \
        -v /PATH/TO/CONFIG_FILE/application.yml:/seata-namingserver/conf/application.yml \
        apache/seata-naming-server

Custom configuration file example (application.yml):

server:
  port: 8081

spring:
  application:
    name: seata-namingserver

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

heartbeat:
  threshold: 90000  # Heartbeat timeout threshold (milliseconds)
  period: 60000     # Heartbeat period (milliseconds)

seata:
  security:
    # JWT secret key (must be Base64 encoded, generated with openssl rand -base64 32)
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    # Token validity period (milliseconds)
    tokenValidityInMilliseconds: 1800000
    # CSRF ignored URLs
    csrf-ignore-urls: /naming/v1/**,/api/v1/naming/**
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/version.json,/naming/v1/health,/error

# Console account configuration
console:
  user:
    username: admin      # Console login username, default: seata
    password: admin123   # Console login password, leave blank for auto-generated random password

Environment Variables

seata-naming-server supports the following environment variables:

Server Configuration

  • SERVER_PORT

Optional, specifies the HTTP port for seata-naming-server startup, default is 8081

Security Configuration

  • SEATA_SECURITY_SECRETKEY

Optional, specifies the JWT Token signing key, must be a Base64 encoded string. Can be generated with openssl rand -base64 32 or echo -n "your-secret" | base64. Default value is a built-in key, strongly recommended to change in production environments.

  • SEATA_SECURITY_TOKEN_VALIDITY

Optional, specifies the JWT Token validity period (milliseconds), default is 1800000 (30 minutes)

Heartbeat Configuration

  • HEARTBEAT_THRESHOLD

Optional, specifies the heartbeat timeout threshold (milliseconds). If no heartbeat is received within this time, the service is considered unavailable. Default is 90000 (90 seconds)

  • HEARTBEAT_PERIOD

Optional, specifies the heartbeat detection period (milliseconds), default is 60000 (60 seconds)

Console Account Configuration

Important Note: Console account and password configuration does not support environment variables. They must be configured by mounting the application.yml configuration file.

  • console.user.username (configuration file only)

Console login username, default is seata

  • console.user.password (configuration file only)

Console login password. If this is not configured, the system will automatically generate an 8-character random password at startup and display it in the console logs. It is strongly recommended to configure a custom password in production environments.

Logging Configuration

  • LOG_HOME

Optional, specifies the log file storage path, default is ${user.home}/logs/seata

Console Access

After successful startup, you can access the Naming Server console through the following methods:

API Endpoints

Contact Us

Submit feedback https://github.com/apache/incubator-seata/issues

Official Documentation

https://seata.apache.org/

Docker Hub

https://hub.docker.com/r/apache/seata-naming-server

Tag summary

Content type

Image

Digest

sha256:8c81ec5c0

Size

188.2 MB

Last updated

5 days ago

docker pull apache/seata-naming-server

This week's pulls

Pulls:

1,478

Last week