-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #525 from Hurence/feature/LOGISLAND-513-historian-…
…gateway Feature/logisland 513 historian gateway
- Loading branch information
Showing
440 changed files
with
17,477 additions
and
20,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
logisland-components/logisland-gateway-historian/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#Build historian gateway | ||
|
||
run : | ||
```shell script | ||
mvn clean install | ||
``` | ||
|
||
require some other logisland module, if it fails try this : | ||
|
||
```shell script | ||
mvn -pl :logisland-gateway-historian -am clean install -DskipTests | ||
``` | ||
|
||
#Run server on local | ||
|
||
run : | ||
```shell script | ||
java -jar target/logisland-gateway-historian-1.2.0-fat.jar -conf target/classes/config.json | ||
``` | ||
|
||
#Run server with docker-compose | ||
|
||
in logisland-quickstart project you can run a pipeline that injects data into solr. | ||
You have access to solr UI, a grafana with a predefined historian dashboard. | ||
|
||
in root folder of projct **logisland-quickstart** run : | ||
|
||
```shell script | ||
docker-compose -f docker-compose.yml -f docker-compose.historian.yml up -d | ||
``` | ||
|
||
then follow the timeseries tutorial to inject timeseries : https://logisland.github.io/docs/guides/timeseries-guide | ||
|
||
Go to grafana at http://localhost:3000. | ||
* user: admin | ||
* mdp: admin. | ||
|
||
Go to the historian dashboard and see your data ! We added three variables so that you can specify | ||
the sampling algorithm to use, the bucket size or filter on a tag. Currently tags are just the name of the metric but we could | ||
imagine tagging several different metric names with a same tag. For exemple 'temp' for metrics 'temp_a' and 'temp_b'. | ||
|
||
By default no sampling is used if there is not too many point to draw. Otherwise we calculate the bucket size depending on | ||
the total number of points that is being queried with the average algorithm. At the moment only basic algorithms are available. | ||
|
||
#Run server on cluster | ||
|
||
TODO | ||
```shell script | ||
java -jar <jar_path> -cluster -conf <conf_path> | ||
``` | ||
|
||
#RUN TEST | ||
mark the folder ./src/integration-test/java as source test code in your IDE. | ||
mark the folder ./src/integration-test/resources as resources test in your IDE. | ||
|
||
Then run : | ||
```shell script | ||
mvn clean install -Pbuild-integration-tests | ||
``` | ||
|
||
to build integration tests source class ! Then you can run the test in your IDE. | ||
|
||
|
||
#TROUBLESHOOT | ||
|
||
When code generator fails. It may be because of hidden char ? This is really irritating. | ||
I fought with javadoc... Sometimes I could not succeed into making it working. |
12 changes: 12 additions & 0 deletions
12
logisland-components/logisland-gateway-historian/docker/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM vertx/vertx3 | ||
|
||
ENV HISTORIAN_HOME /opt/historian/ | ||
EXPOSE 8080 | ||
|
||
COPY ./logisland-gateway-historian-1.2.0-fat.jar $HISTORIAN_HOME | ||
COPY ./config.json $HISTORIAN_HOME/conf/ | ||
COPY ./log4j.properties $HISTORIAN_HOME/ | ||
|
||
WORKDIR $HISTORIAN_HOME | ||
|
||
ENTRYPOINT ["java", "-Dlog4j.configuration=file:log4j.properties", "-jar", "./logisland-gateway-historian-1.2.0-fat.jar", "-conf" , "./conf/config.json"] |
49 changes: 49 additions & 0 deletions
49
logisland-components/logisland-gateway-historian/docker/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Historian docker files | ||
====================== | ||
|
||
Build your own | ||
-------------- | ||
|
||
use appropriate version of jar ! | ||
|
||
Build historian-gateway | ||
|
||
```shell script | ||
mvn clean package | ||
``` | ||
|
||
copy paste jar and conf file | ||
|
||
```shell script | ||
cd ./docker | ||
cp ../target/logisland-gateway-historian-1.2.0-fat.jar . | ||
cp ../target/classes/config.json . | ||
``` | ||
|
||
Building the image, modify version of jar in ENTRYPOINT if needed | ||
|
||
```shell script | ||
docker build --rm -t hurence/historian . | ||
docker tag hurence/historian:latest hurence/historian:1.2.0 | ||
``` | ||
|
||
Deploy the image to Docker hub | ||
------------------------------ | ||
|
||
tag the image as latest | ||
|
||
verify image build : | ||
|
||
```shell script | ||
docker images | ||
docker tag <IMAGE_ID> latest | ||
``` | ||
|
||
then login and push the latest image | ||
|
||
```shell script | ||
docker login | ||
docker push hurence/historian | ||
```` | ||
|
||
|
23 changes: 23 additions & 0 deletions
23
logisland-components/logisland-gateway-historian/docker/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"web.verticles.instance.number": 2, | ||
"historian.verticles.instance.number": 1, | ||
"server" : { | ||
"host": "0.0.0.0", | ||
"port" : 8080, | ||
"historian.address": "historian", | ||
"default" : { | ||
"page" : 1, | ||
"size" : 10 | ||
} | ||
}, | ||
"historian": { | ||
"address" : "historian", | ||
"solr" : { | ||
"use_zookeeper": true, | ||
"zookeeper_urls": ["zookeeper:2181"], | ||
"collection": "historian", | ||
"stream_url": "http://solr1:8983/solr/historian/stream", | ||
"urls": ["http://solr1:8983/solr","http://solr2:8983/solr"] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
logisland-components/logisland-gateway-historian/docker/log4j.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This sets the global logging level and specifies the appenders | ||
log4j.rootLogger=INFO, theConsoleAppender, rollingFile | ||
|
||
# settings for the console appender | ||
log4j.appender.theConsoleAppender=org.apache.log4j.ConsoleAppender | ||
log4j.appender.theConsoleAppender.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.theConsoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %l - %m%n | ||
|
||
log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender | ||
log4j.appender.rollingFile.File=application.log | ||
log4j.appender.rollingFile.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.rollingFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n | ||
log4j.appender.rollingFile.MaxFileSize=10MB | ||
log4j.appender.rollingFile.MaxBackupIndex=5 | ||
log4j.appender.rollingFile.append=true | ||
|
||
#log4j.rootCategory=ALL, rollingFile | ||
|
||
#log4j.logger.org.apache.geronimo.system.logging.log4j.Log4jService=INFO |
Oops, something went wrong.