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
upstream websocket { | |
server localhost:3000; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/websocket.access.log 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
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
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 |
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
--- | |
######################################## | |
## Ansible Playbook for installing Nginx | |
######################################## | |
- name: check registered the repository of nginx-release | |
shell: rpm -qa | grep nginx-release | |
register: result | |
ignore_errors: True |
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
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" | |
} | |
} |
NewerOlder