Change version
This commit is contained in:
parent
cd30267633
commit
c43992ba08
4
dist/redhat/scylla-jmx.spec
vendored
4
dist/redhat/scylla-jmx.spec
vendored
@ -64,10 +64,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/scylla-jmx
|
||||
%{_unitdir}/scylla-jmx.service
|
||||
/opt/scylladb/jmx/scylla-jmx
|
||||
/opt/scylladb/jmx/scylla-jmx-1.0.jar
|
||||
/opt/scylladb/jmx/scylla-jmx-1.1.jar
|
||||
/opt/scylladb/jmx/symlinks/scylla-jmx
|
||||
%{_prefix}/lib/scylla/jmx/scylla-jmx
|
||||
%{_prefix}/lib/scylla/jmx/scylla-jmx-1.0.jar
|
||||
%{_prefix}/lib/scylla/jmx/scylla-jmx-1.1.jar
|
||||
%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx
|
||||
|
||||
%changelog
|
||||
|
@ -89,12 +89,10 @@ if ! $packaging; then
|
||||
has_java=false
|
||||
if [ -x /usr/bin/java ]; then
|
||||
javaver=$(/usr/bin/java -version 2>&1|head -n1|cut -f 3 -d " ")
|
||||
if [[ "$javaver" =~ ^\"1.8.0 || "$javaver" =~ ^\"11.0. ]]; then
|
||||
has_java=true
|
||||
fi
|
||||
fi
|
||||
if ! $has_java; then
|
||||
echo "Please install openjdk-8 or openjdk-11 before running install.sh."
|
||||
echo "Please install openjdk-8, openjdk-11, or openjdk-17 before running install.sh."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@ -152,12 +150,12 @@ WorkingDirectory=$rprefix
|
||||
EOS
|
||||
fi
|
||||
|
||||
install -m644 scylla-jmx-1.0.jar "$rprefix/jmx"
|
||||
install -m644 scylla-jmx-1.1.jar "$rprefix/jmx"
|
||||
install -m755 scylla-jmx "$rprefix/jmx"
|
||||
ln -sf /usr/bin/java "$rprefix/jmx/symlinks/scylla-jmx"
|
||||
if ! $nonroot; then
|
||||
install -m755 -d "$rusr"/lib/scylla/jmx/symlinks
|
||||
ln -srf "$rprefix"/jmx/scylla-jmx-1.0.jar "$rusr"/lib/scylla/jmx/
|
||||
ln -srf "$rprefix"/jmx/scylla-jmx-1.1.jar "$rusr"/lib/scylla/jmx/
|
||||
ln -srf "$rprefix"/jmx/scylla-jmx "$rusr"/lib/scylla/jmx/
|
||||
ln -sf /usr/bin/java "$rusr"/lib/scylla/jmx/symlinks/scylla-jmx
|
||||
fi
|
||||
|
6
pom.xml
6
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>scylla-jmx</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
@ -35,8 +35,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<compilerArgs>
|
||||
<arg>--add-exports</arg>
|
||||
<arg>java.management/com.sun.jmx.mbeanserver=scylla.jmx</arg>
|
||||
|
@ -57,7 +57,7 @@ ar.reloc_add('build/SCYLLA-VERSION-FILE', arcname='SCYLLA-VERSION-FILE')
|
||||
ar.reloc_add('build/SCYLLA-PRODUCT-FILE', arcname='SCYLLA-PRODUCT-FILE')
|
||||
ar.reloc_add('dist')
|
||||
ar.reloc_add('install.sh')
|
||||
ar.reloc_add('target/scylla-jmx-1.0.jar', arcname='scylla-jmx-1.0.jar')
|
||||
ar.reloc_add('target/scylla-jmx-1.1.jar', arcname='scylla-jmx-1.1.jar')
|
||||
ar.reloc_add('scripts/scylla-jmx', arcname='scylla-jmx')
|
||||
ar.reloc_add('README.md')
|
||||
ar.reloc_add('NOTICE')
|
||||
|
@ -131,11 +131,13 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$LOCATION_SCRIPTS"/symlinks/scylla-jmx $DEBUG \
|
||||
"$LOCATION_SCRIPTS"/symlinks/scylla-jmx $DEBUG \
|
||||
$API_PORT $API_ADDR $CONF_FILE -Xmx256m -XX:+UseSerialGC \
|
||||
-XX:+HeapDumpOnOutOfMemoryError \
|
||||
$JMX_AUTH $JMX_SSL $JMX_ADDR $JMX_LOCAL \
|
||||
--add-exports java.management/com.sun.jmx.mbeanserver=scylla.jmx \
|
||||
--add-exports java.management/com.sun.jmx.interceptor=scylla.jmx \
|
||||
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT \
|
||||
-Djava.rmi.server.hostname=$HOSTNAME -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT \
|
||||
-Djavax.management.builder.initial=com.scylladb.jmx.utils.APIBuilder \
|
||||
$PROPERTIES -jar $LOCATION/scylla-jmx-1.0.jar
|
||||
$PROPERTIES -jar $LOCATION/scylla-jmx-1.1.jar
|
||||
|
@ -21,6 +21,11 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.parsson</groupId>
|
||||
<artifactId>parsson</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
@ -41,6 +46,11 @@
|
||||
<artifactId>jersey-client</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.inject</groupId>
|
||||
<artifactId>jersey-hk2</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.json</groupId>
|
||||
<artifactId>jakarta.json-api</artifactId>
|
||||
@ -80,7 +90,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<release>17</release>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -102,7 +102,12 @@ public class APIClient {
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
return webTarget.request(MediaType.APPLICATION_JSON);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public Invocation.Builder get(String path) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
module scylla.apiclient {
|
||||
exports com.scylladb.jmx.api;
|
||||
exports com.scylladb.jmx.api.utils;
|
||||
requires org.eclipse.parsson;
|
||||
requires jakarta.ws.rs;
|
||||
requires com.fasterxml.jackson.jakarta.rs.json;
|
||||
requires jersey.client;
|
||||
@ -10,4 +11,5 @@ module scylla.apiclient {
|
||||
requires org.yaml.snakeyaml;
|
||||
requires com.google.common;
|
||||
requires jersey.common;
|
||||
requires jersey.hk2;
|
||||
}
|
@ -27,12 +27,27 @@ import com.scylladb.jmx.api.APIConfig;
|
||||
import com.scylladb.jmx.metrics.APIMBean;
|
||||
|
||||
public class Main {
|
||||
// todo: command line options. Make us an agent class (also)
|
||||
private static final APIConfig config = new APIConfig();
|
||||
public static final APIClient client = new APIClient(config);
|
||||
|
||||
private static APIConfig config;
|
||||
private static APIClient client;
|
||||
|
||||
public static synchronized APIConfig getApiConfig() {
|
||||
if (config == null) {
|
||||
config = new APIConfig();
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
public static synchronized APIClient getApiClient() {
|
||||
if (client == null) {
|
||||
client = new APIClient(getApiConfig());
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Connecting to " + config.getBaseUrl());
|
||||
System.out.printf("Java %s%n", System.getProperty("java.version"));
|
||||
System.out.printf("Connecting to %s%n", getApiConfig().getBaseUrl());
|
||||
System.out.println("Starting the JMX server");
|
||||
|
||||
MBeanServer server = getPlatformMBeanServer();
|
||||
@ -40,7 +55,7 @@ public class Main {
|
||||
CommitLog.class, Gossiper.class, EndpointSnitchInfo.class, FailureDetector.class, CacheService.class,
|
||||
CompactionManager.class, GCInspector.class, StreamManager.class)) {
|
||||
Constructor<? extends APIMBean> c = clazz.getDeclaredConstructor(APIClient.class);
|
||||
APIMBean m = c.newInstance(client);
|
||||
APIMBean m = c.newInstance(getApiClient());
|
||||
server.registerMBean(m, null);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.scylladb.jmx.utils;
|
||||
* Copyright 2016 ScyllaDB
|
||||
*/
|
||||
|
||||
import static com.scylladb.jmx.main.Main.client;
|
||||
import static com.scylladb.jmx.main.Main.getApiClient;
|
||||
import static com.sun.jmx.mbeanserver.Util.wildmatch;
|
||||
import static java.util.logging.Level.SEVERE;
|
||||
import static javax.management.MBeanServerDelegate.DELEGATE_NAME;
|
||||
@ -491,6 +491,6 @@ public class APIBuilder extends MBeanServerBuilder {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return new APIMBeanServer(client, nested);
|
||||
return new APIMBeanServer(getApiClient(), nested);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
module scylla.jmx {
|
||||
opens com.scylladb.jmx.utils;
|
||||
exports com.scylladb.jmx.utils;
|
||||
opens com.scylladb.jmx.main;
|
||||
exports com.scylladb.jmx.main;
|
||||
opens com.scylladb.jmx.metrics;
|
||||
exports com.scylladb.jmx.metrics;
|
||||
requires java.logging;
|
||||
requires java.management;
|
||||
requires scylla.apiclient;
|
||||
|
Loading…
Reference in New Issue
Block a user