diff --git a/cookbooks/main/recipes/default.rb b/cookbooks/main/recipes/default.rb index 7900ebf..ee56f9b 100644 --- a/cookbooks/main/recipes/default.rb +++ b/cookbooks/main/recipes/default.rb @@ -10,6 +10,9 @@ #uncomment to turn on memcached # require_recipe "memcached" +#uncomment ot run the riak recipe +# require_recipe "riak" + #uncomment to run the authorized_keys recipe #require_recipe "authorized_keys" diff --git a/cookbooks/riak/README.md b/cookbooks/riak/README.md index bb4aa27..45c4deb 100644 --- a/cookbooks/riak/README.md +++ b/cookbooks/riak/README.md @@ -1,4 +1,4 @@ -Riak Cookbook for EngineYard AppCloud +Riak Cookbook for EngineYard EYCloud ========= [Riak][1] is a Dynamo-inspired key/value store that scales predictably and easily. Riak also simplifies development by giving developers the ability to quickly prototype, test, and deploy their applications. @@ -7,29 +7,29 @@ A truly fault-tolerant system, Riak has no single point of failure. No machines Don't forget to check out the [Riak Fast Track][9]!!! -Special Note --------- - -You should *NOT* enable *BOTH* riak and riaksearch cookbooks at the same time. Pick one solution or the other. - Overview -------- -This cookbook once complete will attempt to provide one method of "Hosting" a Riak Ring on AppCloud. It will not run inside your regular environment as this cookbook will attempt to achieve a scalable stable Riak configuration with the least disruption of automation possible. +This cookbook once complete will attempt to provide one method of "Hosting" a Riak Ring on EYCloud. It will not run inside your regular environment as this cookbook will attempt to achieve a scalable stable Riak configuration with the least disruption of automation possible. Design -------- * 3+ utility instances 64-bit (m1.large +) -* Riak 0.14 with Bitcask -* Erlang R13B04 (installed from a custom binary package) +* Riak 1.0.2 w/ defaults to leveldb +* Erlang R140B3 (installed from a custom binary package) * haproxy is configured on 8097-8098 (pbc,http) with the http back-end using /ping to ensure the back-end is up. +Protobuffer Notes +-------- + +Haproxy is configured in TCP Mode; if you use protobuffers you should either configure your clients directly to the server or configure a sane reconnect method as the connection will be stale after the connection timeout in haproxy. + Notes -------- -This Cookbook automates the creation (join) action of a Riak 'Ring' on AppCloud. As your needs may vary it is suggested to fork this recipe and make any customization you do on the fork. You can omit the main cookbook it is only there for my testing purposes. +This Cookbook automates the creation (join) action of a Riak 'Ring' on EYCloud. As your needs may vary it is suggested to fork this recipe and make any customization you do on the fork. You can omit the main cookbook it is only there for my testing purposes. Backups -------- @@ -46,7 +46,7 @@ This cookbook does not automate not facilitate any backup method currently. The Benchmarks -------- -I [damm][4] have been benchmarking Riak on AppCloud for some time and have posted some of my tests with [basho_bench][5] for which you can review. All posted results are using EBS as the diskstore, you can find better latency and speed by using the instance Ephemeral disks (/mnt) which can be [tuned][6] if you so wish. *Note* you *MUST* use riak-admin to backup your data as it will *NOT* be stored on the EBS unit. +I [damm][4] have been benchmarking Riak on EYCloud for some time and have posted some of my tests with [basho_bench][5] for which you can review. All posted results are using EBS as the diskstore, you can find better latency and speed by using the instance Ephemeral disks (/mnt) which can be [tuned][6] if you so wish. *Note* you *MUST* use riak-admin to backup your data as it will *NOT* be stored on the EBS unit. * You are free to enable the [basho_bench][7] [recipe][8] and then git clone git://github.com/basho/basho_bench.git to properly determine if your dataset / type would be a good fit for Riak. diff --git a/cookbooks/riak/attributes/riak.rb b/cookbooks/riak/attributes/riak.rb index 6204615..7ac4f59 100644 --- a/cookbooks/riak/attributes/riak.rb +++ b/cookbooks/riak/attributes/riak.rb @@ -1,4 +1 @@ -riak :version => "0.14.2", :js_vm_count => "8", :js_max_vm_mem => "8" -luwak :enabled => "true" -bitcask :max_file_size => "16#80000000", :open_timeout => 4, :sync_strategy => "none", :merge_window => "always", :frag_merge_trigger => "60", :dead_bytes_merge_trigger => "536870912", :frag_threshold => "40", :dead_bytes_threshold => "134217728", :small_file_threshold => "10485760", :expiry_secs => "-1", :data_root => "data/bitcask" - +riak :version => "1.0.2", :data_root => "/data/riak/data", :map_js_vm_count => "8", :reduce_js_vm_count => "6", :hook_js_vm_count => "2", :js_max_vm_mem => "8", :js_thread_stack => "16", :riak_kv_stat => "true", :legacy_stats => "false", :legacy_keylisting => "false", :luwak_enabled => "false", :riaksearch_enabled => "false", :backend_enabled => "riak_kv_eleveldb_backend", :pb_backlog => "64" diff --git a/cookbooks/riak/recipes/basho_bench.rb b/cookbooks/riak/recipes/basho_bench.rb index f52775b..a4dc947 100644 --- a/cookbooks/riak/recipes/basho_bench.rb +++ b/cookbooks/riak/recipes/basho_bench.rb @@ -3,8 +3,8 @@ if File.exists?("/usr/bin/gfortran") # noop else - s3_forceinstall "sys-devel/gcc" do - version "4.1.2" + execute "emerge =sys-devel/gcc-4.1.2" do + action :run end end diff --git a/cookbooks/riak/recipes/configure_riak.rb b/cookbooks/riak/recipes/configure_riak.rb index 3fce951..8938bd3 100644 --- a/cookbooks/riak/recipes/configure_riak.rb +++ b/cookbooks/riak/recipes/configure_riak.rb @@ -1,6 +1,14 @@ # Configure stuff goes here # +directory "#{node[:riak][:data_root]}" do + action :create + owner "root" + group "root" + mode 0755 + recursive true +end + template "/data/riak/etc/vm.args" do source "vm.args.erb" owner node[:owner_name] @@ -16,19 +24,19 @@ owner node[:owner_name] group node[:owner_name] variables( - :js_vm_count => node[:riak][:js_vm_count], + :riak_version => node[:riak][:version], + :map_js_vm_count => node[:riak][:map_js_vm_count], + :reduce_js_vm_count => node[:riak][:reduce_js_vm_count], + :hook_js_vm_count => node[:riak][:hook_js_vm_count], :js_max_vm_mem => node[:riak][:js_max_vm_mem], - :max_file_size => node[:bitcask][:max_file_size], - :open_timeout => node[:bitcask][:open_timeout], - :sync_strategy => node[:bitcask][:sync_strategy], - :merge_window => node[:bitcask][:merge_window], - :frag_merge_trigger => node[:bitcask][:frag_merge_trigger], - :dead_bytes_merge_trigger => node[:bitcask][:dead_bytes_merge_trigger], - :frag_threshold => node[:bitcask][:frag_threshold], - :dead_bytes_threshold => node[:bitcask][:dead_bytes_threshold], - :small_file_threshold => node[:bitcask][:small_file_threshold], - :expiry_secs => node[:bitcask][:expiry_secs], - :data_root => node[:bitcask][:data_root], - :luwak => node[:luwak][:enabled] + :js_thread_stack => node[:riak][:js_thread_stack], + :riak_kv_stat => node[:riak][:riak_kv_stat], + :legacy_stats => node[:riak][:legacy_stats], + :legacy_keylisting => node[:riak][:legacy_keylisting], + :luwak_enabled => node[:riak][:luwak_enabled], + :riaksearch_enabled => node[:riak][:riaksearch_enabled], + :backend_enabled => node[:riak][:backend_enabled], + :pb_backlog => node[:riak][:pb_backlog], + :data_root => node[:riak][:data_root] ) end diff --git a/cookbooks/riak/recipes/default.rb b/cookbooks/riak/recipes/default.rb index 0e14c50..d747c2c 100644 --- a/cookbooks/riak/recipes/default.rb +++ b/cookbooks/riak/recipes/default.rb @@ -14,7 +14,7 @@ # Install a version of Erlang (R130B4) provided by me. I built the package, if you would like to see the ebuild sources make an issue. s3_install "dev-lang/erlang" do - version "13.2.4" + version "14.2.3" end end @@ -30,7 +30,7 @@ # Install a version of Erlang (R130B4) provided by me. I built the package, if you would like to see the ebuild sources make an issue. s3_install "dev-lang/erlang" do - version "13.2.4" + version "14.2.3" end # Install python_setuptools as the version in portage is too old. diff --git a/cookbooks/riak/recipes/install_riak.rb b/cookbooks/riak/recipes/install_riak.rb index 8eaf56c..e632fb2 100644 --- a/cookbooks/riak/recipes/install_riak.rb +++ b/cookbooks/riak/recipes/install_riak.rb @@ -1,8 +1,13 @@ # Installer stuff here # +package "dev-java/ant" do + version '1.7.0' + action :install +end + remote_file "/mnt/src/riak-#{node[:riak][:version]}.tar.gz" do - source "http://downloads.basho.com/riak/CURRENT/riak-#{node[:riak][:version]}.tar.gz" + source "http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/CURRENT/riak-#{node[:riak][:version]}.tar.gz" backup 0 not_if { FileTest.exists?("/mnt/src/riak-#{node[:riak][:version]}.tar.gz") } end diff --git a/cookbooks/riak/recipes/join_ring.rb b/cookbooks/riak/recipes/join_ring.rb index 8150348..72337c6 100644 --- a/cookbooks/riak/recipes/join_ring.rb +++ b/cookbooks/riak/recipes/join_ring.rb @@ -25,6 +25,8 @@ execute "cd /data/riak;bin/riak-admin join riak@#{riak_hostname}" do action :run + epic_fail true + # FIXME: I need to start checking properly again, todo. # not_if { ring_members.include?("riak@#{riak_hostname}") } end end diff --git a/cookbooks/riak/templates/default/app.config.erb b/cookbooks/riak/templates/default/app.config.erb index 9c02187..f766041 100644 --- a/cookbooks/riak/templates/default/app.config.erb +++ b/cookbooks/riak/templates/default/app.config.erb @@ -4,35 +4,62 @@ %% Riak Core config {riak_core, [ %% Default location of ringstate - {ring_state_dir, "/data/riak/data/ring"}, - - %% riak_web_ip is the IP address that the Riak HTTP interface will - %% bind to. If this is undefined, the HTTP interface will not run. - {web_ip, "0.0.0.0" }, - - %% riak_web_port is the TCP port that the Riak HTTP interface will - %% bind to. - {web_port, 8098 }, - + {ring_state_dir, "./data/ring"}, + + %% http is a list of IP addresses and TCP ports that the Riak + %% HTTP interface will bind. + {http, [ {"0.0.0.0", 8098 } ]}, + + %% https is a list of IP addresses and TCP ports that the Riak + %% HTTPS interface will bind. + %{https, [{ "0.0.0.0", 8098 }]}, + + %% Default cert and key locations for https can be overridden + %% with the ssl config variable, for example: + %{ssl, [ + % {certfile, "./etc/cert.pem"}, + % {keyfile, "./etc/key.pem"} + % ]}, + %% riak_handoff_port is the TCP port that Riak uses for %% intra-cluster data handoff. - {handoff_port, 8099 } + {handoff_port, 8099 }, + + %% To encrypt riak_core intra-cluster data handoff traffic, + %% uncomment the following line and edit its path to an + %% appropriate certfile and keyfile. (This example uses a + %% single file with both items concatenated together.) + %{handoff_ssl_options, [{certfile, "/tmp/erlserver.pem"}]}, + + %% Platform-specific installation paths (substituted by rebar) + {platform_bin_dir, "./bin"}, + {platform_data_dir, "./data"}, + {platform_etc_dir, "./etc"}, + {platform_lib_dir, "./lib"}, + {platform_log_dir, "./log"} ]}, %% Riak KV config {riak_kv, [ %% Storage_backend specifies the Erlang module defining the storage %% mechanism that will be used on this node. - {storage_backend, riak_kv_bitcask_backend}, + {storage_backend, <%= @backend_enabled %>}, %% pb_ip is the IP address that the Riak Protocol Buffers interface - %% will bid to. If this is undefined, the interface will not run. + %% will bind to. If this is undefined, the interface will not run. {pb_ip, "0.0.0.0" }, %% pb_port is the TCP port that the Riak Protocol Buffers interface %% will bind to {pb_port, 8087 }, + %% pb_backlog is the maximum length to which the queue of pending + %% connections may grow. If set, it must be an integer >= 0. + %% By default the value is 5. If you anticipate a huge number of + %% connections being initialised *simultaneously*, set this number + %% higher. + {pb_backlog, <%= @pb_backlog %>}, + %% raw_name is the first part of all URLS used by the Riak raw HTTP %% interface. See riak_web.erl and raw_http_resource.erl for %% details. @@ -41,11 +68,29 @@ %% mapred_name is URL used to submit map/reduce requests to Riak. {mapred_name, "mapred"}, - %% js_vm_count is the number of Javascript VMs to start per Riak - %% node. 8 is a good default for smaller installations. A larger - %% number like 12 or 16 is appropriate for installations handling - %% lots of map/reduce processing. - {js_vm_count, <%= @js_vm_count %>}, + %% mapred_system indicates which version of the MapReduce + %% system should be used: 'pipe' means riak_pipe will + %% power MapReduce queries, while 'legacy' means that luke + %% will be used + {mapred_system, pipe}, + + %% directory used to store a transient queue for pending + %% map tasks + %% Only valid when mapred_system == legacy + %% {mapred_queue_dir, "./data/mr_queue" }, + + %% Each of the following entries control how many Javascript + %% virtual machines are available for executing map, reduce, + %% pre- and post-commit hook functions. + {map_js_vm_count, 8 }, + {reduce_js_vm_count, 6 }, + {hook_js_vm_count, 2 }, + + %% Number of items the mapper will fetch in one request. + %% Larger values can impact read/write performance for + %% non-MapReduce requests. + %% Only valid when mapred_system == legacy + %% {mapper_batch_size, 5}, %% js_max_vm_mem is the maximum amount of memory, in megabytes, %% allocated to the Javascript VMs. If unset, the default is @@ -55,49 +100,120 @@ %% js_thread_stack is the maximum amount of thread stack, in megabyes, %% allocate to the Javascript VMs. If unset, the default is 16MB. %% NOTE: This is not the same as the C thread stack. - {js_thread_stack, 16}, + {js_thread_stack, <%= @js_thread_stack %>}, + + %% Number of objects held in the MapReduce cache. These will be + %% ejected when the cache runs out of room or the bucket/key + %% pair for that entry changes + %% Only valid when mapred_system == legacy + %% {map_cache_size, 10000}, %% js_source_dir should point to a directory containing Javascript %% source files which will be loaded by Riak when it initializes %% Javascript VMs. %{js_source_dir, "/tmp/js_source"}, - %% vnode_mr_timeout controls how much time Riak will permit a map - %% function to execute on a given vnode before trying another vnode. - %% Value is in milliseconds and defaults to 1000ms if not set. - %{vnode_mr_timeout, 1000}, + %% http_url_encoding determines how Riak treats URL encoded + %% buckets, keys, and links over the REST API. When set to 'on' + %% Riak always decodes encoded values sent as URLs and Headers. + %% Otherwise, Riak defaults to compatibility mode where links + %% are decoded, but buckets and keys are not. The compatibility + %% mode will be removed in a future release. + {http_url_encoding, on}, %% riak_stat enables the use of the "riak-admin status" command to %% retrieve information the Riak node for performance and debugging needs - {riak_kv_stat, true} + {riak_kv_stat, <%= @riak_kv_stat %>}, + {legacy_stats, <%= @legacy_stats %>}, + + %% Switch to vnode-based vclocks rather than client ids. This + %% significantly reduces the number of vclock entries. + %% Only set true if *all* nodes in the cluster are upgraded to 1.0 + {vnode_vclocks, true}, + + %% This option enables compatability of bucket and key listing + %% with 0.14 and earlier versions. Once a rolling upgrade to + %% a version > 0.14 is completed for a cluster, this should be + %% set to false for improved performance for bucket and key + %% listing operations. + {legacy_keylisting, <%= @legacy_keylisting %>} ]}, + %% Riak Search Config + {riak_search, [ + %% To enable Search functionality set this 'true'. + {enabled, <%= @riaksearch_enabled %>} + ]}, + + %% Merge Index Config + {merge_index, [ + %% The root dir to store search merge_index data + {data_root, "<%= @data_root %>"}, + + %% The root dir to store secondary index merge_index data + {data_root_2i, "<%= @data_root %>/merge_index_2i"}, + + %% Size, in bytes, of the in-memory buffer. When this + %% threshold has been reached the data is transformed + %% into a segment file which resides on disk. + {buffer_rollover_size, 1048576}, + + %% Overtime the segment files need to be compacted. + %% This is the maximum number of segments that will be + %% compacted at once. A lower value will lead to + %% quicker but more frequent compactions. + {max_compact_segments, 20} + ]}, + %% Bitcask Config {bitcask, [ - {data_root, "<%= @data_root %>"}, - {max_file_size, <%= @max_file_size %>}, - {sync_strategy, <%= @sync_strategy %>}, - {merge_window, <%= @merge_window %>}, - {frag_merge_trigger, <%= @frag_merge_trigger %>}, - {dead_bytes_merge_trigger, <%= @dead_bytes_merge_trigger %>}, - {frag_threshold, <%= @frag_threshold %>}, - {dead_bytes_threshold, <%= @dead_bytes_threshold %>}, - {small_file_threshold, <%= @small_file_threshold %>}, - {expiry_secs, <%= @expiry_secs %>} + {data_root, "<%= @data_root %>/bitcask"} ]}, + %% eLevelDB Config + {eleveldb, [ + {data_root, "<%= @data_root %>/leveldb"} + ]}, + %% Luwak Config {luwak, [ - {enabled, <%= @luwak %>} + {enabled, <%= @luwak_enabled %>} ]}, +{lager, [ + %% What handlers to install with what arguments + {handlers, [ + {lager_console_backend, info}, + {lager_file_backend, [ + {"./log/error.log", error}, + {"./log/console.log", info} + ]} + ]}, + %% Whether to write a crash log, and where. + %% Commented/omitted/undefined means no crash logger. + {crash_log, "./log/crash.log"}, + %% Maximum size in bytes of events in the crash log. + %% Default is 64kb. + {crash_log_size, 65536}, + %% Whether to redirect error_logger messages into lager - defaults to true + {error_logger_redirect, true} + ]}, + + %% riak_sysmon config + {riak_sysmon, [ + %% To disable forwarding events of a particular type, use a + %% limit of 0. + {process_limit, 30}, + {port_limit, 30}, + + %% Finding reasonable limits for a given workload is a matter + %% of experimentation. + {gc_ms_limit, 50}, + {heap_word_limit, 10485760} + ]}, + %% SASL config {sasl, [ - {sasl_error_logger, {file, "log/sasl-error.log"}}, - {errlog_type, error}, - {error_logger_mf_dir, "log/sasl"}, % Log directory - {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size - {error_logger_mf_maxfiles, 5} % 5 files max - ]} + {sasl_error_logger, false} + ]} ]. - diff --git a/cookbooks/riak/templates/default/vm.args.erb b/cookbooks/riak/templates/default/vm.args.erb index 9e526a2..95db9b9 100644 --- a/cookbooks/riak/templates/default/vm.args.erb +++ b/cookbooks/riak/templates/default/vm.args.erb @@ -1,7 +1,8 @@ ## Name of the riak node -name riak@<%= @node['ec2']['local_hostname'] %> -## Cookie for distributed erlang +## Cookie for distributed erlang. All nodes in the same cluster +## should use the same cookie or they will not be able to communicate. -setcookie <%= @node['environment']['name'] %> ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive @@ -12,9 +13,26 @@ +K true +A 64 +## Treat error_logger warnings as warnings ++W w + ## Increase number of concurrent ports/sockets --env ERL_MAX_PORTS 65535 +-env ERL_MAX_PORTS 4096 ## Tweak GC to run more often -env ERL_FULLSWEEP_AFTER 0 +## Set the location of crash dumps +-env ERL_CRASH_DUMP log/erl_crash.dump + +## Begin SSL distribution items, DO NOT DELETE OR EDIT THIS COMMENT + +## To enable SSL encryption of the Erlang intra-cluster communication, +## un-comment the three lines below and make certain that the paths +## point to correct PEM data files. See docs TODO for details. + +## -proto_dist inet_ssl +## -ssl_dist_opt client_certfile "./etc/erlclient.pem" +## -ssl_dist_opt server_certfile "./etc/erlserver.pem" + +## End SSL distribution items, DO NOT DELETE OR EDIT THIS COMMENT \ No newline at end of file diff --git a/cookbooks/riaksearch/README.md b/cookbooks/riaksearch/README.md deleted file mode 100644 index 6c207ca..0000000 --- a/cookbooks/riaksearch/README.md +++ /dev/null @@ -1,121 +0,0 @@ -Riak_search Cookbook for EngineYard AppCloud -========= - -[Riak][1] is a Dynamo-inspired key/value store that scales predictably and easily. Riak also simplifies development by giving developers the ability to quickly prototype, test, and deploy their applications. - -A truly fault-tolerant system, Riak has no single point of failure. No machines are special or central in Riak, so developers and operations professionals can decide exactly how fault-tolerant they want and need their applications to be. - -Don't forget to check out the [Riak Fast Track][9]!!! - -Special Note --------- - -You should *NOT* enable *BOTH* riak and riaksearch cookbooks at the same time. Pick one solution or the other. - - - -Overview --------- - -This cookbook once complete will attempt to provide one method of "Hosting" a Riak Ring on AppCloud. It will not run inside your regular environment as this cookbook will attempt to achieve a scalable stable Riak configuration with the least disruption of automation possible. - -Design --------- - -* 3+ utility instances 64-bit (m1.large +) - -* Riaksearch 0.14 with Bitcask -* Erlang R13B04 (installed from a custom binary package) -* haproxy is configured on 8097-8098 (pbc,http) with the http back-end using /ping to ensure the back-end is up. - -Notes --------- - -This Cookbook automates the creation (join) action of a Riak 'Ring' on AppCloud. As your needs may vary it is suggested to fork this recipe and make any customization you do on the fork. You can omit the main cookbook it is only there for my testing purposes. - -Backups --------- - -This cookbook does not automate not facilitate any backup method currently. There are possible ways of handling backups including depending on EBS snapshots and fsync() which may or may not work properly depending on the what files are being written at that time. A better suggestion would be to create a cronscript such as, (with the proper session cookie and riak hostname provided) - -> ``/data/riak_search/bin/riaksearch-admin backup riak@ip-10-112-15-117.ec2.internal riakinfo backup-todaysdate()`` -> ``gzip backup-todaysdate()`` -> upload_to_s3() - -* Note todaysdate() could be ``date '+%Y%m%d'`` -* Note upload_to_s3() is a figurative example you should be able to upload this using [fog][3] - -Benchmarks --------- - -I [damm][4] have been benchmarking Riak on AppCloud for some time and have posted some of my tests with [basho_bench][5] for which you can review. All posted results are using EBS as the diskstore, you can find better latency and speed by using the instance Ephemeral disks (/mnt) which can be [tuned][6] if you so wish. *Note* you *MUST* use riak-admin to backup your data as it will *NOT* be stored on the EBS unit. - -* You are free to enable the [basho_bench][7] [recipe][8] and then git clone git://github.com/basho/basho_bench.git to properly determine if your dataset / type would be a good fit for Riak. - -> Note the recipe is there for the utility instance if you prefer to use the Erlang Riakclient instead of setting up / configuring Riak on your web instances. Otherwise using the app instances via haproxy should replicate your usage. - -Adding Instances w/out a Snapshot --------- - -* It is possible to add a member to the ring without an EBS snapshot. You should choose the appropriate size and then add the instance and then verify with riak-admin ringready to determine when the new node member has loaded enough data to become 'ready'. Then you can run custom chef recipes on your app instances to rebuild the haproxy template and then restart haproxy when ready. (Note: Haproxy automation may be improved in the future) - - -Specifics of Usage --------- - -Currently this Cookbook provides the following methods of using Riak: - -1. Riak K/V + Search (Riak search) - - * Add an utility instance with the following naming scheme, - - * riaksearch_0 - * riaksearch_1 - * riaksearch_2 - ... - - * Note you must always start with _0 as that is the 'ring master'. - -* Lastly, Words of Wisdom from Basho themselves. - -> you should look at the ring ready command and make sure it returns 0 before adding additional nodes. - -> If you try and do more than 4 or 5 nodes the gossip is a little heavy for ec2 right now and sometimes it takes a minute or two to converge the ring changing the gossip interval in the conf alleviates this somewhat - -Dependencies --------- - -This cookbook depends on the dnapi|emerge cookbook, you can add it as a -submodule as follows, - -``git submodule update --init`` -``git submodule add git://github.com/damm/ey-dnapi.git cookbooks/dnapi`` -``git submodule add git://github.com/damm/ey-emerge.git cookbooks/emerge`` - -Installation --------- - -Ensure you have the Dependencies installed in your local cookbooks repository ... -Add the following to your main/recipes/default.rb - -``require_recipe "riaksearch"`` - -How to get Support --------- - -* irc://irc.freenode.net/#riak -* This Github repository. -* This Cookbook provides a technology that is not listed in the Engine Yard [Technology Stack][2] - -* Additionally because of that there is *NO SUPPORT* for this recipe by EngineYard at this time. If you have any problems with this reciple please open an issue, add a comment. If you open a ticket regarding this cookbook you will be directed to this Github repository to open an issue. - - -[1]: http://wiki.basho.com/display/RIAK/Riak -[2]: http://www.engineyard.com/products/technology/stack -[3]: https://github.com/geemus/fog -[4]: https://github.com/damm -[5]: https://github.com/damm/basho_bench -[6]: https://github.com/engineyard/ey-cloud-recipes/blob/master/cookbooks/riaksearch/attributes/riak.rb#L3 -[7]: https://github.com/engineyard/ey-cloud-recipes/blob/master/cookbooks/riaksearch/recipes/default.rb#L6 -[8]: https://github.com/engineyard/ey-cloud-recipes/blob/master/cookbooks/riaksearch/recipes/default.rb#51 -[9]: http://wiki.basho.com/The-Riak-Fast-Track.html diff --git a/cookbooks/riaksearch/attributes/riaksearch.rb b/cookbooks/riaksearch/attributes/riaksearch.rb deleted file mode 100644 index cb5a93b..0000000 --- a/cookbooks/riaksearch/attributes/riaksearch.rb +++ /dev/null @@ -1,2 +0,0 @@ -riaksearch :version => "0.14.2", :js_vm_count => "8", :js_max_vm_mem => "8" -bitcask :max_file_size => "16#80000000", :open_timeout => 4, :sync_strategy => "none", :merge_window => "always", :frag_merge_trigger => "60", :dead_bytes_merge_trigger => "536870912", :frag_threshold => "40", :dead_bytes_threshold => "134217728", :small_file_threshold => "10485760", :expiry_secs => "-1", :data_root => "data/bitcask" diff --git a/cookbooks/riaksearch/definitions/s3_forceinstall.rb b/cookbooks/riaksearch/definitions/s3_forceinstall.rb deleted file mode 100644 index 2198751..0000000 --- a/cookbooks/riaksearch/definitions/s3_forceinstall.rb +++ /dev/null @@ -1,36 +0,0 @@ -define :s3_forceinstall, :atom => nil do - version = params[:version] - name = params[:name] - atom = `echo #{name} | cut -d '/' -f 1`.chomp - full_name = name + '-' + version - - directory "/engineyard/portage/packages" do - action :create - mode 0755 - owner "root" - group "root" - end - - directory "/engineyard/portage/packages/#{atom}" do - action :create - mode 0755 - owner "root" - group "root" - end - - execute "remove old package file" do - command "rm /engineyard/portage/packages/#{full_name}.tbz2" - only_if { File.exists?("/engineyard/portage/packages/#{full_name}.tbz2") } - end - - remote_file "/engineyard/portage/packages/#{full_name}.tbz2" do - source "http://ey-portage.s3.amazonaws.com/#{node[:kernel][:machine]}/#{full_name}.tbz2" - not_if { FileTest.exists?("/engineyard/portage/packages/#{full_name}.tbz2") } - backup false - end - - execute "emerge --ignore-default-opts /engineyard/portage/packages/#{full_name}.tbz2" do - action :run - end - -end diff --git a/cookbooks/riaksearch/definitions/s3_install.rb b/cookbooks/riaksearch/definitions/s3_install.rb deleted file mode 100644 index c4f7cbe..0000000 --- a/cookbooks/riaksearch/definitions/s3_install.rb +++ /dev/null @@ -1,32 +0,0 @@ -define :s3_install, :atom => nil do - version = params[:version] - name = params[:name] - atom = `echo #{name} | cut -d '/' -f 1`.chomp - full_name = name + '-' + version - - directory "/engineyard/portage/packages" do - action :create - mode 0755 - owner "root" - group "root" - end - - directory "/engineyard/portage/packages/#{atom}" do - action :create - mode 0755 - owner "root" - group "root" - end - - remote_file "/engineyard/portage/packages/#{full_name}.tbz2" do - source "http://ey-portage.s3.amazonaws.com/#{node[:kernel][:machine]}/#{full_name}.tbz2" - not_if { FileTest.exists?("/engineyard/portage/packages/#{full_name}.tbz2") } - backup false - end - - execute "emerge /engineyard/portage/packages/#{full_name}.tbz2" do - action :run - not_if { FileTest.directory?("/var/db/pkg/#{full_name}") } - end - -end diff --git a/cookbooks/riaksearch/libraries/ruby_block.rb b/cookbooks/riaksearch/libraries/ruby_block.rb deleted file mode 100644 index aa0129a..0000000 --- a/cookbooks/riaksearch/libraries/ruby_block.rb +++ /dev/null @@ -1,40 +0,0 @@ - -class Chef - class Resource - class RubyBlock < Chef::Resource - def initialize(name, collection=nil, node=nil) - super(name, collection, node) - @resource_name = :ruby_block - @action = :create - @allowed_actions.push(:create) - end - - def block(&block) - if block - @block = block - else - @block - end - end - end - end -end - - -class Chef - class Provider - class RubyBlock < Chef::Provider - def load_current_resource - Chef::Log.debug(@new_resource.inspect) - true - end - - def action_create - @new_resource.block.call - end - end - end -end - -Chef::Platform.platforms[:default].merge! :ruby_block => Chef::Provider::RubyBlock - diff --git a/cookbooks/riaksearch/libraries/run_for_app.rb b/cookbooks/riaksearch/libraries/run_for_app.rb deleted file mode 100644 index 46385fd..0000000 --- a/cookbooks/riaksearch/libraries/run_for_app.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Chef - class Recipe - def run_for_app(*apps, &block) - apps.map! {|a| a.to_s } - node[:applications].map{|k,v| [k,v] }.sort_by {|a,b| a }.each do |name, app_data| - if apps.include?(name) - block.call(name, app_data) - end - end - end - end -end \ No newline at end of file diff --git a/cookbooks/riaksearch/recipes/app_config.rb b/cookbooks/riaksearch/recipes/app_config.rb deleted file mode 100644 index d73619f..0000000 --- a/cookbooks/riaksearch/recipes/app_config.rb +++ /dev/null @@ -1,12 +0,0 @@ -node[:applications].each do |app,data| - template "/data/#{app}/shared/config/ripple.yml" do - source "ripple.yml.erb" - owner node[:owner_name] - group node[:owner_name] - mode 0655 - backup 0 - variables({ - :hostname => "localhost" - }) - end -end diff --git a/cookbooks/riaksearch/recipes/basho_bench.rb b/cookbooks/riaksearch/recipes/basho_bench.rb deleted file mode 100644 index f52775b..0000000 --- a/cookbooks/riaksearch/recipes/basho_bench.rb +++ /dev/null @@ -1,57 +0,0 @@ -# AppCloud's GCC does not include Fortran by default, so let's install GCC binaries with fortran. - -if File.exists?("/usr/bin/gfortran") - # noop -else - s3_forceinstall "sys-devel/gcc" do - version "4.1.2" - end -end - -directory "/mnt/src" do - owner "root" - group "root" - action :create - mode 0755 -end -remote_file "/mnt/src/R-2.13.0.tar.gz" do - source "http://cran.opensourceresources.org/src/base/R-2/R-2.13.0.tar.gz" - backup 0 - owner "root" - group "root" - not_if { File.exists?("/mnt/src/R-2.13.0.tar.gz") } -end - -package "x11-libs/libXt" do - version "1.0.5" - action :install -end - -package "x11-libs/libICE" do - version "1.0.4" - action :install -end - -execute "un-archive R" do - cwd "/mnt/src" - command "tar zxfv R-2.13.0.tar.gz" - not_if { File.exists?("/usr/bin/Rscript") } -end - -execute "configure R" do - cwd "/mnt/src/R-2.13.0" - command "./configure --prefix=/usr" - not_if { File.exists?("/usr/bin/Rscript") } -end - -execute "make R" do - cwd "/mnt/src/R-2.13.0" - command "make -j2" - not_if { File.exists?("/usr/bin/Rscript") } -end - -execute "make install R" do - cwd "/mnt/src/R-2.13.0" - command "make install" - not_if { File.exists?("/usr/bin/Rscript") } -end diff --git a/cookbooks/riaksearch/recipes/configure_riak.rb b/cookbooks/riaksearch/recipes/configure_riak.rb deleted file mode 100644 index d41ba56..0000000 --- a/cookbooks/riaksearch/recipes/configure_riak.rb +++ /dev/null @@ -1,33 +0,0 @@ -# Configure stuff goes here -# - -template "/data/riak_search/etc/vm.args" do - source "vm.args.erb" - owner node[:owner_name] - group node[:owner_name] - mode 0655 - backup 0 -end - -template "/data/riak_search/etc/app.config" do - source "app.config.erb" - backup 0 - mode 0655 - owner node[:owner_name] - group node[:owner_name] - variables( - :js_vm_count => node[:riaksearch][:js_vm_count], - :js_max_vm_mem => node[:riaksearch][:js_max_vm_mem], - :max_file_size => node[:bitcask][:max_file_size], - :open_timeout => node[:bitcask][:open_timeout], - :sync_strategy => node[:bitcask][:sync_strategy], - :merge_window => node[:bitcask][:merge_window], - :frag_merge_trigger => node[:bitcask][:frag_merge_trigger], - :dead_bytes_merge_trigger => node[:bitcask][:dead_bytes_merge_trigger], - :frag_threshold => node[:bitcask][:frag_threshold], - :dead_bytes_threshold => node[:bitcask][:dead_bytes_threshold], - :small_file_threshold => node[:bitcask][:small_file_threshold], - :expiry_secs => node[:bitcask][:expiry_secs], - :data_root => node[:bitcask][:data_root] - ) -end diff --git a/cookbooks/riaksearch/recipes/default.rb b/cookbooks/riaksearch/recipes/default.rb deleted file mode 100644 index fae82f6..0000000 --- a/cookbooks/riaksearch/recipes/default.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Pardon the dust in here. <-- sml 10-10-10..nil? - -# This portion of the recipe runs on all instances, except the utility instances. You don't want haproxy on the utility instances but you do on solo|app|app_master -if ['solo','app','app_master'].include?(node[:instance_role]) - require_recipe "riaksearch::haproxy" - #require_recipe "riaksearch::basho_bench" - require_recipe "riaksearch::app_config" - # Remove old version of Erlang that is NOT new enough - package "dev-lang/erlang" do - version "erlang-12.2.5-r1" - action :remove - only_if { FileTest.directory?("/var/db/pkg/dev-lang/erlang-12.2.5-r1") } - end - -# Install a version of Erlang (R130B4) provided by me. I built the package, if you would like to see the ebuild sources make an issue. - s3_install "dev-lang/erlang" do - version "13.2.4" - end -end - -# This portion of the recipe runs on only utility instances -if ['util'].include?(node[:instance_role]) - if node['name'].include?('riaksearch_') -# Remove old version of Erlang that is NOT new enough - package "dev-lang/erlang" do - version "erlang-12.2.5-r1" - action :remove - only_if { FileTest.directory?("/var/db/pkg/dev-lang/erlang-12.2.5-r1") } - end - -# Install a version of Erlang (R130B4) provided by me. I built the package, if you would like to see the ebuild sources make an issue. - s3_install "dev-lang/erlang" do - version "13.2.4" - end - -# Install python_setuptools as the version in portage is too old. - - include_recipe "riaksearch::setuptools" - -# Install Mercurial as it's required for most things with Webmachine / rebar. - - execute "easy_install mercurial" do - action :run - not_if { FileTest.exists?("/usr/bin/hg") } - end - - include_recipe "riaksearch::install_riak" - include_recipe "riaksearch::configure_riak" - include_recipe "riaksearch::start_riak" - include_recipe "riaksearch::join_ring" - include_recipe "riaksearch::basho_bench" - end -end - diff --git a/cookbooks/riaksearch/recipes/haproxy.rb b/cookbooks/riaksearch/recipes/haproxy.rb deleted file mode 100644 index 7370cc5..0000000 --- a/cookbooks/riaksearch/recipes/haproxy.rb +++ /dev/null @@ -1,45 +0,0 @@ -if node['utility_instances'].empty? - Chef::Log.info("No utility instances found, aborting") -else - if ['solo','app_master', 'app'].include?(node[:instance_role]) - enable_package 'net-proxy/haproxy' do - version '1.4.8' - end - - package "net-proxy/haproxy" do - version '1.4.8' - action :upgrade - end - - riak_instances = [] - riak_instances << node["engineyard"]["environment"]["instances"].map{|x| x["private_hostname"] if x["name"] =~ /^riak_/ }.compact - - template "/etc/haproxy_riak.cfg" do - owner 'root' - group 'root' - mode 0644 - source "haproxy.cfg.erb" - variables({ - :backends => riak_instances, - :haproxy_user => node[:haproxy][:username], - :haproxy_pass => node[:haproxy][:password] - }) - end - - template "/etc/monit.d/haproxy_riak.monitrc" do - source "haproxy_monitrc.erb" - backup 0 - owner "root" - group "root" - mode 0655 - variables( - :pidfile => "/var/run/haproxy_riak.pid" - ) - end - - execute "monit reload" do - action :run - end - end -end - diff --git a/cookbooks/riaksearch/recipes/install_riak.rb b/cookbooks/riaksearch/recipes/install_riak.rb deleted file mode 100644 index 0bfac72..0000000 --- a/cookbooks/riaksearch/recipes/install_riak.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Installer stuff here -# - -# Riaksearch dependency here. -package "dev-java/ant" do - version '1.7.0' - action :install -end - -remote_file "/mnt/src/riak_search-#{node[:riaksearch][:version]}.tar.gz" do - source "http://downloads.basho.com/riak-search/CURRENT/riak_search-#{node[:riaksearch][:version]}.tar.gz" - backup 0 - not_if { FileTest.exists?("/mnt/src/riak_search-#{node[:riaksearch][:version]}.tar.gz") } -end - -execute "untar riak" do - command "cd /mnt/src;tar zxf riak_search-#{node[:riaksearch][:version]}.tar.gz" - not_if { FileTest.directory?("/mnt/src/riak_search-#{node[:riaksearch][:version]}") } -end - -execute "make all rel" do - command "cd /mnt/src/riak_search-#{node[:riaksearch][:version]};make all rel && cp -prv rel/riaksearch /data/riak_search" - not_if { FileTest.exists?("/data/riak_search/bin/riaksearch") } -end diff --git a/cookbooks/riaksearch/recipes/join_ring.rb b/cookbooks/riaksearch/recipes/join_ring.rb deleted file mode 100644 index 2818216..0000000 --- a/cookbooks/riaksearch/recipes/join_ring.rb +++ /dev/null @@ -1,30 +0,0 @@ -# Ring Related code here. -# -require 'json' -require 'net/http' -require 'resolv' -case node['name'] -when "riaksearch_0" -#I shouldn't do squat here, i'm on the master node. -Chef::Log.info "I am riaksearch_0 at #{node[:ec2][:public_hostname]}" -else -# begin -# sleep 10 -# riak_stats = JSON.parse(`curl http://localhost:8098/stats`) -# Net::HTTP.get_response(URI.parse('http://localhost:8098/stats')).body) -# rescue -# sleep 10 -# riak_stats = JSON.parse(Net::HTTP.get_response(URI.parse('http://localhost:8098/stats')).body) -# end - riak_hostname = node["engineyard"]["environment"]["instances"].map{|x| x["private_hostname"] if x["name"] =~ /^riak_0/ }.compact - - -# dirty hack below cover your eyes, please pardon. -# Chef::Log.info "I am #{node[:name]} and my /stats is #{riak_stats}" -# ring_members = riak_stats["ring_members"] - - execute "cd /data/riak_search;bin/riaksearch-admin join riak@#{riak_hostname}" do - action :run -# not_if { ring_members.include?("riak@#{riak_hostname}") } - end -end diff --git a/cookbooks/riaksearch/recipes/setuptools.rb b/cookbooks/riaksearch/recipes/setuptools.rb deleted file mode 100644 index 2e51073..0000000 --- a/cookbooks/riaksearch/recipes/setuptools.rb +++ /dev/null @@ -1,22 +0,0 @@ -directory "/mnt/src" do - action :create - owner "root" - group "root" - mode 0755 -end - -remote_file "/mnt/src/setuptools-0.6c11.tar.gz" do - not_if { FileTest.exists?("/mnt/src/setuptools-0.6c11.tar.gz") } - source "http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e" -end - -execute "un-tar setuptools" do - command "cd /mnt/src;tar zxfv setuptools-0.6c11.tar.gz" - not_if { FileTest.directory?("/mnt/src/setuptools-0.6c11") } -end - -execute "install setuptools" do - command "cd /mnt/src/setuptools-0.6c11;python setup.py install" - action :run - not_if { FileTest.exists?("/usr/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg") } -end diff --git a/cookbooks/riaksearch/recipes/start_riak.rb b/cookbooks/riaksearch/recipes/start_riak.rb deleted file mode 100644 index 635c409..0000000 --- a/cookbooks/riaksearch/recipes/start_riak.rb +++ /dev/null @@ -1,4 +0,0 @@ -execute "cd /data/riak_search;bin/riaksearch start && sleep 5;true" do - action :run -# not_if { "ps aux | grep riak" } -end diff --git a/cookbooks/riaksearch/templates/default/app.config.erb b/cookbooks/riaksearch/templates/default/app.config.erb deleted file mode 100644 index fd10cbe..0000000 --- a/cookbooks/riaksearch/templates/default/app.config.erb +++ /dev/null @@ -1,161 +0,0 @@ -%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- -%% ex: ts=4 sw=4 et -[ - %% Riak Core config - {riak_core, [ - %% Default location of ringstate - {ring_state_dir, "data/ring" }, - - %% http is a list of IP addresses and TCP ports that the Riak - %% HTTP interface will bind. - {http, [ {"0.0.0.0", 8098 } ]}, - - %% https is a list of IP addresses and TCP ports that the Riak - %% HTTPS interface will bind. - %{https, [{ "0.0.0.0", 8098 }]}, - - %% default cert and key locations for https can be overridden - %% with the ssl config variable - %{ssl, [ - % {certfile, "etc/cert.pem"}, - % {keyfile, "etc/key.pem"} - % ]}, - - %% riak_handoff_port is the TCP port that Riak uses for - %% intra-cluster data handoff. - {handoff_port, 8099 } - ]}, - - % Riak KV config - {riak_kv, [ - %% Storage_backend specifies the Erlang module defining the storage - %% mechanism that will be used on this node. - {storage_backend, riak_kv_bitcask_backend}, - - %% pb_ip is the IP address that the Riak Protocol Buffers interface - %% will bind to. If this is undefined, the interface will not run. - {pb_ip, "0.0.0.0" }, - - %% pb_port is the TCP port that the Riak Protocol Buffers interface - %% will bind to - {pb_port, 8087 }, - - %% raw_name is the first part of all URLS used by the Riak raw HTTP - %% interface. See riak_web.erl and raw_http_resource.erl for - %% details. - %{raw_name, "riak"}, - - %% mapred_name is URL used to submit map/reduce requests to Riak. - {mapred_name, "mapred"}, - - %% js_vm_count is the number of Javascript VMs to start per Riak - %% node. 8 is a good default for smaller installations. A larger - %% number like 12 or 16 is appropriate for installations handling - %% lots of map/reduce processing. - {js_vm_count, <%= @js_vm_count %>}, - - %% js_max_vm_mem is the maximum amount of memory, in megabytes, - %% allocated to the Javascript VMs. If unset, the default is - %% 8MB. - {js_max_vm_mem, <%= @js_max_vm_mem %>}, - - %% js_source_dir should point to a directory containing Javascript - %% source files which will be loaded by Riak when it initializes - %% Javascript VMs. - %{js_source_dir, "/tmp/js_source"}, - - %% vnode_mr_timeout controls how much time Riak will permit a map - %% function to execute on a given vnode before trying another vnode. - %% Value is in milliseconds and defaults to 1000ms if not set. - %{vnode_mr_timeout, 1000}, - - %% By default, each Riak node will own ring_creation_size/(number of nodes in the cluster) partitions. It is generally a good idea to specify a “ring_creation_size” a few times the number - %% of nodes in your cluster (e.g. specify 64-256 partitions for a 4-node cluster). This gives you room to expand the number of nodes in the cluster, without worrying about under-use - %% due to owning too few partitions. This number should be a power of 2 (64, 128, 256, etc.). - {ring_creation_size, 64}, - - %% riak_stat enables the use of the "riak-admin status" command to - %% retrieve information the Riak node for performance and debugging needs - {riak_kv_stat, true} - ]}, - - {riak_search, [ - {search_backend, merge_index_backend}, - {java_home, "/usr"}, - {max_search_results, 100000} - ]}, - {qilr, [ - %% NOTE: Change with 0.14 release: by default, JVM text analyzer is - %% disabled via missing/commented 'analysis_port' option or - %% via {analysis_port, undefined}. - %% Uncomment the following line in order to use JVM Lucene-based text analyzers. - %% {analysis_port, 6095 }, - - {backend_conn_count, 50 } - ]}, - - {riak_solr, [ - {solr_name, "solr"}, - {default_schema, "search"} - ]}, - - %% Merge Index Config - {merge_index, [ - {data_root, "data/merge_index"}, - {buffer_rollover_size, 1048576}, - {buffer_delayed_write_size, 524288}, - {buffer_delayed_write_ms, 2000}, - {max_compact_segments, 20}, - {fold_batch_size, 100}, - {segment_query_read_ahead_size, 65536}, - {segment_compaction_read_ahead_size, 5242880}, - {segment_file_buffer_size, 20971520}, - {segment_delayed_write_size, 20971520}, - {segment_delayed_write_ms, 10000}, - {segment_full_read_size, 5242880}, - {segment_block_size, 32767}, - {segment_values_staging_size, 1000}, - {segment_values_compression_threshold, 0}, - {segment_values_compression_level, 1} - ]}, - - %% Bitcask Config - {bitcask, [ - {data_root, "<%= @data_root %>"}, - {max_file_size, <%= @max_file_size %>}, - {sync_strategy, <%= @sync_strategy %>}, - {merge_window, <%= @merge_window %>}, - {frag_merge_trigger, <%= @frag_merge_trigger %>}, - {dead_bytes_merge_trigger, <%= @dead_bytes_merge_trigger %>}, - {frag_threshold, <%= @frag_threshold %>}, - {dead_bytes_threshold, <%= @dead_bytes_threshold %>}, - {small_file_threshold, <%= @small_file_threshold %>}, - {expiry_secs, <%= @expiry_secs %>} - ]}, - - %% Luwak Config - {luwak, [ - {enabled, false} - ]}, - -%% Riak_err Config -{riak_err, [ - %% Info/error/warning reports larger than this will be considered - %% too big to be formatted safely with the user-supplied format - %% string. - {term_max_size, 65536}, - - %% Limit the total size of formatted info/error/warning reports. - {fmt_max_bytes, 65536} - ]}, - - %% SASL config - {sasl, [ - {sasl_error_logger, {file, "log/sasl-error.log"}}, - {errlog_type, error}, - {error_logger_mf_dir, "log/sasl"}, % Log directory - {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size - {error_logger_mf_maxfiles, 5} % 5 files max - ]} -]. - diff --git a/cookbooks/riaksearch/templates/default/haproxy.cfg.erb b/cookbooks/riaksearch/templates/default/haproxy.cfg.erb deleted file mode 100644 index 67eef95..0000000 --- a/cookbooks/riaksearch/templates/default/haproxy.cfg.erb +++ /dev/null @@ -1,50 +0,0 @@ -global -# maximum number of simultaneous active connections from an upstream web server - nbproc <%= @node[:cpu][:total] %> - ulimit-n 160000 - maxconn 65535 - - # Logging to syslog facility local0 - # log 127.0.0.1 local0 - - # Distribute the health checks with a bit of randomness - spread-checks 5 - - # Uncomment the statement below to turn on verbose logging - #debug - -# Settings in the defaults section apply to all services (unless you change it, -# this configuration defines one service, called rails). -defaults - - # apply log settings from the global section above to services - log global - - # Proxy incoming traffic as HTTP requests - mode http - - option dontlognull - balance leastconn - clitimeout 60000 - srvtimeout 60000 - contimeout 5000 - retries 3 - option redispatch - option contstats - - # Enable the statistics page - stats enable - stats uri /haproxy?stats - - option httpchk GET /ping - - listen riak :8098 - <% @backends.each_with_index do |b,i| %> - server app-<%= i %> <%= b %>:8098 weight 1 maxconn 4096 -<% end %> - - listen riak_pbc :8087 - mode tcp - <% @backends.each_with_index do |b,i| %> - server app-<%= i %> <%= b %>:8087 weight 1 maxconn 4096 -<% end %> diff --git a/cookbooks/riaksearch/templates/default/haproxy_monitrc.erb b/cookbooks/riaksearch/templates/default/haproxy_monitrc.erb deleted file mode 100644 index 45a11db..0000000 --- a/cookbooks/riaksearch/templates/default/haproxy_monitrc.erb +++ /dev/null @@ -1,8 +0,0 @@ -check process haproxy-riak - with pidfile <%= @pidfile %> - start program = "/usr/bin/haproxy -D -p /var/run/haproxy_riak.pid -f /etc/haproxy_riak.cfg" with timeout 60 seconds - stop program = "/bin/bash -c '/bin/kill `cat /var/run/haproxy_riak.pid` && sleep 5&& monit quit'" with timeout 60 seconds - if mem > 512.0 MB for 2 cycles then restart - if cpu > 100% for 2 cycles then restart - group haproxy_riak - diff --git a/cookbooks/riaksearch/templates/default/ripple.yml.erb b/cookbooks/riaksearch/templates/default/ripple.yml.erb deleted file mode 100644 index e1fe9d3..0000000 --- a/cookbooks/riaksearch/templates/default/ripple.yml.erb +++ /dev/null @@ -1,4 +0,0 @@ -production: - http_port: 8098 - pb_port: 8087 - host: <%= @hostname %> diff --git a/cookbooks/riaksearch/templates/default/vm.args.erb b/cookbooks/riaksearch/templates/default/vm.args.erb deleted file mode 100644 index 9e526a2..0000000 --- a/cookbooks/riaksearch/templates/default/vm.args.erb +++ /dev/null @@ -1,20 +0,0 @@ -## Name of the riak node --name riak@<%= @node['ec2']['local_hostname'] %> - -## Cookie for distributed erlang --setcookie <%= @node['environment']['name'] %> - -## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive -## (Disabled by default..use with caution!) -##-heart - -## Enable kernel poll and a few async threads -+K true -+A 64 - -## Increase number of concurrent ports/sockets --env ERL_MAX_PORTS 65535 - -## Tweak GC to run more often --env ERL_FULLSWEEP_AFTER 0 -