Cluster Liferay? Vagrant up @ Liferay Symposium Italy 2016

Salve a tutti,

dopo ormai svariati anni che lavoro sulle metodologie Devops, con una particolare attenzione al configuration management, penso sempre che alcune tecniche non possano più stupire/interessare una platea di persone altamente specializzate.

Invece il feedback di quanto mostrato oggi, al Liferay Symposium 2016 tenutosi a Milano, è stato molto positivo ( grazie anche alla spettacolare partecipazione di Alessio Biancalana aka dottorblaster http://dottorblaster.it/ e Claudio Umana ).

Di cosa si è parlato?

Il tema era molto semplice, come dare agli sviluppatori la possibilità di tirare su un cluster Liferay in pochi minuti.

Effetto demo… dovevo avere un exit strategy nel caso in cui la demo si rompesse.. Eccolo qui:

https://www.youtube.com/watch?v=VofvrMGaBqc

Tool Devops utilizzati?

Ho optato per, un ormai consolidato binomio, Vagrant + Chef.

L’architettura?

Ormai, in azienda, sanno tutti che sono un fan di Ha-Proxy per cui l’ho posizionato davanti a tutto.

clustat

Screen Shot 2016-11-09 at 19.48.04.png

Sotto, i due backend Apache Tomcat con la versione enterprise di Liferay Portal 6.2 EE sp14, che comunicano tramite multicast.

default.admin.password=liferay
default.admin.screen.name=Admin
default.admin.email.address.prefix=admin
default.admin.first.name=Test
default.admin.last.name=Test
setup.wizard.enabled=false
users.reminder.queries.enabled=false
terms.of.use.required=false

web.server.display.node=true
org.quartz.jobStore.isClustered=true

cluster.link.enabled=true
ehcache.cluster.link.replication.enabled=true
lucene.replicate.write=true
net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml

dl.store.impl=com.liferay.portlet.documentlibrary.store.AdvancedFileSystemStore
dl.store.file.system.root.dir=<%=node[‘sourcesense_liferay’][‘data_nfs_mount’]%>/document_library

cluster.link.autodetect.address=192.168.50.4:3306

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://<%=node[‘sourcesense_mysql’][‘db_host’]%>/<%=node[‘sourcesense_mysql’][‘database’]%>?useUniCode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=<%=node[‘sourcesense_mysql’][‘dbuser’]%>

Sotto ancora, una macchina con NFS per il disco dati condiviso, e Mysql Server.

Ho versionato il tutto su https://github.com/lucky-sideburn/demo-liferay  dichiarando nel Vagrantfile, nodi come questo:

liferaynode01.vm.provision :chef_solo do |chef|
chef.roles_path = ‘./chef/roles’
chef.data_bags_path = ‘./chef/data_bags’
chef.run_list = [
‘role[java]’,
‘recipe[sourcesense_liferay]’
]
end

 Il codice usato per la demo lo trovate qui:

https://github.com/lucky-sideburn/demo-liferay

Sarebbe bello scorporare i vari cookbook e condividerli nella community Chef 🙂 Per cui prendetene e cheffizzatene tutti!

ciao!

Advertisements

Cooking on Windows Sever..

Hi guys!

I have to manage Windows Server 2008 using Chef..

First of all, I need to choose the strategy for bootstrapping the new node and I am going to use an unattended bootstrap..

Configuring network card to talk with 33.33.33.10 (my Chef server)

Screen Shot 2016-08-04 at 18.19.09

Download and install  chef-client for Windows from https://downloads.chef.io/chef-client/windows/

Screen Shot 2016-08-04 at 15.41.06.png

Copy client.rb and validation.pem to c:\chef and launch chef-client from the command line.

This my new Windows node!

Screen Shot 2016-08-04 at 18.09.15

Let’s prepare a simple cookbook named mywindows:

knife cookbook create mywindows

Let’s insert the following resources in recipes/default.rb

#Modify the hosts file
template "C:\\Windows\\System32\\drivers\\etc\\hosts" do
  source "hosts.erb"
  action :create
end

 

#Restart an array of services
[ "Dnscache" , "UxSms" ].each do |s|
 service s do
    action :restart
   end
end

 

#Update Group Policy
execute 'gpupdate' do
  command "gpupdate.exe"
end

 

#Create a key into the registry
windows_registry 'HKCU\Software\Test' do
  values 'MySuperKEy' => Time.now
  action :create
end

 

#Install Putty
windows_package 'Putty' do
  source 'C:\\putty-0.60-installer.exe'
  installer_type :inno
  action :install
end

 

#Enable a Windows Feature
windows_feature "WindowsServerBackup" do
  action :install
end

Run chef-client and all works fine!

Screen Shot 2016-08-04 at 18.34.08.png

Bye!

 

Install Chef Server on Suse Linux Enterprise 11

Hi Folks!

Today I dealt with a problem… and I found a solution because Chef is a great tool!

At moment there is not an RPM for Suse Linux available from the official website, but this does not matter 🙂

Problem: Install Chef Server, Chefdk, Chef-manage into a Suse Linux Enterprise 11 virtual machine without installing the rpm packages of RHEL systems.

Screen Shot 2016-08-02 at 19.02.17.png

This is what you can do:

  1. Dowload the following packages:
    • chef-server-core-12.8.0-1.el6.x86_64.rpm,
    • chefdk-0.16.28-1.el6.x86_64.rpm,
    • chef-manage-2.4.1-1.el6.x86_64.rpm
  2. Extract all stuff from RPM with:
    • rpm2cpio  chef-manage-2.4.1-1.el6.x86_64.rpm   | cpio -idmv

  3. Move content of the extraction to the correct folders: /opt/{chef,chef-manage,opscoode}
  4. Set PATH=”/opt/opscode/bin:/opt/chefdk/bin/:/data/opt/chef-manage/bin:$PATH” in your profile login script
  5. chef-server-ctl reconfigure
  6. chef-manage-ctl reconfigure
  7. again chef-server-ctl reconfigure

At the end all services are up and running

Screen Shot 2016-08-02 at 19.12.35.png

and my workstation too 🙂

Chef Automate – Installation guide

Hi guys!

let’s take a look of Chef Automate.. In this post we will se how to install it quickly.

Screen Shot 2016-07-28 at 12.38.39

I will install it through Vagrant but you can use my cookbook into a Chef Server.


Requirements:

  1. a Chef Server. Change default[‘chef_automate’][‘chef_server’][‘url’] with the correct IP
  2. an user’s key (client.pem) of a member of your Chef Server Organization. Change default[‘chef_automate’][‘key’][‘base’] and default[‘chef_automate’][‘key’][‘name’] with your values
  3. a Virtualbox private network 192.168.56.0 (or you can set a port forwarding into the Vagrantfile in order access to the webserver through  http://127.0.0.1)
  4. a delivery.license file. Put it into the cookbook directory. You can see it on /vagrant into the guest vm.

Start the provision..

  1. git clone https://github.com/lucky-sideburn/chef_automate.git
  2. vagrant up
  3. https://automate-box01/e/umbrella_corporation/ or use your preferred internal IP or use port forwarding to 127.0.0.1
  4. Select your enterprise

Screen Shot 2016-07-28 at 19.47.56

5. Enjoy!

Screen Shot 2016-07-28 at 20.21.16


 

Thanks!

Eugenio Marzo – Devops Engineer @Sourcesense


sourcesenseLogo266