# About the Replication Factor of YugabyteDB running with Docker Compose

**URL:** <https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480>\
**Category:** General\
**Created:** [June 5, 2025, 3:38am UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480 "2025-06-05T03:38:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ytooyama](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@ytooyama](https://forum.yugabyte.com/u/ytooyama)\
**Post date:** [June 5, 2025, 3:38am UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480/1 "2025-06-05T03:38:28Z")

</div>

I truly appreciate your continued efforts in providing such convenient and helpful software.

After launching the cluster using the following Docker Compose manifest, I have observed that executing docker compose exec yugabyte1 yugabyted status does not always return consistent results; the reported replication factor is sometimes recognized as 1 and at other times as 3.

```yaml
services:
  yugabyte1:
    image: software.yugabyte.com/yugabytedb/yugabyte:2.25.2.0-b359
    restart: unless-stopped
    command: bin/yugabyted start --advertise_address=yugabyte1 --base_dir=/root/var/ --background=false --cloud_location=cloud1.red.rack1
    ports:
      - "15433:15433"
      - "5433:5433"
      #- "7003:7000"
      #- "9003:9000"
    healthcheck:
      test: ["CMD", "/home/yugabyte/postgres/bin/pg_isready", "-h", "yugabyte1"]
      interval: 30s
      timeout: 30s
      retries: 5
      start_period: 30s
    volumes:
      - yugabyte1-vol:/root/var/
    networks:
      - yugaplus-network

  yugabyte2:
    image: software.yugabyte.com/yugabytedb/yugabyte:2.25.2.0-b359
    depends_on:
      yugabyte1:
        condition: service_healthy
    restart: unless-stopped
    command: bin/yugabyted start --advertise_address=yugabyte2 --join=yugabyte1 --base_dir=/root/var/ --background=false --cloud_location=cloud1.red.rack2
    ports:
      - "5434:5433"
    volumes:
      - yugabyte2-vol:/root/var/
    networks:
      - yugaplus-network

  yugabyte3:
    image: software.yugabyte.com/yugabytedb/yugabyte:2.25.2.0-b359
    depends_on:
      yugabyte1:
        condition: service_healthy
    restart: unless-stopped
    command: bin/yugabyted start --advertise_address=yugabyte3 --join=yugabyte1 --base_dir=/root/var/ --background=false --cloud_location=cloud1.red.rack3
    ports:
      - "5435:5433"
    volumes:
      - yugabyte3-vol:/root/var/
    networks:
      - yugaplus-network

  yugabyte4:
    image: software.yugabyte.com/yugabytedb/yugabyte:2.25.2.0-b359
    depends_on:
      yugabyte1:
        condition: service_healthy
    restart: unless-stopped
    command: bin/yugabyted start --advertise_address=yugabyte4 --join=yugabyte1 --base_dir=/root/var/ --background=false --cloud_location=cloud1.red.rack4
    ports:
      - "5436:5433"
    volumes:
      - yugabyte4-vol:/root/var/
    networks:
      - yugaplus-network

volumes:
  yugabyte1-vol:
  yugabyte2-vol:
  yugabyte3-vol:
  yugabyte4-vol:

networks:
  yugaplus-network:
    external: true

```

When I enter the shell and change the replication factor, it is usually updated successfully; however, in rare cases, the process crashes. Is there something I might be overlooking? For your reference, I normally run the system with 8 or 12 containers—this is merely a minimal configuration example.

```shell
% docker compose exec yugabyte1 yugabyted configure data_placement --rf 3 --base_dir=/root/var
^CTraceback (most recent call last):
  File "/usr/local/bin/yugabyted", line 11054, in <module>
    ControlScript().run()
  File "/usr/local/bin/yugabyted", line 8784, in run
    args.func()
  File "/usr/local/bin/yugabyted", line 2305, in configure_data_placement
    new_masters = self.get_new_valid_masters(current_masters_without_port_list,
  File "/usr/local/bin/yugabyted", line 4838, in get_new_valid_masters
    for location, master_list in ft_locations_to_masters_map.items():
KeyboardInterrupt

```

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [June 5, 2025, 7:06am UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480/2 "2025-06-05T07:06:30Z")

</div>

> [@ytooyama](#):
>
> `KeyboardInterrupt`

Hi @ytooyama

Looks like it stalls and then you stop it, correct?

What version are you using?

Can you do a `yugabyted collect_logs --base_dir=/root/var/` on the yb-master leader?

---

<div class="post-metadata">

**Author:** ![ytooyama](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@ytooyama](https://forum.yugabyte.com/u/ytooyama)\
**Post date:** [June 5, 2025, 8:09am UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480/3 "2025-06-05T08:09:13Z")

</div>

The following versions are used.  
yugabyte:2.25.2.0-b359

And…The log has been uploaded.

> **[yugabyted-2025-06-05-07h52m36.298154s.tar.gz](https://drive.google.com/file/d/1NvGbxs0SHV_Zkc3rCeTsq50aO0l--Nvw/view?usp=drive_link)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [June 12, 2025, 10:22am UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480/4 "2025-06-12T10:22:16Z")

</div>

cc @nmalladi if you’ve seen this type of setup/issue before

---

<div class="post-metadata">

**Author:** ![nmalladi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/nmalladi/32/236_2.png) [@nmalladi](https://forum.yugabyte.com/u/nmalladi)\
**Post date:** [June 13, 2025, 1:42pm UTC](https://forum.yugabyte.com/t/about-the-replication-factor-of-yugabytedb-running-with-docker-compose/4480/5 "2025-06-13T13:42:06Z")

</div>

@ytooyama I will go over the logs today and get back to you. Thanks
