commit
2603d15a4d
@ -19,6 +19,12 @@ let
|
|||||||
key = "AQBEEJNac00kExAAXEgy943BGyOpVH1LLlHafQ==";
|
key = "AQBEEJNac00kExAAXEgy943BGyOpVH1LLlHafQ==";
|
||||||
uuid = "5e97a838-85b6-43b0-8950-cb56d554d1e5";
|
uuid = "5e97a838-85b6-43b0-8950-cb56d554d1e5";
|
||||||
};
|
};
|
||||||
|
osd2 = {
|
||||||
|
name = "2";
|
||||||
|
ip = "192.168.1.4";
|
||||||
|
key = "AQAdyhZeIaUlARAAGRoidDAmS6Vkp546UFEf5w==";
|
||||||
|
uuid = "ea999274-13d0-4dd5-9af9-ad25a324f72f";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
generateCephConfig = { daemonConfig }: {
|
generateCephConfig = { daemonConfig }: {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -72,35 +78,20 @@ let
|
|||||||
};
|
};
|
||||||
}; };
|
}; };
|
||||||
|
|
||||||
networkOsd0 = {
|
networkOsd = osd: {
|
||||||
dhcpcd.enable = false;
|
dhcpcd.enable = false;
|
||||||
interfaces.eth1.ipv4.addresses = pkgs.lib.mkOverride 0 [
|
interfaces.eth1.ipv4.addresses = pkgs.lib.mkOverride 0 [
|
||||||
{ address = cfg.osd0.ip; prefixLength = 24; }
|
{ address = osd.ip; prefixLength = 24; }
|
||||||
];
|
];
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPortRanges = [ { from = 6800; to = 7300; } ];
|
allowedTCPPortRanges = [ { from = 6800; to = 7300; } ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
cephConfigOsd0 = generateCephConfig { daemonConfig = {
|
|
||||||
osd = {
|
|
||||||
enable = true;
|
|
||||||
daemons = [ cfg.osd0.name ];
|
|
||||||
};
|
|
||||||
}; };
|
|
||||||
|
|
||||||
networkOsd1 = {
|
cephConfigOsd = osd: generateCephConfig { daemonConfig = {
|
||||||
dhcpcd.enable = false;
|
|
||||||
interfaces.eth1.ipv4.addresses = pkgs.lib.mkOverride 0 [
|
|
||||||
{ address = cfg.osd1.ip; prefixLength = 24; }
|
|
||||||
];
|
|
||||||
firewall = {
|
|
||||||
allowedTCPPortRanges = [ { from = 6800; to = 7300; } ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
cephConfigOsd1 = generateCephConfig { daemonConfig = {
|
|
||||||
osd = {
|
osd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
daemons = [ cfg.osd1.name ];
|
daemons = [ osd.name ];
|
||||||
};
|
};
|
||||||
}; };
|
}; };
|
||||||
|
|
||||||
@ -114,6 +105,7 @@ let
|
|||||||
monA.wait_for_unit("network.target")
|
monA.wait_for_unit("network.target")
|
||||||
osd0.wait_for_unit("network.target")
|
osd0.wait_for_unit("network.target")
|
||||||
osd1.wait_for_unit("network.target")
|
osd1.wait_for_unit("network.target")
|
||||||
|
osd2.wait_for_unit("network.target")
|
||||||
|
|
||||||
# Bootstrap ceph-mon daemon
|
# Bootstrap ceph-mon daemon
|
||||||
monA.succeed(
|
monA.succeed(
|
||||||
@ -145,8 +137,9 @@ let
|
|||||||
monA.succeed("cp /etc/ceph/ceph.client.admin.keyring /tmp/shared")
|
monA.succeed("cp /etc/ceph/ceph.client.admin.keyring /tmp/shared")
|
||||||
osd0.succeed("cp /tmp/shared/ceph.client.admin.keyring /etc/ceph")
|
osd0.succeed("cp /tmp/shared/ceph.client.admin.keyring /etc/ceph")
|
||||||
osd1.succeed("cp /tmp/shared/ceph.client.admin.keyring /etc/ceph")
|
osd1.succeed("cp /tmp/shared/ceph.client.admin.keyring /etc/ceph")
|
||||||
|
osd2.succeed("cp /tmp/shared/ceph.client.admin.keyring /etc/ceph")
|
||||||
|
|
||||||
# Bootstrap both OSDs
|
# Bootstrap OSDs
|
||||||
osd0.succeed(
|
osd0.succeed(
|
||||||
"mkfs.xfs /dev/vdb",
|
"mkfs.xfs /dev/vdb",
|
||||||
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
||||||
@ -161,6 +154,13 @@ let
|
|||||||
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd1.name}/keyring --name osd.${cfg.osd1.name} --add-key ${cfg.osd1.key}",
|
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd1.name}/keyring --name osd.${cfg.osd1.name} --add-key ${cfg.osd1.key}",
|
||||||
'echo \'{"cephx_secret": "${cfg.osd1.key}"}\' | ceph osd new ${cfg.osd1.uuid} -i -',
|
'echo \'{"cephx_secret": "${cfg.osd1.key}"}\' | ceph osd new ${cfg.osd1.uuid} -i -',
|
||||||
)
|
)
|
||||||
|
osd2.succeed(
|
||||||
|
"mkfs.xfs /dev/vdb",
|
||||||
|
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd2.name}",
|
||||||
|
"mount /dev/vdb /var/lib/ceph/osd/ceph-${cfg.osd2.name}",
|
||||||
|
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd2.name}/keyring --name osd.${cfg.osd2.name} --add-key ${cfg.osd2.key}",
|
||||||
|
'echo \'{"cephx_secret": "${cfg.osd2.key}"}\' | ceph osd new ${cfg.osd2.uuid} -i -',
|
||||||
|
)
|
||||||
|
|
||||||
# Initialize the OSDs with regular filestore
|
# Initialize the OSDs with regular filestore
|
||||||
osd0.succeed(
|
osd0.succeed(
|
||||||
@ -173,7 +173,12 @@ let
|
|||||||
"chown -R ceph:ceph /var/lib/ceph/osd",
|
"chown -R ceph:ceph /var/lib/ceph/osd",
|
||||||
"systemctl start ceph-osd-${cfg.osd1.name}",
|
"systemctl start ceph-osd-${cfg.osd1.name}",
|
||||||
)
|
)
|
||||||
monA.wait_until_succeeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'")
|
osd2.succeed(
|
||||||
|
"ceph-osd -i ${cfg.osd2.name} --mkfs --osd-uuid ${cfg.osd2.uuid}",
|
||||||
|
"chown -R ceph:ceph /var/lib/ceph/osd",
|
||||||
|
"systemctl start ceph-osd-${cfg.osd2.name}",
|
||||||
|
)
|
||||||
|
monA.wait_until_succeeds("ceph osd stat | grep -e '3 osds: 3 up[^,]*, 3 in'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
||||||
|
|
||||||
@ -196,16 +201,18 @@ let
|
|||||||
monA.crash()
|
monA.crash()
|
||||||
osd0.crash()
|
osd0.crash()
|
||||||
osd1.crash()
|
osd1.crash()
|
||||||
|
osd2.crash()
|
||||||
|
|
||||||
# Start it up
|
# Start it up
|
||||||
osd0.start()
|
osd0.start()
|
||||||
osd1.start()
|
osd1.start()
|
||||||
|
osd2.start()
|
||||||
monA.start()
|
monA.start()
|
||||||
|
|
||||||
# Ensure the cluster comes back up again
|
# Ensure the cluster comes back up again
|
||||||
monA.succeed("ceph -s | grep 'mon: 1 daemons'")
|
monA.succeed("ceph -s | grep 'mon: 1 daemons'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
||||||
monA.wait_until_succeeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'")
|
monA.wait_until_succeeds("ceph osd stat | grep -e '3 osds: 3 up[^,]*, 3 in'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
||||||
'';
|
'';
|
||||||
@ -217,8 +224,9 @@ in {
|
|||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
monA = generateHost { pkgs = pkgs; cephConfig = cephConfigMonA; networkConfig = networkMonA; };
|
monA = generateHost { pkgs = pkgs; cephConfig = cephConfigMonA; networkConfig = networkMonA; };
|
||||||
osd0 = generateHost { pkgs = pkgs; cephConfig = cephConfigOsd0; networkConfig = networkOsd0; };
|
osd0 = generateHost { pkgs = pkgs; cephConfig = cephConfigOsd cfg.osd0; networkConfig = networkOsd cfg.osd0; };
|
||||||
osd1 = generateHost { pkgs = pkgs; cephConfig = cephConfigOsd1; networkConfig = networkOsd1; };
|
osd1 = generateHost { pkgs = pkgs; cephConfig = cephConfigOsd cfg.osd1; networkConfig = networkOsd cfg.osd1; };
|
||||||
|
osd2 = generateHost { pkgs = pkgs; cephConfig = cephConfigOsd cfg.osd2; networkConfig = networkOsd cfg.osd2; };
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = testscript;
|
testScript = testscript;
|
||||||
|
@ -17,6 +17,11 @@ let
|
|||||||
key = "AQBEEJNac00kExAAXEgy943BGyOpVH1LLlHafQ==";
|
key = "AQBEEJNac00kExAAXEgy943BGyOpVH1LLlHafQ==";
|
||||||
uuid = "5e97a838-85b6-43b0-8950-cb56d554d1e5";
|
uuid = "5e97a838-85b6-43b0-8950-cb56d554d1e5";
|
||||||
};
|
};
|
||||||
|
osd2 = {
|
||||||
|
name = "2";
|
||||||
|
key = "AQAdyhZeIaUlARAAGRoidDAmS6Vkp546UFEf5w==";
|
||||||
|
uuid = "ea999274-13d0-4dd5-9af9-ad25a324f72f";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
generateCephConfig = { daemonConfig }: {
|
generateCephConfig = { daemonConfig }: {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -30,7 +35,7 @@ let
|
|||||||
generateHost = { pkgs, cephConfig, networkConfig, ... }: {
|
generateHost = { pkgs, cephConfig, networkConfig, ... }: {
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
memorySize = 512;
|
memorySize = 512;
|
||||||
emptyDiskImages = [ 20480 20480 ];
|
emptyDiskImages = [ 20480 20480 20480 ];
|
||||||
vlans = [ 1 ];
|
vlans = [ 1 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +70,7 @@ let
|
|||||||
};
|
};
|
||||||
osd = {
|
osd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
daemons = [ cfg.osd0.name cfg.osd1.name ];
|
daemons = [ cfg.osd0.name cfg.osd1.name cfg.osd2.name ];
|
||||||
};
|
};
|
||||||
}; };
|
}; };
|
||||||
|
|
||||||
@ -104,29 +109,36 @@ let
|
|||||||
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
||||||
|
|
||||||
# Bootstrap both OSDs
|
# Bootstrap OSDs
|
||||||
monA.succeed(
|
monA.succeed(
|
||||||
"mkfs.xfs /dev/vdb",
|
"mkfs.xfs /dev/vdb",
|
||||||
"mkfs.xfs /dev/vdc",
|
"mkfs.xfs /dev/vdc",
|
||||||
|
"mkfs.xfs /dev/vdd",
|
||||||
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
||||||
"mount /dev/vdb /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
"mount /dev/vdb /var/lib/ceph/osd/ceph-${cfg.osd0.name}",
|
||||||
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd1.name}",
|
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd1.name}",
|
||||||
"mount /dev/vdc /var/lib/ceph/osd/ceph-${cfg.osd1.name}",
|
"mount /dev/vdc /var/lib/ceph/osd/ceph-${cfg.osd1.name}",
|
||||||
|
"mkdir -p /var/lib/ceph/osd/ceph-${cfg.osd2.name}",
|
||||||
|
"mount /dev/vdd /var/lib/ceph/osd/ceph-${cfg.osd2.name}",
|
||||||
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd0.name}/keyring --name osd.${cfg.osd0.name} --add-key ${cfg.osd0.key}",
|
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd0.name}/keyring --name osd.${cfg.osd0.name} --add-key ${cfg.osd0.key}",
|
||||||
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd1.name}/keyring --name osd.${cfg.osd1.name} --add-key ${cfg.osd1.key}",
|
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd1.name}/keyring --name osd.${cfg.osd1.name} --add-key ${cfg.osd1.key}",
|
||||||
|
"ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-${cfg.osd2.name}/keyring --name osd.${cfg.osd2.name} --add-key ${cfg.osd2.key}",
|
||||||
'echo \'{"cephx_secret": "${cfg.osd0.key}"}\' | ceph osd new ${cfg.osd0.uuid} -i -',
|
'echo \'{"cephx_secret": "${cfg.osd0.key}"}\' | ceph osd new ${cfg.osd0.uuid} -i -',
|
||||||
'echo \'{"cephx_secret": "${cfg.osd1.key}"}\' | ceph osd new ${cfg.osd1.uuid} -i -',
|
'echo \'{"cephx_secret": "${cfg.osd1.key}"}\' | ceph osd new ${cfg.osd1.uuid} -i -',
|
||||||
|
'echo \'{"cephx_secret": "${cfg.osd2.key}"}\' | ceph osd new ${cfg.osd2.uuid} -i -',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialize the OSDs with regular filestore
|
# Initialize the OSDs with regular filestore
|
||||||
monA.succeed(
|
monA.succeed(
|
||||||
"ceph-osd -i ${cfg.osd0.name} --mkfs --osd-uuid ${cfg.osd0.uuid}",
|
"ceph-osd -i ${cfg.osd0.name} --mkfs --osd-uuid ${cfg.osd0.uuid}",
|
||||||
"ceph-osd -i ${cfg.osd1.name} --mkfs --osd-uuid ${cfg.osd1.uuid}",
|
"ceph-osd -i ${cfg.osd1.name} --mkfs --osd-uuid ${cfg.osd1.uuid}",
|
||||||
|
"ceph-osd -i ${cfg.osd2.name} --mkfs --osd-uuid ${cfg.osd2.uuid}",
|
||||||
"chown -R ceph:ceph /var/lib/ceph/osd",
|
"chown -R ceph:ceph /var/lib/ceph/osd",
|
||||||
"systemctl start ceph-osd-${cfg.osd0.name}",
|
"systemctl start ceph-osd-${cfg.osd0.name}",
|
||||||
"systemctl start ceph-osd-${cfg.osd1.name}",
|
"systemctl start ceph-osd-${cfg.osd1.name}",
|
||||||
|
"systemctl start ceph-osd-${cfg.osd2.name}",
|
||||||
)
|
)
|
||||||
monA.wait_until_succeeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'")
|
monA.wait_until_succeeds("ceph osd stat | grep -e '3 osds: 3 up[^,]*, 3 in'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
||||||
|
|
||||||
@ -161,11 +173,12 @@ let
|
|||||||
monA.wait_for_unit("ceph-mgr-${cfg.monA.name}")
|
monA.wait_for_unit("ceph-mgr-${cfg.monA.name}")
|
||||||
monA.wait_for_unit("ceph-osd-${cfg.osd0.name}")
|
monA.wait_for_unit("ceph-osd-${cfg.osd0.name}")
|
||||||
monA.wait_for_unit("ceph-osd-${cfg.osd1.name}")
|
monA.wait_for_unit("ceph-osd-${cfg.osd1.name}")
|
||||||
|
monA.wait_for_unit("ceph-osd-${cfg.osd2.name}")
|
||||||
|
|
||||||
# Ensure the cluster comes back up again
|
# Ensure the cluster comes back up again
|
||||||
monA.succeed("ceph -s | grep 'mon: 1 daemons'")
|
monA.succeed("ceph -s | grep 'mon: 1 daemons'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
monA.wait_until_succeeds("ceph -s | grep 'quorum ${cfg.monA.name}'")
|
||||||
monA.wait_until_succeeds("ceph osd stat | grep -e '2 osds: 2 up[^,]*, 2 in'")
|
monA.wait_until_succeeds("ceph osd stat | grep -e '3 osds: 3 up[^,]*, 3 in'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
monA.wait_until_succeeds("ceph -s | grep 'mgr: ${cfg.monA.name}(active,'")
|
||||||
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
monA.wait_until_succeeds("ceph -s | grep 'HEALTH_OK'")
|
||||||
'';
|
'';
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
, cunit, snappy
|
, cunit, snappy
|
||||||
, rocksdb, makeWrapper
|
, rocksdb, makeWrapper
|
||||||
, leveldb, oathToolkit
|
, leveldb, oathToolkit
|
||||||
|
, libnl, libcap_ng
|
||||||
|
|
||||||
# Optional Dependencies
|
# Optional Dependencies
|
||||||
, yasm ? null, fcgi ? null, expat ? null
|
, yasm ? null, fcgi ? null, expat ? null
|
||||||
@ -88,9 +89,10 @@ let
|
|||||||
ps.webob
|
ps.webob
|
||||||
ps.bcrypt
|
ps.bcrypt
|
||||||
ps.six
|
ps.six
|
||||||
|
ps.pyyaml
|
||||||
]);
|
]);
|
||||||
|
|
||||||
version = "14.2.4";
|
version = "14.2.5";
|
||||||
in rec {
|
in rec {
|
||||||
ceph = stdenv.mkDerivation {
|
ceph = stdenv.mkDerivation {
|
||||||
pname = "ceph";
|
pname = "ceph";
|
||||||
@ -98,7 +100,7 @@ in rec {
|
|||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://download.ceph.com/tarballs/ceph-${version}.tar.gz";
|
url = "http://download.ceph.com/tarballs/ceph-${version}.tar.gz";
|
||||||
sha256 = "1y6hixh6srd5aswhzq0sf0dbygwhx0ardx3w3f7qazf5rapvd03i";
|
sha256 = "0wbkdplxs8higmlj57a7rydmx9rq08h0arjrmxmp0s80bn0v5x2c";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
@ -116,7 +118,7 @@ in rec {
|
|||||||
buildInputs = cryptoLibsMap.${cryptoStr} ++ [
|
buildInputs = cryptoLibsMap.${cryptoStr} ++ [
|
||||||
boost ceph-python-env libxml2 optYasm optLibatomic_ops optLibs3
|
boost ceph-python-env libxml2 optYasm optLibatomic_ops optLibs3
|
||||||
malloc zlib openldap lttng-ust babeltrace gperf gtest cunit
|
malloc zlib openldap lttng-ust babeltrace gperf gtest cunit
|
||||||
snappy rocksdb lz4 oathToolkit leveldb
|
snappy rocksdb lz4 oathToolkit leveldb libnl libcap_ng
|
||||||
] ++ optionals stdenv.isLinux [
|
] ++ optionals stdenv.isLinux [
|
||||||
linuxHeaders utillinux libuuid udev keyutils optLibaio optLibxfs optZfs
|
linuxHeaders utillinux libuuid udev keyutils optLibaio optLibxfs optZfs
|
||||||
# ceph 14
|
# ceph 14
|
||||||
|
Loading…
Reference in New Issue
Block a user