This has been replaced by scripts.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
<term>--public-interface=<parameter>INTERFACE</parameter></term>
<listitem>
<para>
- INTERFACE on which to attach public IP addresses or on which
- to attach the single-public-ip when used.
+ Default INTERFACE on which to attach public IP addresses.
</para>
<para>
When using public IP addresses, this is only required if
</listitem>
</varlistentry>
- <varlistentry>
- <term>--single-public-ip=<parameter>IPADDR</parameter></term>
- <listitem>
- <para>
- IPADDR specifies the single IP that CTDB will use in
- conjunction with LVS.
- </para>
- <para>
- Please see the <citetitle>LVS</citetitle> section in
- <citerefentry><refentrytitle>ctdb</refentrytitle>
- <manvolnum>7</manvolnum></citerefentry> for more
- information.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>--start-as-disabled</term>
<listitem>
struct reqid_context *idr;
struct ctdb_node **nodes; /* array of nodes in the cluster - indexed by vnn */
struct ctdb_vnn *vnn; /* list of public ip addresses and interfaces */
- struct ctdb_vnn *single_ip_vnn; /* a structure for the single ip */
struct ctdb_interface *ifaces; /* list of local interfaces */
char *err_msg;
const struct ctdb_methods *methods; /* transport methods */
bool *async_reply);
int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses);
-int ctdb_set_single_public_ip(struct ctdb_context *ctdb, const char *iface,
- const char *ip);
int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t *force_rebalance_nodes,
* foolproof. One alternative is reference counting, where the logic
* is distributed and can, therefore, be broken in multiple places.
* Another alternative is to build a red-black tree of interfaces that
- * can have addresses (by walking ctdb->vnn and ctdb->single_ip_vnn
- * once) and then walking ctdb->ifaces once and deleting those not in
- * the tree. Let's go to one of those if the naive implementation
- * causes problems... :-)
+ * can have addresses (by walking ctdb->vnn once) and then walking
+ * ctdb->ifaces once and deleting those not in the tree. Let's go to
+ * one of those if the naive implementation causes problems... :-)
*/
static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb,
struct ctdb_vnn *vnn)
continue;
}
- /* Is the "single IP" on this interface? */
- if ((ctdb->single_ip_vnn != NULL) &&
- (ctdb->single_ip_vnn->ifaces[0] != NULL) &&
- (strcmp(i->name, ctdb->single_ip_vnn->ifaces[0]) == 0)) {
- /* Found, next interface please... */
- continue;
- }
/* Search for a vnn with this interface. */
found = false;
for (tv=ctdb->vnn; tv; tv=tv->next) {
return 0;
}
-int ctdb_set_single_public_ip(struct ctdb_context *ctdb,
- const char *iface,
- const char *ip)
-{
- struct ctdb_vnn *svnn;
- struct ctdb_interface *cur = NULL;
- bool ok;
- int ret;
-
- svnn = talloc_zero(ctdb, struct ctdb_vnn);
- CTDB_NO_MEMORY(ctdb, svnn);
-
- svnn->ifaces = talloc_array(svnn, const char *, 2);
- CTDB_NO_MEMORY(ctdb, svnn->ifaces);
- svnn->ifaces[0] = talloc_strdup(svnn->ifaces, iface);
- CTDB_NO_MEMORY(ctdb, svnn->ifaces[0]);
- svnn->ifaces[1] = NULL;
-
- ok = parse_ip(ip, iface, 0, &svnn->public_address);
- if (!ok) {
- talloc_free(svnn);
- return -1;
- }
-
- ret = ctdb_add_local_iface(ctdb, svnn->ifaces[0]);
- if (ret != 0) {
- DEBUG(DEBUG_CRIT, (__location__ " failed to add iface[%s] "
- "for single_ip[%s]\n",
- svnn->ifaces[0],
- ctdb_addr_to_str(&svnn->public_address)));
- talloc_free(svnn);
- return -1;
- }
-
- /* assume the single public ip interface is initially "good" */
- cur = ctdb_find_iface(ctdb, iface);
- if (cur == NULL) {
- DEBUG(DEBUG_CRIT,("Can not find public interface %s used by --single-public-ip", iface));
- return -1;
- }
- cur->link_up = true;
-
- ret = ctdb_vnn_assign_iface(ctdb, svnn);
- if (ret != 0) {
- talloc_free(svnn);
- return -1;
- }
-
- ctdb->single_ip_vnn = svnn;
- return 0;
-}
-
static void *add_ip_callback(void *parm, void *data)
{
struct public_ip_list *this_ip = parm;
addr = (ctdb_sock_addr *)indata.dptr;
vnn = find_public_ip_vnn(ctdb, addr);
- if (vnn == NULL) {
- /* if it is not a public ip it could be our 'single ip' */
- if (ctdb->single_ip_vnn) {
- if (ctdb_same_ip(&ctdb->single_ip_vnn->public_address, addr)) {
- vnn = ctdb->single_ip_vnn;
- }
- }
- }
if (vnn == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Could not get public ip info, "
"'%s'not a public address\n",
const char *db_dir_persistent;
const char *db_dir_state;
const char *public_interface;
- const char *single_public_ip;
int valgrinding;
int nosetsched;
int start_as_disabled;
{ "interactive", 'i', POPT_ARG_NONE, &interactive, 0, "don't fork", NULL },
{ "public-addresses", 0, POPT_ARG_STRING, &options.public_address_list, 0, "public address list file", "filename" },
{ "public-interface", 0, POPT_ARG_STRING, &options.public_interface, 0, "public interface", "interface"},
- { "single-public-ip", 0, POPT_ARG_STRING, &options.single_public_ip, 0, "single public ip", "ip-address"},
{ "event-script-dir", 0, POPT_ARG_STRING, &options.event_script_dir, 0, "event script directory", "dirname" },
{ "logging", 0, POPT_ARG_STRING, &options.logging, 0, "logging method to be used", NULL },
{ "nlist", 0, POPT_ARG_STRING, &options.nlist, 0, "node list file", "filename" },
CTDB_NO_MEMORY(ctdb, ctdb->default_public_interface);
}
- if (options.single_public_ip) {
- if (options.public_interface == NULL) {
- DEBUG(DEBUG_ALERT,("--single_public_ip used but --public_interface is not specified. You must specify the public interface when using single public ip. Exiting\n"));
- exit(10);
- }
-
- ret = ctdb_set_single_public_ip(ctdb, options.public_interface,
- options.single_public_ip);
- if (ret != 0) {
- DEBUG(DEBUG_ALERT,("Invalid --single-public-ip argument : %s . This is not a valid ip address. Exiting.\n", options.single_public_ip));
- exit(10);
- }
- }
-
if (options.event_script_dir != NULL) {
ctdb->event_script_dir = options.event_script_dir;
} else {