usnistgov / SpectrumBrowser

ITL
12 stars 11 forks source link

Add fabric script for installing on remote server #197

Closed ranganathanm closed 9 years ago

ranganathanm commented 9 years ago

Add a fab script to automate remote installations. Build locally run fab install to install on remote host.

klhicks commented 9 years ago

We (me and Doug) modified the fab script to work for remote installations but for the old code base. Currently working to incorporate your newer changes.

ranganathanm commented 9 years ago

The fabric file works with a few workarounds. Please modify it to work for your configuration (i.e. mongod and the rest live on separate servers). Please verify that it will work for a single server. Also there are a few workarounds I had to do. Specifically nginx gives me "bad gateway" when I run as a service. Perhaps Doug can help there.

djanderson commented 9 years ago

I did deal with the 502 Bad Gateway issue while writing the services, but unfortunately it was one of those things where I fixed it without fully understanding how. I think it has something to do with whether nginx sees the .pem file and requests the password. Note to myself and @klhicks, let's double check Monday and see if starting via service swallows the password prompt.

ranganathanm commented 9 years ago

I did remove the password from the key. So now it does not require a password; however, it still fails with 502 when I start it with the standard service script.


From: Douglas Anderson notifications@github.com Sent: Saturday, July 11, 2015 12:29 AM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: Re: [SpectrumBrowser] Add fabric script for installing on remote server (#197)

I did deal with the 502 Bad Gateway issue while writing the services, but unfortunately it was one of those things where I fixed it without fully understanding how. I think it has something to do with whether nginx sees the .pem file and requests the password. Note to myself and @klhickshttps://github.com/klhicks, let's double check Monday and see if starting via service swallows the password prompt.

Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/197#issuecomment-120571885.

djanderson commented 9 years ago

@ranganathanm, we solved the 502 error on our end by tracing it back to spectrumbrowser (gunicorn) failing to start due to not being able to reach mongo. @klhicks fixed the issue with mongo and I modified the spectrumbrowser service script to sleep for 2 more seconds and then recheck gunicorn's pid, so that we don't have services silently failing and giving us weird errors 2 or 3 services down the chain. Please repull and test on your end.

ranganathanm commented 9 years ago

Too many fabric files. I want to reduce to a single one. What is the role of fabtargets_prod.py ? I'd rather have two environment variables

MSOD_WEB_HOST

MSOD_DB_HOST

(can be the same for NIST install and different for NTIA).

And a single fabric file. I am working with fabtargets.py and plan to remove fabtargets_prod.py.

Any comments on this?

klhicks commented 9 years ago

No.

ranganathanm commented 9 years ago

Kheri, please test this on a multi-server deployment (db host different from web host).

klhicks commented 9 years ago

Everything is installing as expected. The only issue now is that I still cannot connect to the admin or spectrumbrowser pages via firefox. I'll push my changes tomorrow morning.

ranganathanm commented 9 years ago

Kheri, you may want to check if nginx is running. If not, please start it.

klhicks commented 9 years ago

Everything started and was running according to the service status. The thing that stuck out was that all of the log files were empty except gunicorn(spectrumbrowser). Does data need to be in the dbs?

ranganathanm commented 9 years ago

Run ps and see if the python processes are actually running. There should be something in the nginx log file when you try to access the web server -- especially in the nginx log file. Check in the nginx log.

klhicks commented 9 years ago

All of the logs are empty with an exception to gunicorn. I've double checked all services and they are all running. @ranganathanm

ranganathanm commented 9 years ago

@klhicks please mail me that exception. Thanks.


From: klhicks notifications@github.com Sent: Thursday, July 23, 2015 10:03 AM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: Re: [SpectrumBrowser] Add fabric script for installing on remote server (#197)

All of the logs are empty with an exception to gunicorn. I've double checked all services and they are all running. @ranganathanmhttps://github.com/ranganathanm

Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/197#issuecomment-124118131.

ranganathanm commented 9 years ago

If this issue no longer exists, please close it. Thanks.