rabbitmq.config
[{rabbit, [{cluster_partition_handling, autoheal},{loopback_users, []}]}].
#
# startup script for ovirt-agent
#
# chkconfig: 2345 85 20
# description: ovirt-agent
# processname: ovirt-agent
# pidfile: /var/run/tomcat.pid # config:# source function library.
. /etc/rc.d/init.d/functions
# source networking configuration.
. /etc/sysconfig/network
# check that networking is up.
export ovirt_agent_home=/opt/ovirt-agent
[ -f $ovirt_agent_home/bin/startserver.sh ] ||?exit 0 [ -f $ovirt_agent_home/bin/stopserver.sh ] ||?exit 0
# see how we were called.
case "$1" in
start)
# start daemon.
echo ?"starting ovirt-agent: "
$ovirt_agent_home/bin/startserver.sh $ovirt_agent_home/conf/ovirt-agent.xml
touch /var/lock/subsys/ovirt-agent
;;
stop)
# stop daemons.
echo ?"shutting down ovirt-agent: "
$ovirt_agent_home/bin/stopserver.sh
rm -f /var/lock/subsys/ovirt-agent
;;
restart)
$0 stop
$0 start
;;
status)
status ovirt-agent
;;
*)
echo "usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
pptpsetup --create myvpn --server --username vpn --password mincloud --encrypt --start
docker
run -d --name="rabbitmq_master" -p 200:22 -p 25672:25672 -p
15672:15672 -p 5672:5672 -p 4369:4369 -p 10051:10050 rabbitmq/ubuntu /bin/bash
-exec 'echo -e "172.20.20.10 rabbitmq-master\n127.0.0.1 localhost"
> /etc/hosts && /etc/init.d/rabbitmq-server start &&
/usr/sbin/sshd -d'
so now you have:
- the elapsed wall clock time (this period's time, minus last period's time) call this x
- the elapsed process cpu time (this period's time, minus last period's time) call this y
- the number of cpus. call this c
the percent utilization will be y / (x x c) * 100
import java.lang.management.*;
import java.util.concurrent.*;
osx = managementfactory.getoperatingsystemmxbean();
cores = osx.getavailableprocessors(); // factorial to keep the process busy so we can see some actual activity
factorial = { n -> int fact = 1; int i = 1; while(i <= n) { i ; fact *= i; } return fact; }
long elapsedtime = -1, starttime = -1; long elapsedcpu = -1, startcpu = -1;;
for(i in 0..20) { starttime = system.nanotime(); startcpu = osx.getprocesscputime(); countdownlatch latch = new countdownlatch(cores); for(x in 1..cores) { thread.startdaemon() { factorial(1000000); latch.countdown(); } } latch.await(); elapsedtime = system.nanotime()-starttime; elapsedcpu = osx.getprocesscputime()-startcpu; percusage = (elapsedcpu / (elapsedtime* cores)) *100; println "percent usage:$percusage %"; }