关于Ubuntu安装iPortal的预前准备知识,包括安装相关包,修改相关的libmawt.so文件等,可以参考前面的iServer的安装部署,里面已经有详细的介绍。
http://blog.csdn.net/chinagissoft/article/details/45092713
安装环境:
Ubuntu 14.04 Server LTS
iPortal 7.1.2版本(部署包)192.168.195.138
MySQL 5.6版本 192.168.195.134 root/root
其实安装步骤非常简单,参考iserver介绍即可。由于iportal默认采用的是SQLite数据库来存储相关的iPortal表,但是在实际业务过程中建议使用MySQL数据库,这样可以提高iportal的并发性能。
1、保证MySQL的服务器的防火墙和端口号,iportal集群可以连通,最后安装一个MySQL客户端可以测试是否连通
2、修改iPortal配置文件,将默认的SQLite连接信息去掉,添加MySQL的连接信息,系统已经将相关信息配置好了,只需要用户注释掉SQLite,反注释掉(启用)MySQL即可
<dataSourceConnectionPoolInfo> <!-- SQLITE数据库连接池设置 --> <!-- 数据库类型 --> <!-- SQLITE,MYSQL --> <dbType>SQLITE</dbType> <!-- 数据库驱动的类全名 --> <driverClass>org.sqlite.JDBC</driverClass> <!-- 连接至驱动的url,对于sqlite数据库文件路径,如果使用相对路径,则是相对于iPortal home的路径。--> <jdbcUrl>jdbc:sqlite:./WEB-INF/iportaldata/iportal.db</jdbcUrl> <!-- 连接池在同一时刻内所提供最大活动连接数 --> <maxPoolSize>1</maxPoolSize> <!-- 初始化连接池大小 --> <initialPoolSize>1</initialPoolSize> <!-- 连接池在同一时刻内所提供最小活动连接数 --> <minPoolSize>1</minPoolSize> <!-- 最大空闲时间,maxIdleTime秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 --> <maxIdleTime>3000</maxIdleTime> <!-- 当发生异常时数据库等待最大毫秒数(当没有可用连接时) --> <maxWait>30000</maxWait> <!-- 用户名 --> <!-- sqlite数据库用户名密码可以为空 --> <username>supermap</username> <!-- 密码 --> <password>supermap</password> <!-- MYSQL数据库连接池设置,门户数据存储默认采用SQLITE数据库,建议选用MYSQL数据库 --> <!-- <dbType>MYSQL</dbType> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>jdbc:mysql://localhost:3306/iportal?useUnicode=true&characterEncoding=UTF-8</jdbcUrl> <maxPoolSize>30</maxPoolSize> <initialPoolSize>5</initialPoolSize> <minPoolSize>5</minPoolSize> <maxIdleTime>3000</maxIdleTime> <maxWait>300000</maxWait> <username>root</username> <password></password> --> </dataSourceConnectionPoolInfo>
我们可以修改MYSQL的配置信息
<dataSourceConnectionPoolInfo> <!-- SQLITE数据库连接池设置 --> <!-- 数据库类型 --> <dbType>MYSQL</dbType> <driverClass>com.mysql.jdbc.Driver</driverClass> <jdbcUrl>jdbc:mysql://192.168.195.134:3306/iportal?useUnicode=true&characterEncoding=UTF-8</jdbcUrl> <maxPoolSize>30</maxPoolSize> <initialPoolSize>5</initialPoolSize> <minPoolSize>5</minPoolSize> <maxIdleTime>3000</maxIdleTime> <maxWait>300000</maxWait> <username>root</username> <password>root</password> </dataSourceConnectionPoolInfo>
注意:MySQL默认禁止非本机访问,如果 SuperMap iPortal7C 和 MySQL不在同一台机器中, 需要远程连接 MySQL,那么可以本机登入 MySQL后,更改 “mysql”数据库里的“user” 表里的 第一条记录表里的第一条记录“host”项,从项“local host” 改成'%',重启MySQL即可.
然后,重启iPortal服务即可,但是打开http://192.168.195.138:8090/iportal/链接地址提示错误,查看相关的日志信息发现如下:
2015-5-3 12:45:16 - WARN - com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6bbdb669 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'iportal' at sun.reflect.GeneratedConstructorAccessor42.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:910) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3923) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1273) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.GeneratedConstructorAccessor39.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)
系统提示未知的iportal数据库名,这是因为需要用户手动在MYSQL创建相关的iportal数据库,或者自己创建其他名称的数据库,然后修改相关的jdbc链接字符串也可以
jdbc:mysql://192.168.195.134:3306/iportal?useUnicode=true&characterEncoding=UTF-8
在MySQL数据库创建iportal数据库
mysql> create database iportal; Query OK, 1 row affected (0.07 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | iportal | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.00 sec)
然后重新启动服务即可