Powered By Blogger

Tuesday, November 20, 2018

Influx Grafana JMXtrans setup

install grafana

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.4-1.x86_64.rpm
sudo service grafana-server start


Access the port
http://10.61.177.235:3000/?orgId=1 should be working


Install influx
https://www.influxdata.com/blog/package-repository-for-linux/



Insall influx

Do it as root user

cat <[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/centos/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF


sudo yum install influxdb

sudo service influxdb start


> SHOW RETENTION POLICIES ON kafka
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 0s       168h0m0s           1        true
>




Install jmxtrans
 wget -q https://raw.githubusercontent.com/jmxtrans/jmxtrans/master/jmxtrans/jmxtrans.sh

$ chmod +x jmxtrans.sh

JMXTRANS_OPTS=“-DinfluxUrl=http://10.60.237.207:8086/ -DinfluxDb=kafka -DinfluxUser=admin -DinfluxPwd=admin” SECONDS_BETWEEN_RUNS=15 JAR_FILE=jmxtrans-265-all.jar ./jmxtrans.sh start odsconsumer.json

wget http://central.maven.org/maven2/org/jmxtrans/jmxtrans/265/jmxtrans-265-all.jar
wget -q https://raw.githubusercontent.com/jmxtrans/jmxtrans/master/jmxtrans/jmxtrans.sh

Thursday, November 8, 2018

Setting Data type to avoid chld cursor issue

13.7 Common problems with parameter and data value handling in Spring DAO

Common problems with parameters and data values exist in the different approaches provided by the Spring Framework JDBC.

13.7.1 Providing SQL type information for parameters

Usually Spring determines the SQL type of the parameters based on the type of parameter passed in. It is possible to explicitly provide the SQL type to be used when setting parameter values. This is sometimes necessary to correctly set NULL values.
You can provide SQL type information in several ways:
  • Many update and query methods of the JdbcTemplate take an additional parameter in the form of an int array. This array is used to indicate the SQL type of the coresponding parameter using constant values from the java.sql.Types class. Provide one entry for each parameter.
  • You can use the SqlParameterValue class to wrap the parameter value that needs this additional information. Create a new instance for each value and pass in the SQL type and parameter value in the constructor. You can also provide an optional scale parameter for numeric values.
  • For methods working with named parameters, use the SqlParameterSource classes BeanPropertySqlParameterSource or MapSqlParameterSource. They both have methods for registering the SQL type for any of the named parameter values.


MapSqlParameterSource namedParameters = new MapSqlParameterSource();
// OrderDomain orderDomain = new OrderDomain(schema);
namedParameters.addValue("basan_order_key",orderDomain.getOmsOrderKey(), Types.VARCHAR) ;

Sunday, October 1, 2017

Maven LifeCyle

Build LifeCylce:
Maven lifeCyle will have steps or phases

Maven has 3 built inLifecyles

    default(jar, war) . It has 23 phases.
    clean
site

 mvn help:describe -Dcmd=clean
   [INFO] 'clean' is a lifecycle with the following phases:
   * pre-clean: Not defined
   * clean: org.apache.maven.plugins:maven-clean-plugin:2.5:clean
   * post-clean: Not defined


 mvn help:describe -Dcmd=site
   [INFO] 'site' is a lifecycle with the following phases:
   * pre-site: Not defined
   * site: org.apache.maven.plugins:maven-site-plugin:3.3:site
   * post-site: Not defined
   * site-deploy: org.apache.maven.plugins:maven-site-plugin:3.3:deploy


Each Lifecycle will have its own phases.
  goal will bind to particular phase.(method). Some action will be performed for each goal.

When lifecycle gets executes then goals will be used.


We excute phases from command line
mvn clean install



Getting the help of a page

mvn help:describe -Dcmd=deploy
It is a part of the lifecycle for the POM packaging 'jar'. This lifecycle includes the following phases:
* validate: Not defined
* initialize: Not defined
* generate-sources: Not defined
* process-sources: Not defined
* generate-resources: Not defined
* process-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:resources
* compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
* process-classes: Not defined
* generate-test-sources: Not defined
* process-test-sources: Not defined
* generate-test-resources: Not defined
* process-test-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
* test-compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
* process-test-classes: Not defined
* test: org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
* prepare-package: Not defined
* package: org.apache.maven.plugins:maven-jar-plugin:2.4:jar
* pre-integration-test: Not defined
* integration-test: Not defined
* post-integration-test: Not defined
* verify: Not defined
* install: org.apache.maven.plugins:maven-install-plugin:2.4:install
* deploy: org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy



mvn help:describe -Dcmd=package
[INFO] 'package' is a phase corresponding to this plugin:
org.apache.maven.plugins:maven-jar-plugin:2.4:jar

It is a part of the lifecycle for the POM packaging 'jar'. This lifecycle includes the following phases:
* validate: Not defined
* initialize: Not defined
* generate-sources: Not defined
* process-sources: Not defined
* generate-resources: Not defined
* process-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:resources
* compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
* process-classes: Not defined
* generate-test-sources: Not defined
* process-test-sources: Not defined
* generate-test-resources: Not defined
* process-test-resources: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
* test-compile: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
* process-test-classes: Not defined
* test: org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
* prepare-package: Not defined
* package: org.apache.maven.plugins:maven-jar-plugin:2.4:jar
* pre-integration-test: Not defined
* integration-test: Not defined
* post-integration-test: Not defined
* verify: Not defined
* install: org.apache.maven.plugins:maven-install-plugin:2.4:install
* deploy: org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy



Get effective POM
mvn help:effective-pom

Goals And Plugins

Goals - can be considered as tasks - equivalent to methods
Plugins will have multiple goals - equivalent to  Class

Seeing plugin details
mvn help:describe -Dplugin=compiler

Executing goal/phases of plugin
mvn compliler:compile
mvn compliler:testCompile
mvn compiler:help -Ddetail=true -Dgoal=compile


plugin can be called by either specifying the direct goal or the phase for which its been tied to.






Monday, March 27, 2017

Thursday, August 4, 2016

Tomcat debug ALfresco

Hi Team ,
Follow below steps for setting up the debugger when Alfresco is running as service in the Windows environment.

1.       Navigate the folder where alfresco is been installed in the Command prompt.
Cd D:\Installs\alfrescoServer\tomcat\bin
2.       Now run the below command
.\tomcat7w.exe //ES//alfrescoTomcat
3.       It will open the below popup

4.       In this open the tab Java and add the below values in the Java options
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n


5.       Click Apply and OK. By doing this we have made service aware of debugging.
6.       Restart the alfresco server.
7.       In Eclipse Connect to the remote application by configuring the port 8000

8.       Click on Debug and Happy debugging J


Monday, August 1, 2016

Too manu open files

Another important thing to verify is that, your process is not leaking file descriptors or handles, well that's a tedious thing to find out, but you can use lsof command to check how many open file handles is owned by a particular process in UNIX or Linux

Read more: http://javarevisited.blogspot.com/2013/08/how-to-fix-javanetsocketexception-too-many-open-files-java-tomcat-weblogic.html#ixzz4G4VH3yK7

Wednesday, June 8, 2016

Peer association can be done with below code in content model


         
           
               
                  cm:avatarOf
                  false
                  false
             
               
                  cm:content
                  cm:hasAvatar
                  false
                  false
               
           
       


0 or 1 => mandatory = false and many = false
1 => mandatory = true and many = false
0 or more => mandatory = false and many = true
1 or more => mandatory = true and many = true

Peer Association will be dispayed as below
Associations
Association Type
Target Reference
Target Type
cm:avatar
cm:content