may 2016 log

May 31, 2016 by ntk1000

2016-05-27

slack time signal

/remind #channel to morning standup at 10am every weekday
/remind #channel to evening standup at 5pm every weekday
/remind list

2016-05-24

install redis-cli on ec2

$ sudo yum install -y gcc
$ wget http://download.redis.io/redis-stable.tar.gz
$ tar xvzf redis-stable.tar.gz
$ cd redis-stable
$ make
$ src/redis-cli -h %elasticacheendpoint% -p 6379

2016-05-17

setting timezone at alpine linux on docker


FROM gliderlabs/alpine:latest

RUN apk --no-cache add tzdata && \
  cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
  apk del tzdata 

2016-05-11

mysql(RDS or Aurora) dump restore from local file

$ ls
dump.sql

$ mysql -h your.rds.amazonaws.com -P 3306 -u userid -p
mysql> source dump.sql

2016-05-10

aws ecs service limits

via http://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/service_limits.html

The following table provides the default limits for Amazon ECS for an AWS account which can be changed. For more information, see AWS Service Limitsin the Amazon Web Services General Reference.

Resource Default Limit Number of clusters per region, per account 1000 Number of container instances per cluster 1000 Number of services per cluster 500

The following table provides other limitations for Amazon ECS that cannot be changed.

Resource Default Limit Number of load balancers per service 1 Number of tasks per service (the desired count) 1000 Number of tasks launched (count) per run-task 10 Number of container instances per start-task 10 Throttle on container instance registration rate 1 per second / 60 max per minute Task definition size limit 32 KiB Task definition max containers 10 Throttle on task definition registration rate 1 per second / 60 max per minute

2016-05-09

running coreos on aws ecs

via * https://coreos.com/os/docs/latest/booting-on-ecs.html * https://coreos.com/os/docs/latest/booting-on-ec2.html

  • on ec2 console
  • create launchconfiguration with coreos ami and user-data

user-data are as follows

#cloud-config

coreos:
  etcd2:
    # generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3
    # specify the initial size of your cluster with ?size=X
    discovery: https://discovery.etcd.io/a4ca4dd8ac25ff375ff9439c929b9eb3
    # multi-region and multi-cloud deployments need to use $public_ipv4
    advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
    initial-advertise-peer-urls: http://$private_ipv4:2380
    # listen on both the official ports and the legacy ports
    # legacy ports can be omitted if your application doesn't depend on them
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
  units:
    - name: etcd2.service
      command: start
    - name: fleet.service
      command: start
    - name: amazon-ecs-agent.service
      command: start
      runtime: true
      content: |
       [Unit]
       Description=AWS ECS Agent
       Documentation=https://docs.aws.amazon.com/AmazonECS/latest/developerguide/
       Requires=docker.socket
       After=docker.socket
       [Service]
       Environment=ECS_CLUSTER=my-ecs-cluster-name
       Environment=ECS_LOGLEVEL=info
       Environment=ECS_VERSION=latest
       Restart=on-failure
       RestartSec=30
       RestartPreventExitStatus=5
       SyslogIdentifier=ecs-agent
       ExecStartPre=-/bin/mkdir -p /var/log/ecs /var/ecs-data /etc/ecs
       ExecStartPre=-/usr/bin/touch /etc/ecs/ecs.config
       ExecStartPre=-/usr/bin/docker kill ecs-agent
       ExecStartPre=-/usr/bin/docker rm ecs-agent
       ExecStartPre=/usr/bin/docker pull amazon/amazon-ecs-agent:${ECS_VERSION}
       ExecStart=/usr/bin/docker run --name ecs-agent \
                                     --env-file=/etc/ecs/ecs.config \
                                     --volume=/var/run/docker.sock:/var/run/docker.sock \
                                     --volume=/var/log/ecs:/log \
                                     --volume=/var/ecs-data:/data \
                                     --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
                                     --volume=/run/docker/execdriver/native:/var/lib/docker/execdriver/native:ro \
                                     --publish=127.0.0.1:51678:51678 \
                                     --env=ECS_LOGFILE=/log/ecs-agent.log \
                                     --env=ECS_LOGLEVEL=${ECS_LOGLEVEL} \
                                     --env=ECS_DATADIR=/data \
                                     --env=ECS_CLUSTER=${ECS_CLUSTER} \
                                     amazon/amazon-ecs-agent:${ECS_VERSION}
  • create elb and autoscaling

  • on ecs console

  • create ecs cluster

  • start service