Coder Social home page Coder Social logo

Comments (4)

hectcastro avatar hectcastro commented on July 26, 2024

Taking a look at this.

  1. The documentation is up-to-date – pb_ip and pb_port are being deprecated in favor of the pb list with IP and port tuples (similar to the existing HTTP interface configuration method).
  2. I believe you are correct here. We need to look and see if this can be done a different way.

from riak-chef-cookbook.

hectcastro avatar hectcastro commented on July 26, 2024

On second look, I was able to use Vagrant's JSON attributes to override the default attributes of the Riak cookbook:

chef.json = {
  "riak" => {
    "args" => {
      "+S" => 1,
      "-name" => "[email protected]"
    },
    "config" => {
      "riak_api" => {
        "pb" => [["__tuple", "__string_33.33.33.10", 8888]]
      },
      "riak_control" => {
        "enabled" => (index == 1 ? true : false)
      }
    }
  }
}

And the corresponding app.config:

[
    {bitcask, [
        {data_root, "/var/lib/riak/bitcask"},
        {io_mode, erlang}
    ]},
    {kernel, [
        {inet_dist_listen_max, 7999},
        {inet_dist_listen_min, 6000}
    ]},
    {lager, [
        {crash_log, "/var/log/riak/crash.log"},
        {crash_log_count, 5},
        {crash_log_date, "$D0"},
        {crash_log_msg_size, 65536},
        {crash_log_size, 10485760},
        {error_logger_hwm, 100},
        {error_logger_redirect, true},
        {handlers, [
            {lager_file_backend, [
                {"/var/log/riak/error.log", error, 10485760, "$D0", 5},
                {"/var/log/riak/console.log", info, 10485760, "$D0", 5}
            ]}
        ]}
    ]},
    {merge_index, [
        {buffer_rollover_size, 1048576},
        {data_root, "/var/lib/riak/merge_index"},
        {max_compact_segments, 20}
    ]},
    {riak_api, [
        {pb, [
            {"33.33.33.10", 8888}
        ]}
    ]},
    {riak_control, [
        {admin, true},
        {auth, userlist},
        {enabled, true},
        {userlist, [
            {"user", "pass"}
        ]}
    ]},
    {riak_core, [
        {dtrace_support, false},
        {handoff_port, 8099},
        {http, [
            {"10.0.2.15", 8098}
        ]},
        {https, [
            {"10.0.2.15", 8069}
        ]},
        {platform_bin_dir, "/usr/sbin"},
        {platform_data_dir, "/var/lib/riak"},
        {platform_etc_dir, "/etc/riak"},
        {platform_lib_dir, "/usr/lib/riak"},
        {platform_log_dir, "/var/log/riak"},
        {ring_creation_size, 64},
        {ring_state_dir, "/var/lib/riak/ring"},
        {ssl, [
            {certfile, "/etc/riak/riak-control-cert.pem"},
            {keyfile, "/etc/riak/riak-control-key.pem"}
        ]}
    ]},
    {riak_jmx, [
        {enabled, false}
    ]},
    {riak_kv, [
        {anti_entropy, {on, [
            ]}},
        {anti_entropy_build_limit, {1, 3600000}},
        {anti_entropy_concurrency, 2},
        {anti_entropy_data_dir, "/var/lib/riak/anti_entropy"},
        {anti_entropy_expire, 604800000},
        {anti_entropy_leveldb_opts, [
            {write_buffer_size, 4194304},
            {max_open_files, 20}
        ]},
        {anti_entropy_tick, 15000},
        {fsm_limit, 50000},
        {hook_js_vm_count, 2},
        {http_url_encoding, on},
        {js_max_vm_mem, 8},
        {js_thread_stack, 16},
        {listkeys_backpressure, true},
        {map_js_vm_count, 8},
        {mapred_2i_pipe, true},
        {mapred_name, "mapred"},
        {object_format, v1},
        {reduce_js_vm_count, 6},
        {storage_backend, riak_kv_bitcask_backend},
        {vnode_vclocks, true}
    ]},
    {riak_repl, [
        {data_root, "/var/lib/riak/riak_repl"}
    ]},
    {riak_search, [
        {enabled, false}
    ]},
    {riak_sysmon, [
        {busy_dist_port, true},
        {busy_port, true},
        {gc_ms_limit, 0},
        {heap_word_limit, 40111000},
        {port_limit, 2},
        {process_limit, 30}
    ]},
    {sasl, [
        {sasl_error_logger, false}
    ]},
    {snmp, [
        {agent, [
            {config, [
                {dir, "/etc/riak/snmp/agent/conf"},
                {force_load, true}
            ]},
            {db_dir, "/var/lib/riak/snmp/agent/db"},
            {net_if, [
                {options, [
                    {bind_to, true}
                ]}
            ]}
        ]}
    ]}
].

What version of Chef are you running?

$ chef-client --version
Chef: 11.6.0

from riak-chef-cookbook.

kkalin78 avatar kkalin78 commented on July 26, 2024

Hmm. I will try one more time. I use chef-solo 10.26

from riak-chef-cookbook.

hectcastro avatar hectcastro commented on July 26, 2024

So after taking a closer look, Chef 11 overrides the attributes but 10.26 does not. For users on 10.x, we've suggested the following wrapper cookbook approach:

include_recipe "riak"

# Remove merged settings because override works differently on Chef 10
file "#{node['riak']['package']['config_dir']}/app.config" do
  content Proc.new {
    config = node['riak']['config'].to_hash
    # Deletes the unwanted attribute index
    config['riak_core']['pb'].delete_at(0)

    Eth::Config.new(config).pp
  }.call
  owner "root"
  mode 0644
  notifies :restart, "service[riak]"
end

from riak-chef-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.