Initializing YSQL Segmentation fault

Hi, I was trying to initialize YSQL with this command:

YB_ENABLED_IN_POSTGRES=1 FLAGS_pggate_master_addresses={master addrs} {dir to initdb} -D {data dir} -U postgres

as the instruction from this page:

And I got this error:

The files belonging to this database system will be owned by user {user}.
This user must also own the server process.

In YugaByte DB, setting LC_COLLATE to C and all other locale settings to en_US.UTF-8 by default. Locale support will be enhanced as part of addressing database cluster will be initialized with locales
  CTYPE:    en_US.UTF-8
  TIME:     en_US.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory {dir to data} ... ok
creating subdirectories ... ok
selecting default max_connections ... 300
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... I1017 18:55:37.047904  5278] MemTracker: hard memory limit is 26.573807 GB
I1017 18:55:37.047967  5278] MemTracker: soft memory limit is 22.587736 GB
I1017 18:55:37.048357  5280] Starting to init ybclient
child process was terminated by signal 11: Segmentation faultcould not write to child process: Broken pipe
initdb: removing contents of data directory {dir to data}

Thank you!

And now it started to work again for no reasons…

Which version of YB are you using? You don’t need an explicit initdb step if you are using 2.0. Can you point to the doc link you are using - maybe something we need to update/correct in our docs? Thx a lot.

Hi @AndrewLiuRM,

It looks like this doc page still need to be updated to reflect the latest way to initialize YSQL.

From 2.0, we don’t need to run the command to initialize YSQL. Instead, while starting yb-master (, you can pass the gflag --enable_ysql=true and that will enable YSQL. It’s also more reliable and quicker than running the command.

Can you please try this approach and let us know? Meanwhile, we’ll work on updating that doc page!

Thank you for your reply! I’m trying to test it out but another problem came out : Initializing YSQL Failed to Initialize client: Timed out

Need to figure this out before proceeding. Thank you!

Just to make it clear, is it yb-master or yb-tserver you are referring to?

I had the --enable_ysql=true with yb-tserver but it doesn’t work until I run the initdb command.

I’m referring to yb-master: