This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. 継続利用する Node Endpoint read1 - 3 の weight を 1 にする | |
ansible -m 'shell' -i production haproxy -s -a'echo "set weight mysql/reader1 1" | sudo socat stdio /var/lib/haproxy/stats' | |
ansible -m 'shell' -i production haproxy -s -a'echo "set weight mysql/reader2 1" | sudo socat stdio /var/lib/haproxy/stats' | |
ansible -m 'shell' -i production haproxy -s -a'echo "set weight mysql/reader3 1" | sudo socat stdio /var/lib/haproxy/stats' | |
# 2. Reader Endpoint 経由でクエリが流れないように Reader Endpoint の weight を 0 にする | |
ansible -m 'shell' -i production haproxy -s -a'echo "set weight mysql/reader 0" | sudo socat stdio /var/lib/haproxy/stats' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local2 | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 4096 | |
user haproxy | |
group haproxy | |
daemon | |
stats socket /var/lib/haproxy/stats user root group root level admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
import os | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def handle(event, context): | |
logger.info("$ENV: " + str(os.environ)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"runtime": "python3.6", | |
"hooks": { | |
"build": "pip install -r requirements.txt -t ./site-packages" | |
}, | |
"environment": { | |
"PYTHONPATH": "/var/runtime:/var/task/site-packages" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requests==2.18.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"runtime": "python3.6", | |
"hooks": { | |
"build": "pip install -r requirements.txt -t ." | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hooks": { | |
"build": "GOOS=linux GOARCH=amd64 go build -o main main.go", | |
"clean": "rm -f main" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "hello-apex", | |
"description": "hello-apex: sample programs", | |
"memory": 128, | |
"timeout": 5, | |
"nameTemplate": "prod-{{.Project.Name}}_{{.Function.Name}}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "hello-apex", | |
"description": "hello-apex: sample programs", | |
"memory": 128, | |
"timeout": 5, | |
"nameTemplate": "stage-{{.Project.Name}}_{{.Function.Name}}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "hello-apex", | |
"description": "hello-apex: sample programs", | |
"memory": 128, | |
"timeout": 5, | |
"nameTemplate": "dev-{{.Project.Name}}_{{.Function.Name}}" | |
} |
NewerOlder