From 9267538fc81b73ffa574cf873b9e5fc96b629bc1 Mon Sep 17 00:00:00 2001 From: Cedric Lecomte Date: Tue, 14 Apr 2015 09:29:14 -0400 Subject: [PATCH] Changing who is affected by the sysctl tunning Only the swift-nodes need to be tuned according to https://bugs.launchpad.net/swift/+bug/1075606. And enlarge the local port range on the controller can overlap with the listening services. Changing the local range port We must don't overlap the local range port and the listening ports. Listening port on swift nodes are around 6800. With a bad ordering or a restart we can face a already used port problem. Co-Authored-By: Emilien Macchi Change-Id: I5e875403946a22ec8c5848af259d3afa84db4e35 --- manifests/object.pp | 2 -- manifests/object/storage.pp | 2 ++ manifests/object/tweaking.pp | 2 +- spec/classes/cloud_object_storage_spec.rb | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/object.pp b/manifests/object.pp index 0ad00e70..d7d9e917 100644 --- a/manifests/object.pp +++ b/manifests/object.pp @@ -30,6 +30,4 @@ class cloud::object( swift_hash_suffix => $swift_hash_suffix, } - class {'cloud::object::tweaking': } - } diff --git a/manifests/object/storage.pp b/manifests/object/storage.pp index 5d755943..ae19ef7a 100644 --- a/manifests/object/storage.pp +++ b/manifests/object/storage.pp @@ -75,6 +75,8 @@ class cloud::object::storage( include 'cloud::object' + include 'cloud::object::tweaking' + class { 'swift::storage': storage_local_net_ip => $storage_eth, } diff --git a/manifests/object/tweaking.pp b/manifests/object/tweaking.pp index 17f54f42..ff5e552b 100644 --- a/manifests/object/tweaking.pp +++ b/manifests/object/tweaking.pp @@ -22,7 +22,7 @@ class cloud::object::tweaking { 'net.ipv4.tcp_tw_recycle' => { value => 1 }, 'net.ipv4.tcp_tw_reuse' => { value => 1 }, 'net.ipv4.tcp_syncookies' => { value => 0 }, - 'net.ipv4.ip_local_port_range' => { value => "1024\t65000" }, + 'net.ipv4.ip_local_port_range' => { value => "10000\t65000" }, 'net.core.netdev_max_backlog' => { value => 300000 }, 'net.ipv4.tcp_sack' => { value => 0 }, } diff --git a/spec/classes/cloud_object_storage_spec.rb b/spec/classes/cloud_object_storage_spec.rb index 766e2121..f62605ac 100644 --- a/spec/classes/cloud_object_storage_spec.rb +++ b/spec/classes/cloud_object_storage_spec.rb @@ -39,6 +39,10 @@ describe 'cloud::object::storage' do 'storage_local_net_ip' => '127.0.0.1', }) + is_expected.to contain_sysctl('net.ipv4.ip_local_port_range').with( + :val => "10000\t65000", + ) + is_expected.to contain_swift__storage__server('6000').with({ 'type' => 'object', 'config_file_path' => 'object-server.conf',