Yugabytedb using conf files

I have custom volumes for data, log and wal on my EC2 instance, and want to run the master and tserver on the same instance to start. I can run each manually but cannot get new databases created.
I want to try using yugabytedb start but want to use the conf fles (master & tserver) i have instead of a long list of command flags.
my manual commands are:

./bin/yb-master --flagfile /home/ubuntu/yb_conf/master.conf >& /dblog/master/yb-master.out &

./bin/yb-tserver --flagfile /home/ubuntu/yb_conf/tserver.conf >& /dblog/tserver/yb-tserver.out &

Can I amend the yugabytedb start command to run the cluster and use those conf fliles? I can’t find doc reference to doing so.

Hi Felix_te
I have found something on github
Please take a look if it can help you

master.conf ( /home//yugabyte-2.18.2.1/master.conf):

–master_addresses=192.168.11.91:7100,192.168.11.14:7100,192.168.11.101:7100
–rpc_bind_addresses=192.168.11.91:7100 #IP of current server here
–fs_data_dirs=/media/yugabyte
–placement_cloud=fcmsk
–placement_region=fcmsk-len91 #miner’s hostname here
–placement_zone=len91 #hostname
tserver.conf (/home//yugabyte-2.18.2.1/tserver.conf)

–tserver_master_addrs=192.168.11.91:7100,192.168.11.14:7100,192.168.11.101:7100
–rpc_bind_addresses=192.168.11.91:9100 #IP of current server here
–enable_ysql
–pgsql_proxy_bind_address=192.168.11.91:5433 #IP of current server here
–cql_proxy_bind_address=192.168.11.91:9042 #IP of current server here
–fs_data_dirs=/media/yugabyte
–placement_cloud=fcmsk
–placement_region=fcmsk-len91 #miner’s hostname here
–placement_zone=len91 #hostname
systemd units files:

YB-Master:

sudo nano /etc/systemd/system/yb-master.service

Description=YB-Master
After=network-online.target
Requires=network-online.target

[Service]
ExecStart=/home//yugabyte-2.18.2.1/bin/yb-master --flagfile /home//yugabyte-2.18.2.1/master.conf
Restart=always
RestartSec=5
TimeoutStartSec=20
TimeoutStopSec=20
User=
Group=<user’s group>
Type=simple

LimitCPU=infinity
LimitFSIZE=infinity
LimitDATA=infinity
LimitSTACK=8388608
LimitCORE=infinity
LimitRSS=infinity
LimitNOFILE=1048576
LimitAS=infinity
LimitNPROC=12000
LimitMEMLOCK=64
LimitLOCKS=infinity
LimitSIGPENDING=119934
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
sudo systemctl restart yb-master
sudo systemctl enable yb-master

YB-TServer:

sudo nano /etc/systemd/system/yb-tserver.service

Description=YB-TServer
After=network-online.target
After=yb-master.service
Requires=network-online.target
Requires=yb-master.service

[Service]
ExecStart=/home//yugabyte-2.18.2.1/bin/yb-tserver --flagfile /home//yugabyte-2.18.2.1/tserver.conf
Restart=always
RestartSec=5
TimeoutStartSec=20
TimeoutStopSec=20
User=
Group=<user’s group>
Type=simple

LimitCPU=infinity
LimitFSIZE=infinity
LimitDATA=infinity
LimitSTACK=8388608
LimitCORE=infinity
LimitRSS=infinity
LimitNOFILE=1048576
LimitAS=infinity
LimitNPROC=12000
LimitMEMLOCK=64
LimitLOCKS=infinity
LimitSIGPENDING=119934
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
sudo systemctl start yb-tserver
sudo systemctl enable yb-tserver

Thanks - that will come in handy for the systemd service.
Unfortunately that still runs both separately. I was hoping to run yugabytedb start command to run the cluster and test db creation. When running separately as that shows, something is not initializing correctly and i am getting the error:
error: table system.transactions not found :object_not_found
I’ve set the replication factor to 1 manually via command, but still have the error, so wanted to try via the other command - yugabytedb start

Hi felix
If you want to use single command to start both master and t-server
You can try yubygated , it will do it for you

Hi, if you want to use yugabyted you can use your flag files like this:

yugabyted start --master_flags=flagfile=/home/ubuntu/yb_conf/master.conf --tserver_flags=flagfile=/home/ubuntu/yb_conf/tserver.conf

But be careful that some flags must not be passed there because they are set by yugabyted. For example --rpc_bind_addresses and --server_broadcast_addresses are set by yugabyted --advertise_address

Perfect thank you! This was the combination I was looking for. The PID and other misc files still go to the ubuntu/var but the data and other redirected content seem to be in the right place.
Unfortunately I’m still getting the error on db create:

yugabyte=# CREATE DATABASE yb_demo;
ERROR:  Table system.transactions not found: OBJECT_NOT_FOUND

Any ideas what to check there? It seems the system db is not accessible or was not created or some tables are missing.

Also - the info screen on the console still shows the default storage locations - so it appears to not reflect the conf changes:
|
| Data Dir : /home/ubuntu/var/data |
| Log Dir : /home/ubuntu/var/logs

The create db error was due to missing the replication factor being set. All good now

1 Like

Great. I think the default is replication factor 3, so if you start a single node, I guess it waits for the quorum to create the transaction tablets.