forked from vitalif/vitastor
Add notes about the new script
parent
9c30df83e3
commit
0edc6fe5a6
|
@ -414,7 +414,14 @@ Vitastor с однопоточной NBD прокси на том же стен
|
||||||
"osd_network": "10.200.1.0/24"
|
"osd_network": "10.200.1.0/24"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
- Создайте юниты systemd для OSD: `/usr/lib/vitastor/make-osd.sh /dev/disk/by-partuuid/XXX [/dev/disk/by-partuuid/YYY ...]`
|
- Инициализуйте OSD:
|
||||||
|
- SSD: `/usr/lib/vitastor/make-osd.sh /dev/disk/by-partuuid/XXX [/dev/disk/by-partuuid/YYY ...]`
|
||||||
|
- Гибридные, HDD+SSD: `/usr/lib/vitastor/mon/make-osd-hybrid.js /dev/sda /dev/sdb ...` - передайте
|
||||||
|
все ваши SSD и HDD скрипту в командной строке подряд, скрипт автоматически выделит разделы под
|
||||||
|
журналы на SSD и данные на HDD. Скрипт пропускает HDD, на которых уже есть разделы
|
||||||
|
или вообще какие-то данные, поэтому если диски непустые, сначала очистите их с помощью
|
||||||
|
`wipefs -a`. SSD с таблицей разделов не пропускаются, но так как скрипт создаёт новые разделы
|
||||||
|
для журналов, на SSD должно быть доступно свободное нераспределённое место.
|
||||||
- Вы можете менять параметры OSD в юнитах systemd или в `vitastor.conf`. Смысл некоторых параметров:
|
- Вы можете менять параметры OSD в юнитах systemd или в `vitastor.conf`. Смысл некоторых параметров:
|
||||||
- `disable_data_fsync 1` - отключает fsync, используется с SSD с конденсаторами.
|
- `disable_data_fsync 1` - отключает fsync, используется с SSD с конденсаторами.
|
||||||
- `immediate_commit all` - используется с SSD с конденсаторами.
|
- `immediate_commit all` - используется с SSD с конденсаторами.
|
||||||
|
|
|
@ -367,7 +367,13 @@ and calculate disk offsets almost by hand. This will be fixed in near future.
|
||||||
"osd_network": "10.200.1.0/24"
|
"osd_network": "10.200.1.0/24"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
- Create systemd units for your OSDs: `/usr/lib/vitastor/mon/make-osd.sh /dev/disk/by-partuuid/XXX [/dev/disk/by-partuuid/YYY ...]`
|
- Initialize OSDs:
|
||||||
|
- Simplest, SSD-only: `/usr/lib/vitastor/mon/make-osd.sh /dev/disk/by-partuuid/XXX [/dev/disk/by-partuuid/YYY ...]`
|
||||||
|
- Hybrid, HDD+SSD: `/usr/lib/vitastor/mon/make-osd-hybrid.js /dev/sda /dev/sdb ...` - pass all your
|
||||||
|
devices (HDD and SSD) to this script - it will partition disks and initialize journals on its own.
|
||||||
|
This script skips HDDs which are already partitioned so if you want to use non-empty disks for
|
||||||
|
Vitastor you should first wipe them with `wipefs -a`. SSDs with GPT partition table are not skipped,
|
||||||
|
but some free unpartitioned space must be available because the script creates new partitions for journals.
|
||||||
- You can change OSD configuration in units or in `vitastor.conf`. Notable configuration variables:
|
- You can change OSD configuration in units or in `vitastor.conf`. Notable configuration variables:
|
||||||
- `disable_data_fsync 1` - only safe with server-grade drives with capacitors.
|
- `disable_data_fsync 1` - only safe with server-grade drives with capacitors.
|
||||||
- `immediate_commit all` - use this if all your drives are server-grade.
|
- `immediate_commit all` - use this if all your drives are server-grade.
|
||||||
|
|
|
@ -25,6 +25,10 @@ OPT=$(vitastor-cli simple-offsets --format options $DEV | tr '\n' ' ')
|
||||||
META=$(vitastor-cli simple-offsets --format json $DEV | jq .data_offset)
|
META=$(vitastor-cli simple-offsets --format json $DEV | jq .data_offset)
|
||||||
dd if=/dev/zero of=$DEV bs=1048576 count=$(((META+1048575)/1048576)) oflag=direct
|
dd if=/dev/zero of=$DEV bs=1048576 count=$(((META+1048575)/1048576)) oflag=direct
|
||||||
|
|
||||||
|
mkdir -p /var/log/vitastor
|
||||||
|
id vitastor &>/dev/null || useradd vitastor
|
||||||
|
chown vitastor /var/log/vitastor
|
||||||
|
|
||||||
cat >/etc/systemd/system/vitastor-osd$OSD_NUM.service <<EOF
|
cat >/etc/systemd/system/vitastor-osd$OSD_NUM.service <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Vitastor object storage daemon osd.$OSD_NUM
|
Description=Vitastor object storage daemon osd.$OSD_NUM
|
||||||
|
@ -36,14 +40,14 @@ PartOf=vitastor.target
|
||||||
LimitNOFILE=1048576
|
LimitNOFILE=1048576
|
||||||
LimitNPROC=1048576
|
LimitNPROC=1048576
|
||||||
LimitMEMLOCK=infinity
|
LimitMEMLOCK=infinity
|
||||||
ExecStart=/usr/bin/vitastor-osd \\
|
ExecStart=bash -c '/usr/bin/vitastor-osd \\
|
||||||
--osd_num $OSD_NUM \\
|
--osd_num $OSD_NUM \\
|
||||||
--disable_data_fsync 1 \\
|
--disable_data_fsync 1 \\
|
||||||
--immediate_commit all \\
|
--immediate_commit all \\
|
||||||
--disk_alignment 4096 --journal_block_size 4096 --meta_block_size 4096 \\
|
--disk_alignment 4096 --journal_block_size 4096 --meta_block_size 4096 \\
|
||||||
--journal_no_same_sector_overwrites true \\
|
--journal_no_same_sector_overwrites true \\
|
||||||
--journal_sector_buffer_count 1024 \\
|
--journal_sector_buffer_count 1024 \\
|
||||||
$OPT
|
$OPT >>/var/log/vitastor/osd$OSD_NUM.log 2>&1'
|
||||||
WorkingDirectory=/
|
WorkingDirectory=/
|
||||||
ExecStartPre=+chown vitastor:vitastor $DEV
|
ExecStartPre=+chown vitastor:vitastor $DEV
|
||||||
User=vitastor
|
User=vitastor
|
||||||
|
|
Loading…
Reference in New Issue