private void send(InetAddress endpoint, Event.NodeEvent event) { if (logger.isTraceEnabled()) logger.trace("Sending event for endpoint {}, rpc address {}", endpoint, event.nodeAddress()); // If the endpoint is not the local node, extract the node address // and if it is the same as our own RPC broadcast address (which defaults to the rcp address) // then don't send the notification. This covers the case of rpc_address set to "localhost", // which is not useful to any driver and in fact may cauase serious problems to some drivers, // see CASSANDRA-10052 if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && event.nodeAddress().equals(FBUtilities.getBroadcastRpcAddress())) return; send(event); }
private void send(InetAddress endpoint, Event.NodeEvent event) { if (logger.isTraceEnabled()) logger.trace("Sending event for endpoint {}, rpc address {}", endpoint, event.nodeAddress()); // If the endpoint is not the local node, extract the node address // and if it is the same as our own RPC broadcast address (which defaults to the rcp address) // then don't send the notification. This covers the case of rpc_address set to "localhost", // which is not useful to any driver and in fact may cauase serious problems to some drivers, // see CASSANDRA-10052 if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && event.nodeAddress().equals(FBUtilities.getBroadcastRpcAddress())) return; send(event); }
private void send(InetAddress endpoint, Event.NodeEvent event) { if (logger.isTraceEnabled()) logger.trace("Sending event for endpoint {}, rpc address {}", endpoint, event.nodeAddress()); // If the endpoint is not the local node, extract the node address // and if it is the same as our own RPC broadcast address (which defaults to the rcp address) // then don't send the notification. This covers the case of rpc_address set to "localhost", // which is not useful to any driver and in fact may cauase serious problems to some drivers, // see CASSANDRA-10052 if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && event.nodeAddress().equals(FBUtilities.getBroadcastRpcAddress())) return; send(event); }
/** * Return the rpc address associated with an endpoint as a string. * @param endpoint The endpoint to get rpc address for * @return the rpc address */ public String getRpcaddress(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return FBUtilities.getBroadcastRpcAddress().getHostAddress(); else if (Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS) == null) return endpoint.getHostAddress(); else return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value; }
/** * Return the rpc address associated with an endpoint as a string. * @param endpoint The endpoint to get rpc address for * @return the rpc address */ public String getRpcaddress(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return FBUtilities.getBroadcastRpcAddress().getHostAddress(); else if (Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS) == null) return endpoint.getHostAddress(); else return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value; }
public Settings nodeSettings(Settings settings) { return Settings.builder() // overloadable settings from elasticsearch.yml // by default, HTTP is bound to C* rpc address, Transport is bound to C* internal listen address. .put("network.bind_host", DatabaseDescriptor.getRpcAddress().getHostAddress()) .put("network.publish_host", FBUtilities.getBroadcastRpcAddress().getHostAddress()) .put("transport.bind_host", FBUtilities.getLocalAddress().getHostAddress()) .put("transport.publish_host", FBUtilities.getBroadcastAddress().getHostAddress()) .put("path.data",getElasticsearchDataDir()) .put(settings) // not overloadable settings. .put("discovery.type","cassandra") .put("node.data",true) .put("node.master",true) .put("node.name", CassandraDiscovery.buildNodeName(DatabaseDescriptor.getListenAddress())) .put("node.attr.dc", DatabaseDescriptor.getLocalDataCenter()) .put("node.attr.rack", DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress())) .put("cluster.name", ClusterService.getElasticsearchClusterName(env.settings())) .build(); }
/** * Return the rpc address associated with an endpoint as a string. * @param endpoint The endpoint to get rpc address for * @return the rpc address */ public String getRpcaddress(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return FBUtilities.getBroadcastRpcAddress().getHostAddress(); else if (Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS) == null) return endpoint.getHostAddress(); else return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value; }
appStates.put(ApplicationState.NET_VERSION, valueFactory.networkVersion()); appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(localHostId)); appStates.put(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(FBUtilities.getBroadcastRpcAddress())); appStates.put(ApplicationState.RELEASE_VERSION, valueFactory.releaseVersion());
appStates.put(ApplicationState.NET_VERSION, valueFactory.networkVersion()); appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(localHostId)); appStates.put(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(FBUtilities.getBroadcastRpcAddress())); appStates.put(ApplicationState.RELEASE_VERSION, valueFactory.releaseVersion());
appStates.put(ApplicationState.NET_VERSION, valueFactory.networkVersion()); appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(localHostId)); appStates.put(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(FBUtilities.getBroadcastRpcAddress())); appStates.put(ApplicationState.RELEASE_VERSION, valueFactory.releaseVersion());