This article describes how to install OpenShift Origin (the community version) on a Redhat or CentOS 6.4 server. We’re doing this as a test on an AWS EC2 CentOS 6.4 (With Updates) and a machine type of “m3.medium”. Do this on a fresh system, not one that has real previous use.
This article was written with the help from: “http://openshift.github.io/documentation/oo_install_users_guide.html” and “http://openshift.github.io/documentation/oo_administration_guide.html”.
A few important notes. The setup we’re going through below is for a single host that will be the broker and the node with no other systems participating. I’ve used the following:
Domain name “apps.agix.com.au” for OpenShift applications (of which there could be many).
Domain name “openshift.agix.com.au” for OpenShift hosts (of which there is only one in this example).
Domain name (fully qualified) “broker.openshift.agix.com.au” for the Broker. Other hosts (which don’t exist) use to access the master host.
Having created the machine, i’ve issued the following to install the dependencies. There are other things we need to install but we do that at the end:
yum install -y wget curl ruby
Now we can start the install:
sh <(curl -s https://install.openshift.com/)
The installer is question/answer based. Just complete the prompts appropriate for your situation. I will show you my choices.
1. Install OpenShift Origin ... Do you want me to install a new DNS server for OpenShift-hosted applications, or do you want this system to use an existing DNS server? (Answer 'yes' to have me install a DNS server.) (y/n/q/?) y ... What domain name should be used for all of the hosted apps in your OpenShift system? |example.com|openshift.agix.com.au ... Do you want to register DNS entries for your OpenShift hosts with the same OpenShift DNS service that will be managing DNS records for the hosted applications? (y/n/q) y ... What domain do you want to use for the OpenShift hosts? |openshift.agix.com.au| apps.agix.com.au ... Hostname (the FQDN that other OpenShift hosts will use to connect to the host that you are describing): master.apps.agix.com.au ... Hostname / IP address for SSH access to master.apps.agix.com.au from the host where you are running oo-install. You can say 'localhost' if you are running oo-install from the system that you are describing: |master.apps.agix.com.au| localhost ... Detected IP address 172.31.6.44 at interface eth0 for this host. Do you want Nodes to use this IP information to reach this host? (y/n/q/?) n Specify the IP address that other hosts will use to connect to this host (Detected 172.31.6.44): 54.66.x.y ... Specify the network interface that other hosts will use to connect to this host (Detected 'eth0'): |eth0| ... If that will work in your deployment, press to accept the default value. Otherwise, provide an alternate IP address that will enable other OpenShift components to reach the BIND DNS service on this host: |54.66.x.y| ... Do you want to assign the Broker role to master.apps.agix.com.au? (y/n/q/?) y ... Do you want to configure an additional Broker? (y/n/q) n ... Do you want to assign the Node role to master.apps.agix.com.au? (y/n/q/?) y ... Do you want to configure an additional Node? (y/n/q) n ... Do you want to manually specify usernames and passwords for the various supporting service accounts? Answer 'N' to have the values generated for you (y/n/q) n
At this point we are presented with the usernames and passwords, etc, having answer no to the previous question.
3. Proceed with deployment Type a selection and press : 3 ... Do you want to make any changes to the subscription info in the configuration file? (y/n/q/?) n ... Do you want to set any temporary subscription settings for this installation only? (y/n/q/?) n ... The following RPMs are required, but not installed on this host: * puppet * bind Do you want to want me to try to install them for you? (y/n/q) y
At this stage the installed begins and install any needed software to complete the install based on your choices previously.
You can get started and access the web-portal of your new OpenShift setup by visiting the website:
Have a look at the following commands to get you moving forward. You should issue these on the new system that you’ve just setup. The “rhc” command is your best friend having gotten to this stage.
The RHC configuration and re-configuration tool. This is the command line method of managing an OpenShift domain, application, gears, etc. However, you could use the web interface as an alternative.
CLIENT: To list the available cartridges:
rhc cartridge list
SERVER: You can install new cartridges from Yum using the following command. First get the list of available packages from yum:
yum search origin-cartridge
SERVER: Then install those that you need:
yum install -y openshift-origin-cartridge-mysql openshift-origin-cartridge-postgresql
SERVER: Finally find and activate them:
oo-admin-broker-cache --console --clear cd /var/www/openshift/broker && scl enable ruby193 "bundle exec rake tmp:clear" rm -rf /var/www/openshift/broker/tmp/cache/* service openshift-broker restart service ruby193-mcollective restart oo-admin-ctl-cartridge --activate -c import-node --obsolete
SERVER: Add new users by issuing the command:
htpasswd /etc/openshift/htpasswd newuser
SERVER: Delete an existing user:
oo-admin-ctl-domain -l newuser -c delete htpasswd /etc/openshift/htpasswd -D newuser
CLIENT: You may want or need to delete the domains of the user as follows. First list the domains:
rhc domain list
CLIENT: And then delete it:
rhc domain delete demo
SERVER: Installing PostgreSQL-9.3 is done per application by using the following in the “Install your own Cartridge” section:
CLIENT: Confirm the list of cartridges there and available: