Ceph is a distributed storage system that provides fault-tolerance and scalability. Installing Ceph on NixOS Latest can be done through the following steps:
First, you need to add the Ceph package to your NixOS configuration. Open the configuration file /etc/nixos/configuration.nix
and add the following code snippet:
# in the imports section
imports =
[ # ...
<nixpkgs/nixos/modules/services/misc/ceph.nix>
];
# in the services section
services.ceph = {
enable = true;
}
This will import the Ceph package and enable it as a system service.
Next, you need to configure Ceph based on your needs. This can be done through the services.ceph
attribute in the configuration file. Here's an example:
services.ceph = {
enable = true;
cluster.name = "my-cluster";
monitor.interface = "eth0";
monitor.addr = "192.168.1.100";
osd.devices = [ "/dev/sdb", "/dev/sdc" ];
}
This configuration will create a Ceph cluster named my-cluster
, set the monitor interface to eth0
and the monitor address to 192.168.1.100
, and add two OSD (Object Storage Device) devices located at /dev/sdb
and /dev/sdc
.
After configuring Ceph, you need to activate the configuration by running the following command:
sudo nixos-rebuild switch
This will apply the changes to your NixOS system and start the Ceph service.
To verify that Ceph is installed and running, you can use the following commands:
ceph -v
sudo systemctl status ceph-mon@$(hostname).service
sudo systemctl status ceph-osd@0.service
The first command will display the version of Ceph installed, while the second and third commands will show the status of the Ceph Monitor and OSD services, respectively.
Congratulations! You have successfully installed Ceph on NixOS Latest. You can now start using it as a distributed storage system for your applications.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!