Puppet Class: cloud::object::storage

Defined in:
manifests/object/storage.pp

Overview

swift storage

Parameters:

  • storage_eth (Any) (defaults to: $os_params::storage_eth)
  • swift_zone (Any) (defaults to: undef)
  • object_port (Any) (defaults to: '6000')
  • container_port (Any) (defaults to: '6001')
  • account_port (Any) (defaults to: '6002')
  • onloopdevices (Any) (defaults to: false)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'manifests/object/storage.pp', line 21

class cloud::object::storage (
  $storage_eth    = $os_params::storage_eth,
  $swift_zone     = undef,
  $object_port    = '6000',
  $container_port = '6001',
  $account_port   = '6002',
  $onloopdevices  = false,
) {

  include 'cloud::object'

  class { 'swift::storage':
    storage_local_net_ip => $storage_eth,
  }

  Rsync::Server::Module {
    incoming_chmod  => 'u=rwX,go=rX',
    outgoing_chmod  => 'u=rwX,go=rX',
  }

  Swift::Storage::Server {
    #devices                => $devices,
    storage_local_net_ip    => $storage_eth,
    workers                 => inline_template('<%= @processorcount.to_i / 2 %>'),
    replicator_concurrency  => 2,
    updater_concurrency     => 1,
    reaper_concurrency      => 1,
    require                 => Class['swift'],
    mount_check             => true,
  }
  # concurrency at 2 and 1 seems better see
  # http://docs.openstack.org/trunk/openstack-object-storage/admin/content/general-service-tuning.html

  swift::storage::server { $account_port:
    type             => 'account',
    config_file_path => 'account-server.conf',
    pipeline         => ['healthcheck', 'account-server'],
    log_facility     => 'LOG_LOCAL2',
  }

  swift::storage::server { $container_port:
    type             => 'container',
    config_file_path => 'container-server.conf',
    workers          => inline_template("<%= @processorcount.to_i / 2 %>
db_preallocation = on
allow_versions = on
"), # great hack :(
    pipeline         => ['healthcheck', 'container-server'],
    log_facility     => 'LOG_LOCAL4',
  }

  swift::storage::server { $object_port:
    type             => 'object',
    config_file_path => 'object-server.conf',
    pipeline         => ['healthcheck', 'recon', 'object-server'],
    log_facility     => 'LOG_LOCAL6',
  }

  swift::storage::filter::recon { 'object': }
  swift::storage::filter::recon { 'container': }
  swift::storage::filter::recon { 'account': }
  swift::storage::filter::healthcheck { 'object': }
  swift::storage::filter::healthcheck { 'container': }
  swift::storage::filter::healthcheck { 'account': }

  $object_nodes = flatten([ range('sdc','sdd')])
  swift::storage::xfs { $object_nodes: }
  swift::storage::xfs { 'sdb': }
  cloud::object::set_io_scheduler {'sdb':}
  cloud::object::set_io_scheduler {$object_nodes:}

  @@ring_container_device { "${storage_eth}:${container_port}/sdb":
    zone        => $swift_zone,
    weight      => '100.0',
  }
  @@ring_account_device { "${storage_eth}:${account_port}/sdb":
    zone        => $swift_zone,
    weight      => '100.0',
  }
  $object_urls = prefix($object_nodes, "${storage_eth}:${object_port}/")
  @@ring_object_device {$object_urls:
    zone        => $swift_zone,
    weight      => '100.0',
  }

  class{
    ['swift::storage::object',
    'swift::storage::container',
    'swift::storage::account']:
  }

  Swift::Ringsync<<| |>> ->
    Swift::Storage::Server[$container_port] ->
    Swift::Storage::Server[$account_port] ->
    Swift::Storage::Server[$object_port]

}