multicast address use in corosync
48
You don't have to use multicast on corosync.
You may use unicast to do your job.
This can be done by using something like this in /etc/corosync/corosync.conf
for a two-member cluster:
compatibility: whitetank
totem {
version: 2
secauth: off
interface {
member {
memberaddr: 10.23.55.201
}
member {
memberaddr: 10.23.55.202
}
ringnumber: 0
bindnetaddr: 10.23.55.0
mcastport: 5405
}
transport: udpu
}
service {
# Load the Pacemaker Cluster Resource Manager
ver: 0
name: pacemaker
use_mgmtd: yes
use_logd: yes
}
logging {
fileline: off
to_logfile: yes
to_syslog: yes
debug: off
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
Related videos on Youtube
Author by
Krishna Reddy CH
Updated on September 18, 2022Comments
-
Krishna Reddy CH almost 2 years
#include <stdio.h> #include <string.h> int main() { char str1[50]="TEST sun raised"; char str2[4][90]={"sun","in"}; char delim[] = " "; char *ptr=strtok(str1,delim); while (ptr!=NULL) { int i=0; for (i=0; i<4; i++) { if(strcmp(str2[i],ptr)) { printf("%s\n",ptr); break; } else { } } ptr=strtok(NULL,delim); } return 0; }
Below code should return Test and raised but it returns all strings
-
Krishna Reddy CH over 4 yearsAbove Code is not working as expected
-
chux - Reinstate Monica over 4 yearsNote:
strcmp(str2[i],ptr)
is true (non-0) when strings differ. Krishna Reddy CH, is this what you want? -
Krishna Reddy CH over 4 yearsyes differ string i want but it is not coming
-
robbpriestley over 4 years"Below code should return Test and raised but it returns all strings." I'm sorry but that statement doesn't make any sense.
-
-
Weather Vane over 4 yearsAnd the reason why the word "sun" appears to match, when
!=0
means it wasn't found, is because one of the other strings does not match. -
chux - Reinstate Monica over 4 yearsConsider what happens with
strcmp(str2[2],ptr)
-
Weather Vane over 4 yearsChange
if(strcmp(str2[i],ptr))
toif(strcmp(str2[i],ptr) == 0)
after which your program outputssun
. -
phoenixstudio over 4 yearsare you trying to find matches or if it does not exist ? , the reason why you can see sun when you use
!=0
is because sun match wich sun but does not match with Test and raised => you will see it in the results -
Krishna Reddy CH over 4 yearsi want the string which doesnt exist in str2 array