Skip to content

Instantly share code, notes, and snippets.

View kalaspuffar's full-sized avatar
💭
Even penguins can fly when it blows enough

Daniel Persson kalaspuffar

💭
Even penguins can fly when it blows enough
View GitHub Profile
@kalaspuffar
kalaspuffar / ceph-filesystem.md
Last active December 4, 2022 11:21
A quick look into how to setup a filesystem in ceph.

Setup MDS services

First, we need to add the MDS (MetaData Service) to each of the nodes.

The first node we call n1. In this call, we will create the directory for the keyring and then create a new one from the cluster config and pipe it to the keyring file. Lastly, we start the service.

sudo mkdir -p /var/lib/ceph/mds/ceph-n1
sudo ceph auth get-or-create mds.n1 mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *' | sudo tee /var/lib/ceph/mds/ceph-n1/keyring
sudo systemctl start ceph-mds@n1
@kalaspuffar
kalaspuffar / ceph-manual-install.md
Last active February 21, 2024 15:54
How to install a manual ceph cluster.

Manual install of a Ceph Cluster.

Fetching software.

First of I want to check that I have all the latest packages in my debian system.

apt update
apt upgrade
@kalaspuffar
kalaspuffar / ceph-cache-pool.md
Created September 26, 2021 14:48
Setting up a caching pool in your Ceph cluster.

Adding caching tier to your filesystem

First we need to check our pools and create a new cache pool.

sudo ceph osd lspools
sudo ceph osd pool create hot_storage 32

Next up we setup the pool as a tier for your data drive and change the mode to writeback which means that you first write to it before flushing it back to your slower drives. readproxy is better if you have the same kind of speed on your pools as it writes to the data drive and then adds entries to your cache pool when read often.

@kalaspuffar
kalaspuffar / autoclicker.java
Created September 21, 2021 03:44
Adding frame and event listener.
package org.ea;
import javax.swing.*;
import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class AutoClicker implements KeyListener {
static boolean enabled = false;
@kalaspuffar
kalaspuffar / ceph.conf.md
Last active September 20, 2021 03:34
Ceph configuration for windows
[global]
    log to stderr = true
    ; Uncomment the following in order to use the Windows Event Log
    log to syslog = true

    run dir = C:/ProgramData/ceph/out
    crash dir = C:/ProgramData/ceph/out

 ; Use the following to change the cephfs client log level
@kalaspuffar
kalaspuffar / reset.md
Last active November 4, 2023 02:46
I had to reset a ceph host that the OS broke on.

Reseting a Ceph Host after OS crash or failed update

Preparing cluster

First you need to set the cluster into a noout and norebalance mode in order to ensure that no data is moved around during the process. This is not super crucial but you could loose a lot of time moving data back and forth so it's a good practice.

ceph osd set noout
ceph osd set norebalance
@kalaspuffar
kalaspuffar / grafana-dashboard-install.md
Last active February 28, 2022 14:25
grafana-dashboard-install.md

NODE

sudo ceph mgr module enable prometheus
sudo ceph config set mgr mgr/prometheus/server_addr 0.0.0.0
sudo ceph config set mgr mgr/prometheus/server_port 9283
wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz
@kalaspuffar
kalaspuffar / wireguard.md
Last active January 4, 2024 15:56
How to setup wireguard tunnel

How to setup wireguard tunnel

Installation on both machines

echo 'deb http://ftp.debian.org/debian buster-backports main' | sudo tee /etc/apt/sources.list.d/buster-backports.list
sudo apt update
sudo apt install wireguard
# Import necessary modules
import mcpi.minecraft as minecraft
import mcpi.block as block
# Connect to Minecraft
mc = minecraft.Minecraft.create()
# Get the players position
pos = mc.player.getTilePos()

Working with docker and registry

First of we install the docker client, server and registry on our debian machine.

apt install docker docker.io docker-registry

The registry could be installed as a service in our docker cloud as well.

docker run -d -p 5000:5000 --restart=always --name registry registry:2