This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'yaml' | |
| require 'aws-sdk' | |
| # | |
| config = YAML.load(File.read("config.yml")) |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'yaml' | |
| require 'aws-sdk' | |
| require 'terminal-table' | |
| # |
This file contains hidden or 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
| { | |
| "run_list": [ | |
| "recipe[setup]", | |
| "recipe[redis_2_cookbook::redis_install]" | |
| ] | |
| } |
This file contains hidden or 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
| git clone git clone https://github.com/RJ/ketama.git | |
| cd ketama | |
| cd python_ketama | |
| python setup.py build | |
| sudo python setup.py install |
This file contains hidden or 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 redis_router.tcp_interface import RouterServer | |
| r = RouterServer('0.0.0.0', 5000) | |
| r.run() |
This file contains hidden or 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 redis_router.http_interface import start_server | |
| start_server('0.0.0.0', 5001) |
This file contains hidden or 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
| # initialize flask application | |
| app = Flask(__name__) | |
| config_file = os.getenv('ROUTER_CONFIG_FILE', '/etc/redis_router/servers.config') | |
| # main view |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'redis' | |
| require 'hiredis' | |
| require 'yaml' | |
| require 'terminal-table' | |
| # yml 形式の設定ファイルを展開 | |
| config = YAML.load(File.read("config.yml")) | |
| Redis.yaml_tag(config) |
This file contains hidden or 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
| host : 127.0.0.1 | |
| port : 6380 | |
| driver : hiredis |
This file contains hidden or 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
| # Parses "Chef: x.y.z" from the chef-solo version output | |
| def chef_version | |
| v = run_command('sudo chef-solo --version').stdout.split(':') | |
| v[0].strip == 'Chef' ? v[1].strip! : '' | |
| end |