Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when trying to setup Postgresql on Vagrant for development testing #620

Open
robly opened this issue Nov 30, 2018 · 0 comments
Open
Assignees
Labels
kind/bug This issue is a bug kind/question This is a question
Projects

Comments

@robly
Copy link

robly commented Nov 30, 2018

We ran into a few problems, which I can try and list.

1: The vagrant user was not found when ./bin/yb-ctl --enable_postgres was run
initdb: could not look up effective user ID 1000: user does not exist
To fix: export YB_PG_FALLBACK_SYSTEM_USER_NAME='vagrant'

2: There is no way to access it from outside the local loopback which is a problem
To fix:
#Edit yb-ctl

Change the loopback to your vagrant machines IP

def get_local_ip(index):
return "YOUR HOST IP HERE".format(index)

Change init_if_necessary to include ‘--no-locale’

Eg: initdb_cmd_line = [
os.path.join(self.bin_dir, 'initdb'),
'-U',
'postgres',
'--no-locale'
]

Then to enable remote access to the DB

Edit the config for remote access

nano /home/vagrant/data/node-1/disk-1/yb-data/postgres/postgresql.conf
listen_addresses = '*'

Edit the pg_hba.conf so you can connect

nano /home/vagrant/data/node-1/disk-1/yb-data/postgres/pg_hba.conf
host all all 0.0.0.0/0 trust
0.0.0.0/0 could also be a specific host but since this is locally running on vagrant with no remote access outside the host machine itself we made it easy.

@kmuthukk kmuthukk added kind/question This is a question kind/bug This issue is a bug labels Dec 1, 2018
@kmuthukk kmuthukk added this to To do in YSQL via automation Dec 1, 2018
@ndeodhar ndeodhar moved this from To do to Backlog in YSQL Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug kind/question This is a question
Projects
Status: No status
YSQL
  
Backlog
Development

No branches or pull requests

3 participants