# Keyspace with replication\_factor=1?

**URL:** <https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124>\
**Category:** General\
**Created:** [February 14, 2018, 10:20pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124 "2018-02-14T22:20:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hengestone](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/hengestone/32/46_2.png) [@hengestone](https://forum.yugabyte.com/u/hengestone)\
**Post date:** [February 14, 2018, 10:20pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124/1 "2018-02-14T22:20:19Z")

</div>

Hi there,

Trying to create a keyspace with replication factor=1 seems to change the value to 3:  
`cqlsh> CREATE KEYSPACE myapp WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = false;`

Then **Describe** gives:

`cqlsh> describe myapp;`  
`CREATE KEYSPACE myapp WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true;`

Any ideas?  
Thanks!

---

<div class="post-metadata">

**Author:** ![karthik](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/karthik/32/13_2.png) [@karthik](https://forum.yugabyte.com/u/karthik)\
**Post date:** [February 14, 2018, 10:25pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124/2 "2018-02-14T22:25:32Z")

</div>

Hi @hengestone,

Looked into this, you are right that we currently ignore the replication\_factor directive. Do you mind opening an issue: [Issues · yugabyte/yugabyte-db · GitHub](https://github.com/YugaByte/yugabyte-db/issues)

As a work around, could you please create a cluster with replication factor 1? That would switch the default replication factor to 1. If you are using `yb-ctl` then you can do the following:  
`./bin/yb-ctl --replication_factor 1`  
Similar to this tutorial: [https://docs.yugabyte.com/preview/architecture/docdb-sharding/sharding/](https://docs.yugabyte.com/preview/explore/linear-scalability/sharding-data/)

---

<div class="post-metadata">

**Author:** ![hengestone](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/hengestone/32/46_2.png) [@hengestone](https://forum.yugabyte.com/u/hengestone)\
**Post date:** [February 14, 2018, 10:30pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124/3 "2018-02-14T22:30:24Z")

</div>

Thanks for the quick response 🙂

Sure, I’ll open an issue. If I create the cluster with rf=1 creating a table fails with  
`Not enough live tablet servers to create table with the requested replication factor 3. 1 tablet servers are alive. `

---

<div class="post-metadata">

**Author:** ![bogdan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/bogdan/32/111_2.png) [@bogdan](https://forum.yugabyte.com/u/bogdan)\
**Post date:** [February 14, 2018, 10:51pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124/4 "2018-02-14T22:51:09Z")

</div>

Hey @hengestone! Jumping in real quick as I think there’s a small misunderstanding.

We currently ignore the options on CREATE KEYSPACE and default to internal flags on yb-master for setting up the replication factor ([yb-master configuration reference | YugabyteDB Docs](https://docs.yugabyte.com/stable/reference/configuration/yb-master/#replication-factor), check `--replication_factor`, which defaults to 3, hence what you’re noticing)

I also am not sure how you’re starting up the cluster though. Is it possible that you’re doing it manually using the respective yb-master/yb-tserver binaries?

The recommended route would be using the `bin/yb-ctl` python script, which would take care of both setting up the needed number of master/tservers, as well as flowing through custom flags (such as `--replication_factor`).

As per @karthik’s suggestion, try using `./bin/yb-ctl --replication_factor 1 create` , then confirm that it’s up and running using `./bin/yb-ctl status` and then you’re good to login and create your keyspaces/tables.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![hengestone](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/hengestone/32/46_2.png) [@hengestone](https://forum.yugabyte.com/u/hengestone)\
**Post date:** [February 14, 2018, 11:01pm UTC](https://forum.yugabyte.com/t/keyspace-with-replication-factor-1/124/5 "2018-02-14T23:01:15Z")

</div>

You’re right, I previously started the master/tservers manually (via systemd)

Thanks!
