最近的项目需要使用到saiku olap查询工具,saiku现在比较新的版本是3.7,可以在github或者官网上下载源码,但是我使用源码没有运行起来,尝试了很多种方式,但是没有成功。
最后下了一个2.5版本的,没有源码只有两个war包。下面介绍一下saiku的部署方式。
1、将saiku-ui-2.5.war 改为 ROOT.war,将saiku-webapp-2.5.war 改为 saiku.war,将这两个 文件拷贝到tomcat
下面的webapps目录下面,完成以后启动tomcat,访问localhost:8080地址,使用admin/admin登录,不出意外的话是可以登录成功的。
2、停止tomcat,将对应数据库的驱动拷贝到tomcat libs目录下。
3、声明cube:
拷贝Mondrian schema(sales_mondrian_schema.xml)文件到tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources/
在tomcat/webapps/saiku/WEB-INF/classes/saiku-datasources/目录下创建一个文件命名为sales.txt(扩展名无所谓,可以随便命名)并写入以下内容:
#declaration of Sauce Dallas sales cube for Sakiu
#———————————————
type=OLAP
name=SauceDallas
driver=mondrian.olap4j.MondrianOlap4jDriver
location=jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/saiku;Catalog=res:saiku-datasources/sales_mondrian_schema.xml;JdbcDrivers=com.mysql.jdbc.Driver;
username=root
password=password
这个时候再次启动tomcat 就可以使用了
文中使用文件下载地址请到个人上传的资源中下载。