QA/Sync/Sync Server Install EL6: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "= Notes for installing Sync Server on Red Had Enterprise Linux 6 for 64-Bit systems = REF: http://docs.services.mozilla.com/howtos/run-sync.html == General Notes == * The "Build...")
 
No edit summary
Line 1: Line 1:
= Notes for installing Sync Server on Red Had Enterprise Linux 6 for 64-Bit systems =
= Notes for installing Sync Server on Red Hat Enterprise Linux 6 for 64-Bit systems =
REF: http://docs.services.mozilla.com/howtos/run-sync.html
REF: http://docs.services.mozilla.com/howtos/run-sync.html


Line 58: Line 58:
  $ make -v
  $ make -v


Note: For the more manual installation steps, using /usr/local/src as a working directory. Also, borrowed heavily from the following site: http://binarysushi.com/blog/2009/aug/19/CentOS-5-3-python-2-5-virtualevn-mod-wsgi-and-mod-rpaf
Note: For the more manual installation steps, using /usr/local/src as a working directory, although this can be any location you choose.


* Install SetupTools
* Install SetupTools
Line 77: Line 77:
  $ sudo yum install python-devel-2.6.6-20.el6.x86_64
  $ sudo yum install python-devel-2.6.6-20.el6.x86_64


Note: Need this because we are running 2.6.6 and the VM is x86_64. And, this is required for building the Sync Server and for installing MySQL-Python.
* Install GCC, which is required for MySQL-Python
 
* Next, install GCC, which is required for MySQL-Python
  $ cd /usr/local/src
  $ cd /usr/local/src
  $ sudo yum install gcc
  $ sudo yum install gcc
Line 90: Line 88:
  gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
  gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)


* Next, start up MySQL
* Start up MySQL
  sudo /etc/init.d/mysqld start
  sudo /etc/init.d/mysqld start


* Next, configure MySQL with a password and a test DB for Sync.
* Configure MySQL with a password and a test DB for Sync.
  mysql -u root -p
  mysql -u root -p
  There may be no password (or a "blank" password)
  There may be no password (or a "blank" password)
Line 105: Line 103:
  mysql> \quit
  mysql> \quit


Note: mysql-server install usually prints several lines that show how to do initial setup, so those steps could also be followed instead of those listed above.
Note: mysql-server install usually prints several lines that show how to do initial setup, so those steps could also be followed instead of the listed above.


* Next, clone and build the sync server
* Next, clone and build the sync server
For this box, we need a Sync Server setup in a more public place. Therefore, going into this open folder for now: /opt/sync
Installing to an open folder for now: /opt/sync
$ mkdir /opt/sync
$ cd /opt/sync
  $ hg clone https://hg.mozilla.org/services/server-full
  $ hg clone https://hg.mozilla.org/services/server-full
  $ cd server-full
  $ cd server-full
  $ make build
  $ make build


* Next, install mysql-devel (which is a prereq for MySQL-Python)
* Install mysql-devel (which is a prereq for MySQL-Python)
  $ sudo yum install mysql-devel
  $ sudo yum install mysql-devel


* Next, install MySQL-Python
* Install MySQL-Python
  $ cd /opt/sync/server-full
  $ cd /opt/sync/server-full
  $ bin/easy_install MySQL-Python
  $ bin/easy_install MySQL-Python


* Next, configure server-full/etc/sync.conf to use MySQL
* Configure server-full/etc/sync.conf to use MySQL
  Change the two "sqluri" lines to match the following (or similar):
  Change the two "sqluri" lines to match the following (or similar):
  sqluri = mysql://root:mozroot@localhost/syncdb
  sqluri = mysql://root:mozroot@localhost/syncdb


* Next, configure server-full/etc/sync.conf to use this server as the "fallback":
* Run the following command (see the wiki page) for more information
fallback_node = http://sync6.mtv1.dev.svc.mozilla.com:5000/
  $ bin/paster serve development.ini
 
Note: IP and port combination for this VM and the Sync Server is the following:
10.250.64.147:5000
 
* Now, start up the Sync Server, try the following from /opt/sync/server-full:
  $ nohup bin/paster serve development.ini 1>> syncserver.log 2>>syncserver.log &
 
* This will run the Sync Server in nohup mode and redirect STDOUT and STDERR to the file syncserver.log.
* The Sync Server would have to be restarted in case the VM is restarted.
This could be updated by running a startup cron to verify MySQL and Sync Server are restarted properly.
 
* Quick testing the Sync Server from any location that can reach the IP (from some ideas Tarek had):
$ curl http://sync6.mtv1.dev.svc.mozilla.com:5000/
This should return a 404 error if it is working correctly
 
* From the browser:
$ http://sync6.mtv1.dev.svc.mozilla.com:5000/user/1.0/a
This should return a '0' if it is working correctly
 
* Both of these should generate Sync Server INFO messages to STDOUT (from the terminal running Sync Server).
 
* Now, you should be able to set up accounts that can sync to the following custom host:
http://sync6.mtv1.dev.svc.mozilla.com:5000/


* If the Server is running correctly, you should see something like this
Starting server in PID 3568.
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000


= Rebuilding and Deploying the Sync Server =
= Rebuilding and Deploying the Sync Server =
* Sync server install is here: /opt/sync/server-full
* Log is here: /opt/sync/server-full/syncserver.log
* Kill the Sync Server process
* Kill the Sync Server process
  $ kill -9 <PID>
  $ kill -9 <PID>
(Leave MySQL running)
(Leave MySQL running)
* Save the Sync Server directory and its contents
* Save the Sync Server directory and its contents
(this in case we want to keep various snapshots)
(this in case you want to keep various snapshots)
$ cd /opt/sync
  $ mv server-full server-full-<DATE>
  $ mv server-full server-full-<DATE>
(example: mv server-full server-full-08012011)
(example: mv server-full server-full-08012011)
* Repeat the build and deploy steps from above
* Repeat the build and deploy steps from above
* Make the necessary changes in the server-full/etc/sync.conf file:
* Make the necessary changes in the server-full/etc/sync.conf file:
* Change the sqluri and fallback_node
* Change the sqluri entries
* Restart the server using the "nohup" command from above
* Restart the server
* Test the service
* Send out email to services-qa once the service is up and running again


For more advanced configurations, including web server support, please see the following documentation:
For more advanced configurations, including web server support, please see the following documentation:
Line 174: Line 148:
For a more technical overview of Sync Server and an introduction to Mozilla Services, please see the following documentation:
For a more technical overview of Sync Server and an introduction to Mozilla Services, please see the following documentation:
* http://docs.services.mozilla.com
* http://docs.services.mozilla.com
= Installing/Configuring a Web Server for Sync =
TBD: We need to add instructions here for connecting the Sync Server to nginx/gunicorn.
Sync6 appears to have all the prerequisites for doing this work. The following processes are running on sync6:
memcached -d -p 11211 -u nobody -m 16834 -c 8192 -P /var/run/memcached/memcached.pid
supervise gunicorn-syncstorage
supervise log
supervise nginx
supervise log
nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf -g daemon off;
nginx: worker process                                 
/usr/bin/ruby /usr/sbin/puppetd
nrpe -c /etc/nagios/nrpe.cfg -d
Confirmed users
3,727

edits

Navigation menu