# Separating logs on its own HDD

**URL:** <https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597>\
**Category:** Using FoundationDB\
**Created:** [August 27, 2019, 8:08pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597 "2019-08-27T20:08:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasJ](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@ThomasJ](https://forums.foundationdb.org/u/ThomasJ)\
**Post date:** [August 27, 2019, 8:08pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/1 "2019-08-27T20:08:00Z")

</div>

I might be missing something but I’m not getting the behavior I’ve expected.

Based on [an advice](https://forums.foundationdb.org/t/warning-a-single-process-is-both-a-transaction-log-and-a-storage-server/1580/8). I separated storage and logs into separate hard drives. At least that’s what I thought I did, but FDB is reporting something else and that means I didn’t do it well.

From my `foundationdb.conf`

```auto
datadir = /var/lib/foundationdb/data/$ID
logdir = /var/log/foundationdb
logsize = 50MiB

```

```auto
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
└─sda1 8:1 0 30G 0 part /
nvme0n1 259:0 0 375G 0 disk
└─md0 9:0 0 1.1T 0 raid0 /var/lib/foundationdb/data
nvme0n2 259:1 0 375G 0 disk
└─md0 9:0 0 1.1T 0 raid0 /var/lib/foundationdb/data
nvme0n3 259:2 0 375G 0 disk
└─md0 9:0 0 1.1T 0 raid0 /var/lib/foundationdb/data
nvme0n4 259:3 0 375G 0 disk /var/log/foundationdb

```

However when looking at the stats

```auto
Operating space:
  Storage server - 939.9 GB free on most full server
  Log server - 939.9 GB free on most full server

```

Somehow the log server is still pointing to the same disk. That also means the `/var/log/` is most likely just an output log not the log I’m looking for.

So is there a way to separate the log into a separate HDD?

---

<div class="post-metadata">

**Author:** ![markus.pilman](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/markus.pilman/32/379_2.png) [@markus.pilman](https://forums.foundationdb.org/u/markus.pilman)\
**Post date:** [August 27, 2019, 8:14pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/2 "2019-08-27T20:14:10Z")

</div>

With log being on a different disk, the advise refers to the fdbserver processes running the tlog role. The `logdir` option in `foundationdb.conf` however is for trace files. Naming is hard and our naming is not always great (and tlog, log, trace, logging etc are kind of confusing).

What you want to do is to have a second process, add a `datadir` argument to this process that is on a different disk and assign it the log class.

---

<div class="post-metadata">

**Author:** ![ThomasJ](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@ThomasJ](https://forums.foundationdb.org/u/ThomasJ)\
**Post date:** [August 27, 2019, 8:19pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/3 "2019-08-27T20:19:32Z")

</div>

> [@markus.pilman](#):
>
> With log being on a different disk, the advise refers to the fdbserver processes running the tlog role. The `logdir` option in `foundationdb.conf` however is for trace files. Naming is hard and our naming is not always great (and tlog, log, trace, logging etc are kind of confusing).

I figured It has to be that.

> [@markus.pilman](#):
>
> What you want to do is to have a second process, add a `datadir` argument to this process that is on a different disk and assign it the log class.

So how does this is exactly looks like? Is this correct?

```auto
[fdbserver.4500]
class=log
datadir = /var/lib/foundationdb/tlog

```

---

<div class="post-metadata">

**Author:** ![markus.pilman](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/markus.pilman/32/379_2.png) [@markus.pilman](https://forums.foundationdb.org/u/markus.pilman)\
**Post date:** [August 27, 2019, 8:22pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/4 "2019-08-27T20:22:09Z")

</div>

I think this is correct. You ned at least two processes though (otherwise fdb will run a storage there).

---

<div class="post-metadata">

**Author:** ![ThomasJ](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@ThomasJ](https://forums.foundationdb.org/u/ThomasJ)\
**Post date:** [August 27, 2019, 9:23pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/5 "2019-08-27T21:23:42Z")

</div>

I actually have four

```auto
[fdbserver.4500]
class=log
[fdbserver.4501]
class=storage
[fdbserver.4502]
class=storage
[fdbserver.4503]
class=stateless

```

Just was curious about the setting

---

<div class="post-metadata">

**Author:** ![markus.pilman](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/markus.pilman/32/379_2.png) [@markus.pilman](https://forums.foundationdb.org/u/markus.pilman)\
**Post date:** [August 27, 2019, 9:25pm UTC](https://forums.foundationdb.org/t/separating-logs-on-its-own-hdd/1597/6 "2019-08-27T21:25:21Z")

</div>

Ok, just wanted to be sure. This looks correct to me
