giovedì 29 dicembre 2011

openshift: vedere lo spazio disco occupato

[UPDATE]

adesso c'è quota!!

è possibile aggiungerlo negli script client side (tipo post_deploy/pre_deploy) etc.



Al momento non c'è un comando che mostra chiaramente l'occupazione disco...
un domani forse verrà aggiunto tra le informazioni restituite da rhc-user-info -laccountname

Per ora, come recita:

https://www.redhat.com/openshift/community/forums/express/questions-on-express-quota
basta fare un login ssh 
ssh  $UUID@$HOSTNAME 

 e lanciare il comando:
$ du -sh ~ /tmp

( o simili 
http://www.magicmill.net/linux/grap/grap-11.html)
se lo spazio occupato è troppo alto, cominciate con le pulizie di natale con:
rhc-ctl-app -a nomeapplicazione -c tidy  -l account@gmail.com

openshift: vedere host e port

come suggeriscono nel forum:
https://www.redhat.com/openshift/community/forums/express/support-for-standalone-java-app


It'll be a port *and* IP you

It'll be a port *and* IP you need to bind to. Add the following to your .openshift/action_hooks/post_deploy script to see what you should be binding to:
echo "Bind to this port: $OPENSHIFT_INTERNAL_IP:$OPENSHIFT_INTERNAL_PORT"
Then use that IP and port for binding.

utile...

martedì 27 dicembre 2011

openshift: vedere il threaddump

prima eseguire il comando:
rhc-ctl-app -a appname -c threaddump -lxxxxx@gmail.com


e poi per rivedere il threaddump:

rhc-tail-files -f appname/jbossas-7.0/stdout.log -lxxxxx@gmail.com -a appname

verrò fuori qualcosa come:


Heap
 PSYoungGen      total 27136K, used 22338K [0x00000000fe000000, 0x00000000fff90000, 0x0000000100000000)
  eden space 22080K, 99% used [0x00000000fe000000,0x00000000ff588ad0,0x00000000ff590000)
  from space 5056K, 5% used [0x00000000ffa70000,0x00000000ffab8000,0x00000000fff60000)
  to   space 4992K, 0% used [0x00000000ff590000,0x00000000ff590000,0x00000000ffa70000)
 PSOldGen        total 64896K, used 34863K [0x00000000fa000000, 0x00000000fdf60000, 0x00000000fe000000)
  object space 64896K, 53% used [0x00000000fa000000,0x00000000fc20bd88,0x00000000fdf60000)
 PSPermGen       total 78656K, used 78637K [0x00000000f4200000, 0x00000000f8ed0000, 0x00000000fa000000)
  object space 78656K, 99% used [0x00000000f4200000,0x00000000f8ecb6b8,0x00000000f8ed0000)

per capire cosa sono:
http://javandoblog.blogspot.com/2010/08/per-chi-sviluppa-in-java-prima-o-poi.html

lunedì 26 dicembre 2011

openshift: che figata!

Sono anni che sogno di avere un jboss in hosting...e adesso con openshift è possibile!

adesso è possibile avere un virtual server a propria diposizione con mysql, phpmyadmin, 300 mega di ram e 500 mega di spazio disco:

Alcune highlights dell'ultima ora:

1) aggiungere un alias alla propria applicazione:
immaginate di comprare un nome per la vs applicazione su uno dei tanti rivenditori in rete, comprando anche l'uso del dns..a questo punto basta usare il comando:
rhc-ctl-app -a nomeapplicazione -c add-alias --alias www.hostname.org -l account@gmail.com

2) connesioni ssh al ns host:
rhc-user-info -l account@gmail.com

per ogni applicazione ci sarà un url git:
Git URL: ssh://xxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxx.rhcloud.com

ssh -t xxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxx.rhcloud.com

e voilà siete dentro la vs macchina:


Welcome to OpenShift shell

    This shell will assist you in managing openshift applications.

    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    Shell access is quite powerful and it is possible for you to
    accidentally damage your application.  Procede with care!
    If worse comes to worse, destroy your application with rhc-ctl-app
    and recreate it
    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!

    type "help" for more info.


3) pulizia dello spazio disco non +usato (tmp/log/git history)


rhc-ctl-app -a nomeapplicazione -c tidy  -l account@gmail.com


che farà le seguenti mosse:

Stopping app...
Running 'git gc --prune --aggressive'
Emptying log dir: /var/lib/libra/xxxxxxxxxxxxxxxxxxx/nomeapplicazione/logs/
Emptying tmp dir: /tmp/
Emptying tmp dir: /var/lib/libra/xxxxxxxxxxxxxxxxxxx/nomeapplicazione/tmp/
Emptying tmp dir: /var/lib/libra/xxxxxxxxxxxxxxxxxxx/nomeapplicazione/jbossas-7.0/standalone/tmp/
Starting app...


4) riavviare mysql:
rhc-ctl-app -a nomeapplicazione -e restart-mysql-5.1



utilissimi link per cominciare a giocare:



http://www.jboss.org/openshift/articles.html


da cui:
http://community.jboss.org/blogs/scott.stark/2011/08/10/openshift-expressflex-cartridge-comparision
http://community.jboss.org/blogs/scott.stark/2011/08/10/jbossas7-configuration-in-openshift-express
http://community.jboss.org/blogs/scott.stark/2011/08/10/differences-between-the-express-and-flex-jbossas7-configurations
http://community.jboss.org/wiki/TrackingThreadsInJBossAS7
http://community.jboss.org/blogs/scott.stark/2011/08/10/jbossas7-configuration-in-openshift-express
https://www.redhat.com/openshift/blogs/seeing-cdi-working-in-openshift
https://www.redhat.com/openshift/community/blogs/how-to-create-an-openshift-github-quick-start-project


importante:
http://jaitechwriteups.blogspot.com/2011/08/deploy-java-ee-application-on-openshift.html


pannello di controllo
https://openshift.redhat.com/app/control_panel