Help us understand the problem. What is going on with this article?

Amazon ECSでHashiCorp Vaultを動かそうとしてハマった件

More than 1 year has passed since last update.

問題
Macのローカルで動作していた HashiCorp Vault のDockerイメージをAmazon ECSに持っていったら、タスクが起動停止を繰り返してしまう症状が発生した。

環境
Docker image / 0.8.3, https://hub.docker.com/_/vault/
ECSインスタンス / amzn-ami-2017.03.g-amazon-ecs-optimized (ami-21815747)

原因と対策
ECSインスタンスにログインして、ログを確認したところ、

原因
$ docker logs <CONTAINER ID>
Error initializing core: Failed to lock memory: cannot allocate memory

This usually means that the mlock syscall is not available.
Vault uses mlock to prevent memory from being swapped to
disk. This requires root privileges as well as a machine
that supports mlock. Please enable mlock on your system or
disable Vault from using it. To disable Vault from using it,
set the `disable_mlock` configuration option in your configuration
file.

とのことだった。

一瞬、え?メモリ不足?と思ったのだが、
このECSインスタンスでは mlock が動作しないらしく、
Vaultのconfigに
disable_mlock = 1
を追記し、imageをECRにpushし直したら元気に動くようになった。

めでたしめでたし。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away