Amazon EC2(Linux)にSwap領域を追加する。 IT by NHM - 2021-06-022021-06-02 やはり基本は公式から ハードドライブ上のパーティションを使用して、Amazon EC2 インスタンスのスワップ領域として機能するようにメモリを割り当てるにはどうすればよいですか?https://aws.amazon.com/jp/premiumsupport/knowledge-center/ec2-memory-partition-hard-drive/ スワップファイルを使用して、Amazon EC2 インスタンスのスワップ領域として機能するようにメモリを割り当てるにはどうすればよいですか?https://aws.amazon.com/jp/premiumsupport/knowledge-center/ec2-memory-swap-file/ t2.microはこんな感じ。これではすぐにやられてしまう。 $ free -m. total used free shared buff/cache available. Mem: 983 449 255 0 278 401. Swap:
Amazon Linux2のタイムゾーンを変更する。 IT by NHM - 2021-03-172021-03-17 デフォルトではUTCになっている。これは日本時間人間としてはちょっと困る。+9hすればいいだけだが。 $ date 2021年 3月 17日 水曜日 08:10:40 UTC というわけでいつものAWSドキュメント Amazon Linux での タイムゾーンの変更https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/set-time.html#change_time_zone まずは設定可能なタイムゾーンを確認する。 ls /usr/share/zoneinfo Africa Canada GB Indian Mexico ROK iso3166.tab America Chile GB-Eire Iran NZ Singapore leapseconds Antarctica Cuba GMT Israel NZ-CHAT Turkey posix Arctic EET GMT+0
amazon ec2 linux2にredis 4をインストールする。 IT by NHM - 2021-02-242021-02-24 普通にインストールすると3.x系がインストールされる。 yum install redis sudo amazon-linux-extras install redis4.0
EPEL(Extra Packages for Enterprise Linux) IT by NHM - 2021-02-082021-02-08 CentOS sudo yum install epel-release Amazon Linux sudo amazon-linux-extras install epel
Failed to execute operation: The name org.freedesktop.PolicyKit1 was not provided by any .service files IT by NHM - 2021-02-082021-02-08 redisインストール後にsystemctl で有効化しようとすると掲題のエラーが出た。 systemctl enable redis Failed to execute operation: The name org.freedesktop.PolicyKit1 was not provided by any .service files sudoのつけ忘れ。パーミッションというか実行権限がなかった。
Amazon-Linux-2でホスト名を設定する IT by NHM - 2021-01-292021-02-17 インスタンス起動作成した時点ではIPアドレスが表示されている。 これでは正直わかりにくいのでhostnamectlコマンドを利用して設定する。 sudo hostnamectl set-hostname ホスト名 hostname 再度ログインするかsudo su などでユーザ変更すると確認できる。 Amazon Linux インスタンスのホスト名を変更するhttps://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/set-hostname.html
AWSのEC2にDockerをインストールする IT by NHM - 2021-01-282021-02-17 dockerはyumで普通にインストールする。 sudo yum install -y docker docker-composeのインストール方法はHPに丁寧に記載されている。 Docker Compose のインストールhttps://docs.docker.jp/compose/install.html 要約するとLinuxには下記の三つ。 Linux における Compose のインストールpip を利用したインストールコンテナとしてのインストール 1がおすすめ。理由は下記 2:python3入れなくちゃいけないのが面倒3:dockerサービス立ち上げておく必要がある。 3でdocker立ち上げてないとdocker-compose --version時にエラーでる。 docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See 'docker run --help'. docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied. というわけで下記で実行 $ sudo curl -L https://github.com/docker/compose/releases/download/1.28.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose $ docker-compose --version docker-compose version 1.28.2, build 67630359