localstack

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LocalStack Lifecycle Management

LocalStack容器生命周期管理

Manage the LocalStack container lifecycle including starting, stopping, and monitoring the local cloud environment.
管理LocalStack容器的生命周期,包括启动、停止和监控本地云环境。

Capabilities

功能特性

  • Start LocalStack with custom configuration
  • Stop running LocalStack instances
  • Check LocalStack status and health
  • Restart LocalStack with new settings
  • View LocalStack version and configuration
  • 使用自定义配置启动LocalStack
  • 停止运行中的LocalStack实例
  • 检查LocalStack的状态和健康情况
  • 使用新设置重启LocalStack
  • 查看LocalStack版本和配置

Common Commands

常用命令

Start LocalStack

启动LocalStack

bash
undefined
bash
undefined

Basic start

基础启动

localstack start -d
localstack start -d

Start with debug mode

启用调试模式启动

DEBUG=1 localstack start -d
DEBUG=1 localstack start -d

Start with Pro features (requires auth token)

启动专业版功能(需要授权令牌)

LOCALSTACK_AUTH_TOKEN=<token> localstack start -d
undefined
LOCALSTACK_AUTH_TOKEN=<token> localstack start -d
undefined

Check Status

检查状态

bash
undefined
bash
undefined

Check if LocalStack is running

检查LocalStack是否在运行

localstack status
localstack status

Check service health

检查服务健康状态

View running Docker container

查看运行中的Docker容器

docker ps | grep localstack
undefined
docker ps | grep localstack
undefined

Stop LocalStack

停止LocalStack

bash
undefined
bash
undefined

Graceful stop

优雅停止

localstack stop
localstack stop

Force stop via Docker

通过Docker强制停止

docker stop localstack-main
undefined
docker stop localstack-main
undefined

View Logs

查看日志

bash
undefined
bash
undefined

Follow logs

实时查看日志

localstack logs -f
localstack logs -f

View last 100 lines

查看最后100行日志

localstack logs --tail 100
undefined
localstack logs --tail 100
undefined

Configuration Options

配置选项

Key environment variables for LocalStack:
VariableDescriptionDefault
DEBUG
Enable debug logging
0
PERSISTENCE
Enable persistence across restarts
0
LOCALSTACK_AUTH_TOKEN
Auth token for Pro featuresNone
GATEWAY_LISTEN
Port configuration
4566
LocalStack的关键环境变量:
变量描述默认值
DEBUG
启用调试日志
0
PERSISTENCE
启用跨重启持久化
0
LOCALSTACK_AUTH_TOKEN
专业版功能的授权令牌None
GATEWAY_LISTEN
端口配置
4566

Troubleshooting

故障排查

  • Container won't start: Check if port 4566 is already in use
  • Services unavailable: Verify Docker is running and has sufficient resources
  • Auth errors: Ensure
    LOCALSTACK_AUTH_TOKEN
    is set for Pro features
  • 容器无法启动:检查端口4566是否已被占用
  • 服务不可用:确认Docker正在运行且有足够资源
  • 授权错误:确保为专业版功能设置了
    LOCALSTACK_AUTH_TOKEN