sysadmin:index
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
sysadmin:index [2019/11/19 09:04] – Appunto su partizionamento base nuovo server feroda | sysadmin:index [2021/12/27 22:29] – Creazione nuovi certificati con acme.sh feroda | ||
---|---|---|---|
Line 200: | Line 200: | ||
Utilizza una interfaccia a riga di comando. | Utilizza una interfaccia a riga di comando. | ||
+ | |||
+ | La prima volta di fare il primo commit con git: | ||
+ | |||
+ | git config --global user.name " | ||
+ | git config --global user.email " | ||
+ | |||
+ | Tale configurazione consentirà di applicare correttamente nome ed email dell' | ||
== Comandi base == | == Comandi base == | ||
- | git init - Crea un repository Git vuoto o reinizializza uno esistente | + | Se si è creata una directory e la si vuole far diventare |
- | git log permette di tenere traccia delle nostre versioni. | + | git init |
+ | |||
+ | Una volta fatte le modifiche: | ||
- | git checkout + codice univoco | + | git add |
| | ||
- | git checkout master ti riporta al ramo principale | + | Indica a Git che si desidera includere gli aggiornamenti di un determinato file nel prossimo commit. Le modifiche vengono effettivamente registrate nel repository locale dopo che viene eseguito il comando |
- | git add Indica a Git che si desidera includere gli aggiornamenti di un determinato file nel prossimo | + | git commit |
- | commit. Tuttavia le modifiche non vengono effettivamente registrate fino a quando non si esegue git | + | |
- | | + | |
- | git status permette | + | Per vedere la traccia |
- | git commit viene utilizzato per salvare le modifiche nel repository locale | + | git log |
- | === Creazione di un nuovo server === | + | Per vedere i file aggiunti/ |
- | We need LVM setup. Here is a proposal: | + | git status |
- | ``` | + | |
+ | Per spostarsi "nel tempo e nello spazio", | ||
+ | |||
+ | git checkout <codice hash del commit> | ||
+ | |||
+ | Per rispostarsi alla versione " | ||
+ | |||
+ | git checkout master | ||
+ | |||
+ | |||
+ | ===== Esportazione cartelle sul nextcloud con occ dal terminale ===== | ||
+ | |||
+ | Questo comando ti mostra la lista completa di tutte le cartelle condivise su nextcloud. | ||
+ | |||
+ | sudo -u apache / | ||
+ | |||
+ | |||
+ | ===Per aggiungere una cartella condivisa si usa files_external: | ||
+ | |||
+ | esempio: | ||
+ | sudo -u apache / | ||
+ | |||
+ | " | ||
+ | |||
+ | password: qui va inserito il tipo di autenticazione | ||
+ | |||
+ | ===Per vedere che tipi di autenticazioni sono supportati digitare questo comando=== | ||
+ | |||
+ | sudo -u apache / | ||
+ | |||
+ | -c: ti permette di aggiungere più valori | ||
+ | |||
+ | host: l'url del server Samba | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | sudo -u apache / | ||
+ | |||
+ | | ||
+ | |||
+ | === Per cancellare una configurazione usare il comando === | ||
+ | |||
+ | sudo -u apache / | ||
+ | |||
+ | |||
+ | ===== Ridimensionare una partizione LVM ===== | ||
+ | |||
+ | LVM - Logical Volume Manager consente di gestire in modo logico le partizioni. Questo vuol dire che le partizioni si possono ridimensionare al bisogno. È più facile ingrandirle che ridurle, però si può fare. | ||
+ | |||
+ | Ora vi elenco le componenti base: | ||
+ | |||
+ | - **pv**: Physical Volume, sono i dispositivi a blocchi partizioni/ | ||
+ | - **vg**: Volume Group, sono i gruppi di **pv** hanno un nome. Rappresentano "il mucchio" | ||
+ | - **lv**: Logical Volume, sono le partizioni create dentro i **vg** e sono queste che vengono formattate con il filesystem, ad esempio '' | ||
+ | |||
+ | ==== Ridimensionare un Logical Volume perché esaurito lo spazio ==== | ||
+ | |||
+ | Questo è il caso critico più frequente che quindi ci interessa descrivere qui. Spazio esaurito, come si affronta con LVM? Semplice! | ||
+ | |||
+ | - Visualizzo i blocchi non allocati nel Volume Group con il comando '' | ||
+ | - Ridimensiono il Logical Volume corrispondente con '' | ||
+ | - Estendo la partizione che nel caso di '' | ||
+ | |||
+ | === Esempio === | ||
+ | |||
+ | Spazio esaurito su server database: | ||
+ | |||
+ | < | ||
+ | postgres@T-FTSQL01: | ||
+ | Filesystem | ||
+ | udev | ||
+ | tmpfs 1.6G | ||
+ | / | ||
+ | tmpfs 7.9G 8.0K 7.9G 1% /dev/shm | ||
+ | tmpfs 5.0M | ||
+ | tmpfs 7.9G | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | tmpfs 1.6G | ||
+ | </ | ||
+ | |||
+ | In questo caso il device è identificato da ''/ | ||
+ | |||
+ | NOTA: il volume group si chiama '' | ||
+ | |||
+ | Quindi guardo i blocchi disponibili con '' | ||
+ | |||
+ | < | ||
+ | root@T-FTSQL01:/ | ||
+ | --- Volume group --- | ||
+ | VG Name | ||
+ | System ID | ||
+ | Format | ||
+ | Metadata Areas 1 | ||
+ | Metadata Sequence No 2 | ||
+ | VG Access | ||
+ | VG Status | ||
+ | MAX LV 0 | ||
+ | Cur LV 1 | ||
+ | Open LV 1 | ||
+ | Max PV 0 | ||
+ | Cur PV 1 | ||
+ | Act PV 1 | ||
+ | VG Size < | ||
+ | PE Size 4,00 MiB | ||
+ | Total PE 127999 | ||
+ | Alloc PE / Size | ||
+ | Free PE / Size 25599 / <100,00 GiB | ||
+ | VG UUID | ||
+ | |||
+ | --- Volume group --- | ||
+ | VG Name vg | ||
+ | System ID | ||
+ | Format | ||
+ | Metadata Areas 1 | ||
+ | Metadata Sequence No 4 | ||
+ | VG Access | ||
+ | VG Status | ||
+ | MAX LV 0 | ||
+ | Cur LV 3 | ||
+ | Open LV 3 | ||
+ | Max PV 0 | ||
+ | Cur PV 1 | ||
+ | Act PV 1 | ||
+ | VG Size < | ||
+ | PE Size 4,00 MiB | ||
+ | Total PE 20479 | ||
+ | Alloc PE / Size 10942 / 42,74 GiB | ||
+ | Free PE / Size 9537 / 37,25 GiB | ||
+ | VG UUID | ||
+ | </ | ||
+ | |||
+ | Poi ridimensiono con '' | ||
+ | |||
+ | < | ||
+ | root@T-FTSQL01:/ | ||
+ | Size of logical volume vg-data/db changed from 400,00 GiB (102400 extents) to 420,00 GiB (107520 extents). | ||
+ | Logical volume vg-data/db successfully resized. | ||
+ | root@T-FTSQL01:/ | ||
+ | resize2fs 1.44.5 (15-Dec-2018) | ||
+ | Filesystem at / | ||
+ | old_desc_blocks = 50, new_desc_blocks = 53 | ||
+ | The filesystem on / | ||
+ | </ | ||
+ | |||
+ | Ultimo passo fondamentale: | ||
+ | |||
+ | < | ||
+ | root@T-FTSQL01:/ | ||
+ | Filesystem | ||
+ | udev | ||
+ | tmpfs 1,6G | ||
+ | / | ||
+ | tmpfs 7,9G 8,0K 7,9G 1% /dev/shm | ||
+ | tmpfs 5,0M | ||
+ | tmpfs 7,9G | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | tmpfs 1,6G | ||
+ | </ | ||
+ | |||
+ | ==== Esempio di creazione partizioni per un nuovo server ==== | ||
+ | |||
+ | < | ||
20GB / | 20GB / | ||
5GB / | 5GB / | ||
50GB / | 50GB / | ||
- | ``` | + | </ |
remaining disk blocks could be unpartitioned to allow LVM partition resizing on demand. | remaining disk blocks could be unpartitioned to allow LVM partition resizing on demand. | ||
- | In order to achieve this goal you have to create a volume group (VG): | + | In order to achieve this goal you have to create a volume group (VG) '' |
- | * `hosting` bound to /dev/sda | + | |
+ | |||
+ | ===== Installazioni nuovi certificati con acme.sh ===== | ||
+ | |||
+ | |||
+ | acme.sh --issue --standalone -d example.org | ||
+ | mkdir -p / | ||
+ | acme.sh --install-cert -d example.org --cert-file / | ||
- |
sysadmin/index.txt · Last modified: 2022/06/16 09:00 by feroda