-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Ricky Ng-Adam edited this page Aug 11, 2016
·
27 revisions
Based on:
- Github account
- Reasonable package management on the host machine: on MacOS X, http://brew.sh
- Able to use vim (finish vimtutor) and shell/terminal (bash and host shell)
We've selected Ubuntu 14.04 as our preferred Linux distribution.
We recommend vagrant to create VM:
- Install vagrant (https://www.vagrantup.com/docs/installation/)
On MacOS X:
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew cask install vagrant-manager
-
vagrant box add ubuntu/trusty64
(this installs the image for Ubuntu 14.04) -
in a new directory:
vagrant init ubuntu/trusty64
vagrant up
vagrant ssh
Overall goal:
- Setup 3-tier WebApp architecture and optimize:
- Webserver: (NGINX)
- Application server (NodeJS)
- database (PostgreSQL)
...also, add data analysis (Jupyter).
Meta: collect, analysis, report on data generated by the system itself (logs and monitoring information)
- optimize for China (packages from Chinese mirrors)
- configure timezone for China (make sure to use NTP)
- security
- automate setup and installation
- test different workloads
- benchmark and tune operating system and each tier
- depending on simulated load and hardware profile, select:
- sysctl settings tweaks
- service configuration and optimization
- filesystem / configuration
- VPN setup
- services monitoring
- load monitoring (memory, disk, cpu)
- log monitoring
- networking configuration
- firewall configuration
- setup and install an instance of Ubuntu 14.04 LTS Server with Internet connectivity
- list all services running
- update packages source
- install webserver: nginx
- list all services running
- list files installed by nginx using the package manager
- make sure that the webserver is up, running and listening to port 80
- from your own host and using your browser, access http://localhost and make sure the above serves the nginx welcome page
- change the webserver configuration to serve your own index.html file from your home directory
- install the database server: postgresql
- make sure that the database server is up
- create a database
- using port forwarding, access this database using the DB GUI from your workstation
- install rsyslog-pgsql package
- http://shenavandeh.blogspot.com/2013/01/how-to-make-rsyslog-to-write-syslogs-in.html
- modify /etc/rsyslog.d/pgsql.conf to look as follows:
$ModLoad ompgsql
$WorkDirectory /var/tmp/rsyslog/work
$MainMsgQueueFileName mainq
*.* :ompgsql:localhost,rsyslogpgsql,rsyslogpgsql,<this is the generated password>
- create directory from the config file above: mkdir -p /var/tmp/rsyslog/work
- restart rsyslog service
- query database rsyslogpgsql and table systemevents for count of events
- create syslog events at each priority level
- query systemevents table for last ten messages
- install vm nodejs
- create appserver user
- add code
- configure nginx to point to appserver