Merge branch 'branch-0.9'
Amnon Heiman (1): EndPointSnitchInfo: Support null as host name Asias He (1): rpm: Fix build in centos container Takuya ASADA (2): dist: check hostname is resolvable dist: does not need maven for running time
This commit is contained in:
commit
e7637a643a
2
dist/redhat/build_rpm.sh
vendored
2
dist/redhat/build_rpm.sh
vendored
@ -18,4 +18,4 @@ cp dist/redhat/scylla-jmx.spec.in $RPMBUILD/SPECS/scylla-jmx.spec
|
|||||||
sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" $RPMBUILD/SPECS/scylla-jmx.spec
|
sed -i -e "s/@@VERSION@@/$SCYLLA_VERSION/g" $RPMBUILD/SPECS/scylla-jmx.spec
|
||||||
sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" $RPMBUILD/SPECS/scylla-jmx.spec
|
sed -i -e "s/@@RELEASE@@/$SCYLLA_RELEASE/g" $RPMBUILD/SPECS/scylla-jmx.spec
|
||||||
rpmbuild -bs --define "_topdir $RPMBUILD" -ba $RPMBUILD/SPECS/scylla-jmx.spec
|
rpmbuild -bs --define "_topdir $RPMBUILD" -ba $RPMBUILD/SPECS/scylla-jmx.spec
|
||||||
mock rebuild --resultdir=`pwd`/build/rpms $RPMBUILD/SRPMS/scylla-jmx-$VERSION*.src.rpm
|
/usr/bin/mock rebuild --resultdir=`pwd`/build/rpms $RPMBUILD/SRPMS/scylla-jmx-$VERSION*.src.rpm
|
||||||
|
9
dist/redhat/scylla-jmx.spec.in
vendored
9
dist/redhat/scylla-jmx.spec.in
vendored
@ -38,6 +38,15 @@ install -m755 dist/redhat/scripts/* $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
|
|||||||
%pre
|
%pre
|
||||||
/usr/sbin/groupadd scylla 2> /dev/null || :
|
/usr/sbin/groupadd scylla 2> /dev/null || :
|
||||||
/usr/sbin/useradd -g scylla -s /sbin/nologin -r -d ${_sharedstatedir}/scylla scylla 2> /dev/null || :
|
/usr/sbin/useradd -g scylla -s /sbin/nologin -r -d ${_sharedstatedir}/scylla scylla 2> /dev/null || :
|
||||||
|
ping -c1 `hostname` > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo
|
||||||
|
echo "**************************************************************"
|
||||||
|
echo "* WARNING: You need to add hostname on /etc/hosts, otherwise *"
|
||||||
|
echo "* scylla-jmx will not able to start up. *"
|
||||||
|
echo "**************************************************************"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post scylla-jmx.service
|
%systemd_post scylla-jmx.service
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
package org.apache.cassandra.locator;
|
package org.apache.cassandra.locator;
|
||||||
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
@ -63,6 +64,9 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
|||||||
public String getRack(String host) throws UnknownHostException {
|
public String getRack(String host) throws UnknownHostException {
|
||||||
log("getRack(String host) throws UnknownHostException");
|
log("getRack(String host) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||||
|
if (host == null) {
|
||||||
|
host = InetAddress.getLoopbackAddress().getHostAddress();
|
||||||
|
}
|
||||||
queryParams.add("host", host);
|
queryParams.add("host", host);
|
||||||
return c.getStringValue("/snitch/rack", queryParams);
|
return c.getStringValue("/snitch/rack", queryParams);
|
||||||
}
|
}
|
||||||
@ -77,6 +81,9 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
|||||||
public String getDatacenter(String host) throws UnknownHostException {
|
public String getDatacenter(String host) throws UnknownHostException {
|
||||||
log(" getDatacenter(String host) throws UnknownHostException");
|
log(" getDatacenter(String host) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||||
|
if (host == null) {
|
||||||
|
host = InetAddress.getLoopbackAddress().getHostAddress();
|
||||||
|
}
|
||||||
queryParams.add("host", host);
|
queryParams.add("host", host);
|
||||||
return c.getStringValue("/snitch/datacenter", queryParams);
|
return c.getStringValue("/snitch/datacenter", queryParams);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user