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

Improve Documentation #42

Open
khurramnaseem opened this issue Nov 8, 2016 · 8 comments
Open

Improve Documentation #42

khurramnaseem opened this issue Nov 8, 2016 · 8 comments

Comments

@khurramnaseem
Copy link

khurramnaseem commented Nov 8, 2016

Hi,

I'm not seeing any detail configuration steps for this tool, I've updated following file

/home/ec2-user/shift/ui/config/database.yml

with local mysql credentials (but no host name) same EC2 where Shift is installed, I also update config.x.mysql_helper.db_config paramter with username & password in following file.

/home/ec2-user/shift/ui/config/environments/development.rb

now after run following command

"bundle exec rake db:setup"

and run server by issuing follwoing command

RAILS_ENV=production
rails server -b 0.0.0.0 -p 3000

I see databases in database drop down. Do I need to install Shift on same machine where my staging DB is located or how can I connect it to remote mysql host ? In my case its RDS.

Thank you

@khurramnaseem khurramnaseem changed the title No Documentation Improve Documentation Nov 9, 2016
@michaelfinch
Copy link
Collaborator

michaelfinch commented Nov 9, 2016

Hey, sorry that the documentation isn't clear, I'll try to update it after we get this sorted out.

The credentials that you set in config.x.mysql_helper.db_config need to be credentials that have access to connect to all of your remote databases. So in this case, it sounds like they need to be able to access your staging db. Shift does not need to run on the same host as your staging db as long as these credentials can connect to it.

Next, you need to add your staging db as a "cluster" in shift. To do that, follow the instructions listed here: https://github.com/square/shift/blob/master/ui/README.md#adding-clusters-and-owners. The cluster you will be inserting will be called something along the lines of "staging", and it will have the hostname and port that your staging db is running at. Again, the credentials set in set in config.x.mysql_helper.db_config are what will be used to connect to any "clusters". After you add your staging cluster, it should show up in the Cluster dropdown, and then if you select it, all of it's dbs should show up in the Database dropdown

Happy to walk you through this on skype or slack as well, just let me know

@khurramnaseem
Copy link
Author

Hey ,

Thank you! This helps me, now it list RDS instance databases but now I see following error

DDL statement is invalid (error: table is referenced by foreign keys).
What is this for "pr url" I put same mention in demo i.e. "github.com\pr" ?

How can I share my Skype ID with you? I do not want to write here :)

Thank you

@khurramnaseem
Copy link
Author

Regarding "config.x.mysql_helper.db_config" the documentation said on this page
https://github.com/square/shift/blob/master/ui/README.md#adding-clusters-and-owners

"here you must supply a set of database credentials that has read-only access to all of your clusters"

So how it will run DDL with read only user ?

@khurramnaseem
Copy link
Author

ok
config/database.yml is for shift database and config.x.mysql_helper.db_config is to define database credentials where you want to run "alter" according to file, but I only see "shift_development" & "shift_test" how I'll add "shift_prodcution" database in my shift DB and I guess after add "shift_prodcution" and create same schema(tables) as it has on "shift_development" or "shift_test" I've to run following insert's , correct ?

insert into clusters (name, app, rw_host, port, admin_review_required, is_staging)
values ('prod-car', 'prod-app', '', '3306', true, false);

insert into owners (cluster_name, username) values ('prod-car', 'khurram');

@khurramnaseem
Copy link
Author

@michaelfinch I'll appreciate your help on this .

@michaelfinch
Copy link
Collaborator

Sorry, I completely forgot about this. It's probably easiest if you message me on skype, my username is michaelfinch9. I'll be reachable for most of the day between 9:00 PST and 19:00 PST

@obissick
Copy link

i am running in prod but runner is unable to reach API. do have to allow access to /pr in apache?

@michaelfinch
Copy link
Collaborator

What do you mean by /pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants