Commit d6f3ead7 authored by Andres Toomsalu's avatar Andres Toomsalu
Browse files

Adding initial demo page (NF-47)

parent a804ce53
......@@ -11,6 +11,7 @@ dev-install:
install -m 644 nodefabric/nf-demo-app-haproxy.json ${NFDIR}/files.d/haproxy/consul.tpl.d/nf-demo-app-haproxy.json
install -m 644 nodefabric/nf-demo-app-haproxy.tpl ${NFDIR}/files.d/haproxy/haproxy.tpl.d/nf-demo-app-haproxy.tpl
install -m 644 nodefabric/nf-demo-app.service /usr/lib/systemd/system/nf-demo-app.service
install -m 644 www/index.php /var/lib/nf-demo-app/index.php
docker exec -t nf-haproxy /consul-template-hup.sh
docker exec -t nf-haproxy /haproxy-hup.sh
systemctl daemon-reload
......
<?php
echo "<html><body>";
$link = mysql_connect("172.17.42.1", "root", "rootpass");
mysql_select_db("mysql");
echo "<h3>MySQL</h3><p>";
printf("server version: %s", mysql_get_server_info());
echo "<br/>";
$query = "show variables LIKE 'wsrep_node_address'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo "server ipaddr: ".$row['Value']."<br/>";
}
$query = "show status LIKE 'wsrep_local_state_comment'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo "server status: ".$row['Value']."<br/>";
}
$query = "select user,host from mysql.user";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo $row['user'].": ".$row['host']."<br/>";
}
mysql_close($link);
echo "</p>";
echo "</body></html>";
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment