Permalink
Browse files

Merge pull request #1257 from kgaillot/fixes

Updates to bundle logging, with other minor fixes
  • Loading branch information...
kgaillot committed Mar 30, 2017
2 parents 8bf5c9b + e34ed52 commit 104f9de00f4cde21b73fdfea5c95982c13cb71d0
View
@@ -1076,6 +1076,10 @@ CRM_STATE_DIR=${localstatedir}/run/crm
AC_DEFINE_UNQUOTED(CRM_STATE_DIR,"$CRM_STATE_DIR", Where to keep state files and sockets)
AC_SUBST(CRM_STATE_DIR)
CRM_LOG_DIR="${localstatedir}/log/pacemaker"
AC_DEFINE_UNQUOTED(CRM_LOG_DIR,"$CRM_LOG_DIR", Where Pacemaker can store log files)
AC_SUBST(CRM_LOG_DIR)
CRM_PACEMAKER_DIR=${localstatedir}/lib/pacemaker
AC_DEFINE_UNQUOTED(CRM_PACEMAKER_DIR,"$CRM_PACEMAKER_DIR", Location to store directory produced by Pacemaker daemons)
AC_SUBST(CRM_PACEMAKER_DIR)
@@ -1047,20 +1047,24 @@ association with Docker, Inc. is implied.]
====
[source,XML]
----
<bundle id="httpd-containers">
<bundle id="httpd-bundle">
<docker image="pcmk:http" replicas="3"/>
<network ip-range-start="192.168.122.131"
host-netmask="24"
host-interface="eth0">
<port-mapping id="httpd-port" port="80"/>
</network>
<storage>
<storage-mapping id="httpd-syslog"
source-dir="/dev/log"
target-dir="/dev/log"
options="rw"/>
<storage-mapping id="httpd-root"
source-dir-root="/var/local/containers"
source-dir="/srv/html"
target-dir="/var/www/html"
options="rw"/>
<storage-mapping id="httpd-logs"
source-dir-root="/var/log/containers"
source-dir-root="/var/log/pacemaker/bundles"
target-dir="/etc/httpd/logs"
options="rw"/>
</storage>
@@ -1130,8 +1134,8 @@ a bundle's Docker container.
|masters
|0
|A non-negative integer that, if positive, indicates that the containerized
service should be treated as a master/slave service, with this many master
instances allowed
service should be treated as a multistate service, with this many replicas
allowed to run the service in the master role
indexterm:[masters,Docker]
indexterm:[Docker,Property,masters]
@@ -1201,6 +1205,16 @@ indexterm:[bundle,network]
|=========================================================
[NOTE]
====
If +ip-range-start+ is used, Pacemaker will automatically ensure that
+/etc/hosts+ inside the containers has entries for each replica and its
assigned IP. Replicas are named by the bundle id plus a dash and an integer
counter starting with zero. For example, if a bundle named +httpd-bundle+ has
+replicas=2+, its containers will be named +httpd-bundle-0+ and
+httpd-bundle-1+.
====
Additionally, a +<network>+ element may optionally contain one or more
+<port-mapping>+ elements.
indexterm:[bundle,network,port-mapping]
@@ -1312,9 +1326,11 @@ indexterm:[bundle,storage,storage-mapping]
If the bundle contains a +primitive+,
Pacemaker will automatically map the equivalent of
+source-dir=/etc/pacemaker/authkey target-dir=/etc/pacemaker/authkey+
and +source-dir-root=/var/log/container target-dir=/var/log+ into the
and +source-dir-root=/var/log/pacemaker/bundles target-dir=/var/log+ into the
container, so it is not necessary to specify those paths in a
+storage-mapping+.
+storage-mapping+. Newer versions of +ocf:heartbeat:docker+ will automatically
create the source directories if they do not exist, but the user may want to
ensure they exist beforehand.
====
=== Bundle Primitive ===
@@ -1,4 +1,4 @@
@localstatedir@/log/pacemaker.log {
@localstatedir@/log/pacemaker.log @CRM_LOG_DIR@/bundles/*/pacemaker.log {
compress
dateext
weekly
View
@@ -43,6 +43,9 @@
/****** Directories ******/
/* Where Pacemaker can store log files */
#undef CRM_LOG_DIR
/* Location for Pacemaker daemons */
#undef CRM_DAEMON_DIR
View
@@ -223,6 +223,10 @@ crm_add_logfile(const char *filename)
bool is_default = false;
static int default_fd = -1;
static gboolean have_logfile = FALSE;
/* @COMPAT This should be CRM_LOG_DIR "/pacemaker.log". We aren't changing
* it yet because it will be a significant user-visible change to publicize.
*/
const char *default_logfile = "/var/log/pacemaker.log";
struct stat parent;
View
@@ -558,7 +558,7 @@ container_unpack(resource_t * rsc, pe_working_set_t * data_set)
crm_xml_set_id(xml_resource, "%s-%s", container_data->prefix, xml_resource->name);
xml_set = create_xml_node(xml_resource, XML_TAG_META_SETS);
crm_xml_set_id(xml_resource, "%s-%s-meta", container_data->prefix, xml_resource->name);
crm_xml_set_id(xml_set, "%s-%s-meta", container_data->prefix, xml_resource->name);
create_nvp(xml_set, XML_RSC_ATTR_ORDERED, "true");
@@ -609,7 +609,7 @@ container_unpack(resource_t * rsc, pe_working_set_t * data_set)
container_data->mounts = g_list_append(container_data->mounts, mount);
mount = calloc(1, sizeof(container_mount_t));
mount->source = strdup("/var/log/containers");
mount->source = strdup(CRM_LOG_DIR "/bundles");
mount->target = strdup("/var/log");
mount->options = NULL;
mount->flags = 1;
View
@@ -394,6 +394,13 @@ mcp_read_config(void)
free(debug_enabled);
}
/* If the user didn't explicitly configure a Pacemaker log file, check
* whether they configured a heartbeat or corosync log file, and use that.
*
* @COMPAT This should all go away, and we should just rely on the logging
* set up by crm_log_init(). We aren't doing this yet because it is a
* significant user-visible change that will need to be publicized.
*/
const_value = daemon_option("debugfile");
if (daemon_option("logfile")) {
/* File logging is already setup by crm_log_init() */
View
@@ -28,6 +28,32 @@
fun:main
}
{
Bash leak in cli regression testing
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:xmalloc
obj:/usr/bin/bash
fun:execute_command_internal
obj:/usr/bin/bash
fun:execute_command_internal
fun:parse_and_execute
fun:command_substitute
obj:/usr/bin/bash
obj:/usr/bin/bash
obj:/usr/bin/bash
fun:expand_string_assignment
obj:/usr/bin/bash
obj:/usr/bin/bash
obj:/usr/bin/bash
obj:/usr/bin/bash
fun:execute_command_internal
fun:execute_command_internal
fun:execute_command
fun:execute_command_internal
}
{
Ignore option parsing
Memcheck:Leak

0 comments on commit 104f9de

Please sign in to comment.