Skip to content

Instantly share code, notes, and snippets.

View slaskawi's full-sized avatar

Sebastian Łaskawiec slaskawi

  • MongoDB
  • Poland
View GitHub Profile
curl --digest -L -D - "http://localhost:9990/management/subsystem/datagrid-infinispan/cache-container/clustered/health/HEALTH?operation=resource&include-runtime=true&json.pretty=1" --header "Content-Type: application/json" -u ispnadmin:ispnadmin
HTTP/1.1 401 Unauthorized
Connection: keep-alive
WWW-Authenticate: Digest realm="ManagementRealm",domain="/management",nonce="AuZzFxz7uC4NMTQ3MDgyNTU1NTQ3OCfIJBHXVpPHPBdzGUy7Qts=",opaque="00000000000000000000000000000000",algorithm=MD5,qop="auth"
Content-Length: 77
Content-Type: text/html
Date: Wed, 10 Aug 2016 10:39:15 GMT
HTTP/1.1 200 OK
Connection: keep-alive
ispn-cli.sh -c "/subsystem=datagrid-infinispan/cache-container=clustered/health=HEALTH:read-resource(include-runtime=true)"
{
"outcome" => "success",
"result" => {
"cache-health" => "HEALTHY",
"cluster-health" => ["test"],
"cluster-name" => "clustered",
"free-memory" => 99958L,
"log-tail" => [
embeddedCacheManager
.getHealth()
.getClusterHealth()
.getNumberOfNodes() // Those two methods allow to control if
.getNodeNames() // proper number of nodes joined the cluster
.getClusterName() // Might be helpful for managing multiple clusters
.getHealthStatus() // UNHEALTHY, HEALTHY, REBALANCING
.getHostInfo()
.getNumberOfCpus() // Those 3 methods might be
.getTotalMemoryKb() // useful for dynamic Cloud
# Git repo
# https://github.com/tnozicka/gopipelines
# (optional) pre-pull images
docker pull openshift/origin-sti-builder:v1.4.1
docker pull openshift/origin-deployer:v1.4.1
docker pull openshift/origin-docker-registry:v1.4.1
docker pull openshift/origin-haproxy-router:v1.4.1
docker pull openshift/origin:v1.4.1
docker pull openshift/origin-pod:v1.4.1
@slaskawi
slaskawi / InfinispanCacheConfiguration.java
Created December 19, 2016 08:18
Spring Boot Starters - Embedded configuration
@Configuration
public class InfinispanCacheConfiguration {
public static final String TEST_CLUSTER = "TEST_CLUSTER";
public static final String TEST_CACHE_NAME = "test-simple-cache";
public static final String TEST_GLOBAL_JMX_DOMAIN = "test.infinispan";
@Bean
public InfinispanCacheConfigurer cacheConfigurer() {
return cacheManager -> {
@slaskawi
slaskawi / pom.xml
Created December 19, 2016 08:15
Spring Boot Starters - Embedded pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
@slaskawi
slaskawi / InfinispanCacheConfiguration.java
Last active December 19, 2016 08:11
Spring Boot Starters - Remote configuration
@Configuration
public class InfinispanCacheConfiguration {
public static final String IP = "192.168.0.17";
@Bean
public InfinispanRemoteConfigurer infinispanRemoteConfigurer() {
return () -> new ConfigurationBuilder().addServer().host(IP).build();
}
}
@slaskawi
slaskawi / hotrod-client.properties
Created December 19, 2016 08:08
Hot Rod properties
infinispan.client.hotrod.server_list=192.168.0.17:11222
@slaskawi
slaskawi / pom.xml
Created December 19, 2016 08:05
Spring Boot Starters - Remote pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>myproject</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
@SpringBootApplication
public class SpringBootApp {
private static final String CACHE_NAME = "test";
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* This bean is optional but it shows how to inject {@link org.infinispan.configuration.global.GlobalConfiguration}.
*/
@Bean