Seata Naming Server Docker Image
Apache Seata分布式事务解决方案的命名服务组件,提供服务注册、发现及负载均衡能力,支持分布式事务场景下的服务协调与通信,保障微服务架构中事务参与者的可靠交互。
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
bash$ 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:
bash$ docker logs seata-naming-server | grep "auto-generated password"
Start with environment variables
bash$ 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
bash$ 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
yamlversion: "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
bash$ docker exec -it seata-naming-server sh
bash$ docker logs -f seata-naming-server
View auto-generated password
bash$ 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:
bash$ 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):
yamlserver: 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 32orecho -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 *** (30 minutes)
Heartbeat Configuration
- HEARTBEAT_THRESHOLD
Optional, specifies the heartbeat timeout threshold (milliseconds). If no heartbeat is received within this time, the service is ***ed 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
- Health Check: http://localhost:8081/naming/v1/health
- Login API: http://localhost:8081/api/v1/auth/login
- Service Registration: http://localhost:8081/naming/v1/instance
- Service Discovery: http://localhost:8081/naming/v1/cluster/units
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
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
轩辕镜像加速拉取命令点我查看更多 seata-naming-server 镜像标签
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务