Posts

Showing posts from 2015

Accessing all highcharts in a page at once

Recently I needed to call a reflow method of all hi-charts in the page for a particular event. I used following method for that. function redrawHighcharts() {     for (var i = 0; i < Highcharts.charts.length; i++) {         Highcharts.charts[i].reflow();     } }

Fixing Unicode issues in Pentaho CDA

Recently I encountered problem when sending a query parameter with unicode text to Pentaho CDA. For these type of queries CDA returns an empty result set although there are matching items. After some research I fixed this issue by adding an additional parameter to the JDBC connection url. Now JDBC connection is like below. <DataSources>         <Connection id="1" type="sql.jdbc">             <Driver>com.mysql.jdbc.Driver</Driver>             <Url>jdbc:mysql://host:3306/DB?useUnicode=true&amp;characterEncoding=UTF-8</Url>             <User>user</User>             <Pass>pass</Pass>         </Connection>  </DataSources>

Creating a Pentaho BI server cluster

Image
Note - This is applicable to Pentaho BI server community edition 5.x only. Pentaho BI server provides a large set of features which are essential for  BI applications. To use this in production we might need to create a CDA cluster to maintain high availability as well as load balancing. To create a cluster we need to configure BI server instances to use a common data source to store configurations. I configured the following setup for this. Follow these steps to create the cluster. Install MySQL servers and setup master master replication. Make sure you have installed Oracle Java 7 in all nodes. Using other java versions will cause runtime errors. Follow  this  document to to install a CDA instance. Make sure to follow the document named "Install with Your Own BA Repository" and follow the configurations related to MySQL.  Start the server and install all the components needed. Modify the cluster documentation as mentioned in this document.  htt...

Deploying a HA Redis setup

Image
Sentinel process takes the responsibility of electing a slave as master if a failure occurs. For more information refer  this . Install Redis in each node. Following methods can be used to install Redis. Using Ubuntu repositories.  sudo apt-get install redis-server Manual installation You can download a Redis distribution from this page  http://redis.io/download . Follow the instructions on this page to setup Redis using the downloaded setup  https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis Set requirepass property to set the password in the configuration file in /etc/redis. Note that this should be same in all nodes. Set Up replication Set the following properties to set replication on slaves. slaveof <masterip> <m...

Bind a remote server's port to a local port

If you have a remote server (say in Amazon EC2) you might want to access a particular port of that server. But there can be situations where it is not that port is not globally open. If you do not want to bother making it globally open you can use it by binding it to a local port of your workstation via ssh. Following command will bind port 9000 of remote machine to your local port 8000.  As an example if it is web server you can easily access it by typing localhost:8000 in your web browser. ssh -L 8000:localhost:9000 username@host