View change-weight-with-ansible.sh
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' |
View haproxy.aurora.endpoints.cfg
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 |
View hello-apex-inspect-path-main.py
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)) |
View hello-apex-pip-site-package-functions.json
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" | |
} | |
} |
View hello-apex-pip-requirements.txt
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 |
View hello-apex-pip-function.json
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 ." | |
} | |
} |
View hello-apex-golang-sample-function.json
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" | |
} | |
} |
View hello-apex-project_prod.json
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}}" | |
} |
View hello-apex-project_stage.json
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}}" | |
} |
View hello-apex-project_dev.json
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