Adding object name[space] parameters

With Jewel the ceph-osd daemon will refuse to start if the configured
rados max object name length cannot be safely stored [1],[2].

Adding options for osd_max_object_name_len and osd_max_object_namespace_len,

1. http://tracker.ceph.com/issues/16187
2: http://docs.ceph.com/docs/jewel/rados/configuration/filesystem-recommendations/#filesystems

Change-Id: Id487d6d656e88dfe29eac80c378058551c92dfd9
This commit is contained in:
Giulio Fidente 2016-08-19 19:46:10 +02:00 committed by Alex Schultz
parent b72bf9d6b8
commit 658dc50aed
6 changed files with 67 additions and 28 deletions

View File

@ -38,6 +38,12 @@
# [*osd_journal_size*] The size of the journal file/device.
# Optional. Integer. Default provided by Ceph.
#
# [*osd_max_object_name_len*] The length of the objects name
# Optional. Integer. Default to undef
#
# [*osd_max_object_namespace_len*] The length of the objects namespace name
# Optional. Integer. Default to undef
#
# [*osd_pool_default_pg_num*] The default number of PGs per pool.
# Optional. Integer. Default provided by Ceph.
#
@ -135,6 +141,8 @@ class ceph (
$authentication_type = 'cephx',
$keyring = undef,
$osd_journal_size = undef,
$osd_max_object_name_len = undef,
$osd_max_object_namespace_len = undef,
$osd_pool_default_pg_num = undef,
$osd_pool_default_pgp_num = undef,
$osd_pool_default_size = undef,
@ -178,27 +186,42 @@ class ceph (
Package<| tag == 'ceph' |> -> Ceph_config<| |>
# [global]
ceph_config {
'global/fsid': value => $fsid;
'global/keyring': value => $keyring;
'global/osd_pool_default_pg_num': value => $osd_pool_default_pg_num;
'global/osd_pool_default_pgp_num': value => $osd_pool_default_pgp_num;
'global/osd_pool_default_size': value => $osd_pool_default_size;
'global/osd_pool_default_min_size': value => $osd_pool_default_min_size;
'global/osd_pool_default_crush_rule': value => $osd_pool_default_crush_rule;
'global/osd_crush_update_on_start': value => $osd_crush_update_on_start;
'global/mon_osd_full_ratio': value => $mon_osd_full_ratio;
'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio;
'global/mon_initial_members': value => $mon_initial_members;
'global/mon_host': value => $mon_host;
'global/ms_bind_ipv6': value => $ms_bind_ipv6;
'global/require_signatures': value => $require_signatures;
'global/cluster_require_signatures': value => $cluster_require_signatures;
'global/service_require_signatures': value => $service_require_signatures;
'global/sign_messages': value => $sign_messages;
'global/cluster_network': value => $cluster_network;
'global/public_network': value => $public_network;
'global/public_addr': value => $public_addr;
'osd/osd_journal_size': value => $osd_journal_size;
'global/fsid': value => $fsid;
'global/keyring': value => $keyring;
'global/osd_pool_default_pg_num': value => $osd_pool_default_pg_num;
'global/osd_pool_default_pgp_num': value => $osd_pool_default_pgp_num;
'global/osd_pool_default_size': value => $osd_pool_default_size;
'global/osd_pool_default_min_size': value => $osd_pool_default_min_size;
'global/osd_pool_default_crush_rule': value => $osd_pool_default_crush_rule;
'global/osd_crush_update_on_start': value => $osd_crush_update_on_start;
'global/mon_osd_full_ratio': value => $mon_osd_full_ratio;
'global/mon_osd_nearfull_ratio': value => $mon_osd_nearfull_ratio;
'global/mon_initial_members': value => $mon_initial_members;
'global/mon_host': value => $mon_host;
'global/ms_bind_ipv6': value => $ms_bind_ipv6;
'global/require_signatures': value => $require_signatures;
'global/cluster_require_signatures': value => $cluster_require_signatures;
'global/service_require_signatures': value => $service_require_signatures;
'global/sign_messages': value => $sign_messages;
'global/cluster_network': value => $cluster_network;
'global/public_network': value => $public_network;
'global/public_addr': value => $public_addr;
'osd/osd_journal_size': value => $osd_journal_size;
}
# NOTE(aschultz): for backwards compatibility in p-o-i & elsewhere we only
# define these here if they are set. Once this patch lands, we can update
# p-o-i to leverage these parameters and ditch these if clauses.
if $osd_max_object_name_len {
ceph_config {
'global/osd_max_object_name_len': value => $osd_max_object_name_len;
}
}
if $osd_max_object_namespace_len {
ceph_config {
'global/osd_max_object_namespace_len': value => $osd_max_object_namespace_len;
}
}
if $authentication_type == 'cephx' {

View File

@ -34,6 +34,8 @@ class ceph::profile::base {
fsid => $ceph::profile::params::fsid,
authentication_type => $ceph::profile::params::authentication_type,
osd_journal_size => $ceph::profile::params::osd_journal_size,
osd_max_object_name_len => $ceph::profile::params::osd_max_object_name_len,
osd_max_object_namespace_len => $ceph::profile::params::osd_max_object_namespace_len,
osd_pool_default_pg_num => $ceph::profile::params::osd_pool_default_pg_num,
osd_pool_default_pgp_num => $ceph::profile::params::osd_pool_default_pgp_num,
osd_pool_default_size => $ceph::profile::params::osd_pool_default_size,

View File

@ -44,6 +44,12 @@
# [*osd_journal_size*] The size of the journal file/device.
# Optional. Integer. Default provided by Ceph.
#
# [*osd_max_object_name_len*] The maximum length of a rados object name
# Optional. Integer. Default to undef.
#
# [*osd_max_object_namespace_len*] The maximum length of a rados object name
# Optional. Integer. Default to undef.
#
# [*osd_pool_default_pg_num*] The default number of PGs per pool.
# Optional. Integer. Default provided by Ceph.
#
@ -148,6 +154,8 @@ class ceph::profile::params (
$mon_host = undef,
$ms_bind_ipv6 = undef,
$osd_journal_size = undef,
$osd_max_object_name_len = undef,
$osd_max_object_namespace_len = undef,
$osd_pool_default_pg_num = undef,
$osd_pool_default_pgp_num = undef,
$osd_pool_default_size = undef,

View File

@ -29,16 +29,16 @@ describe 'ceph mon osd' do
enable_epel => false,
}
class { 'ceph':
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
mon_host => $::ipaddress,
authentication_type => 'none',
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
mon_host => $::ipaddress,
authentication_type => 'none',
osd_pool_default_size => '1',
osd_pool_default_min_size => '1',
osd_max_object_namespace_len => '64',
osd_max_object_name_len => '256',
}
ceph_config {
'global/osd_journal_size': value => '100';
'global/osd_max_object_namespace_len': value => '64';
'global/osd_max_object_name_len': value => '256';
}
ceph::mon { 'a':
public_addr => $::ipaddress,

View File

@ -68,6 +68,8 @@ describe 'ceph' do
:authentication_type => 'none',
:keyring => '/usr/local/ceph/etc/keyring',
:osd_journal_size => '1024',
:osd_max_object_name_len => '1024',
:osd_max_object_namespace_len => '256',
:osd_pool_default_pg_num => '256',
:osd_pool_default_pgp_num => '256',
:osd_pool_default_size => '2',
@ -102,6 +104,8 @@ describe 'ceph' do
it { is_expected.to contain_ceph_config('global/fsid').with_value('d5252e7d-75bc-4083-85ed-fe51fa83f62b') }
it { is_expected.to contain_ceph_config('global/keyring').with_value('/usr/local/ceph/etc/keyring') }
it { is_expected.to contain_ceph_config('global/osd_max_object_name_len').with_value('1024') }
it { is_expected.to contain_ceph_config('global/osd_max_object_namespace_len').with_value('256') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_pg_num').with_value('256') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_pgp_num').with_value('256') }
it { is_expected.to contain_ceph_config('global/osd_pool_default_size').with_value('2') }

View File

@ -8,6 +8,8 @@ ceph::profile::params::authentication_type: 'cephx'
ceph::profile::params::mon_initial_members: 'first, second'
ceph::profile::params::mon_host: '10.11.12.2:6789, 10.11.12.3:6789'
ceph::profile::params::osd_journal_size: '4096'
ceph::profile::params::osd_max_object_name_len: '256'
ceph::profile::params::osd_max_object_namespace_len: '64'
ceph::profile::params::osd_pool_default_pg_num: '200'
ceph::profile::params::osd_pool_default_pgp_num: '200'
ceph::profile::params::osd_pool_default_size: '2'