留言板
Problem adding extra database to existing sharded Liferay 6.0 EE SP2
Magnus Smith,修改在12 年前。
Problem adding extra database to existing sharded Liferay 6.0 EE SP2
New Member 帖子: 3 加入日期: 11-3-18 最近的帖子
Liferay Portal Enterprise Edition 6.0 EE SP2 running with database sharding.
In our current test configuration I have 3 data sources
This is running nicely but now we want to add an extra data source. I've added the following datasource in portal-ext.properties
and updated the available names.
I've overridden
and adding the entry to datasources property
Now when I restart the portal server I get the following log message
but the database tables do not get created.
If I delete all the databases and start from fresh then they get created correctly.
The behaviour is the same in both Mysql and Oracle
Is there a workaround to allow me to add a new database to an existing sharded liferay?
In our current test configuration I have 3 data sources
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
jdbc.one.driverClassName=com.mysql.jdbc.Driver
jdbc.one.url=jdbc:mysql://localhost/lportal1?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.one.username=root
jdbc.one.password=root
jdbc.two.driverClassName=com.mysql.jdbc.Driver
jdbc.two.url=jdbc:mysql://localhost/lportal2?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.two.username=root
jdbc.two.password=root
shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
shard.available.names=default,one,two
shard.default.name=default
This is running nicely but now we want to add an extra data source. I've added the following datasource in portal-ext.properties
jdbc.three.driverClassName=com.mysql.jdbc.Driver
jdbc.three.url=jdbc:mysql://localhost/lportal3?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.three.username=root
jdbc.three.password=root
and updated the available names.
shard.available.names=default,one,two,three
I've overridden
shard-data-source-spring.xml
with the extra datasource by adding
<bean id="shardDataSource3" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
<property name="propertyPrefix" value="jdbc.three." />
</bean>
</property>
</bean>
and adding the entry to datasources property
<entry>
<key>
<value>three</value>
</key>
<ref bean="shardDataSource3" />
</entry>
Now when I restart the portal server I get the following log message
INFO [ShardDataSourceTargetSource:73] Sharding configured with 4 data sources
but the database tables do not get created.
If I delete all the databases and start from fresh then they get created correctly.
The behaviour is the same in both Mysql and Oracle
Is there a workaround to allow me to add a new database to an existing sharded liferay?
Kris Sokolovski,修改在11 年前。
RE: Problem adding extra database to existing sharded Liferay 6.0 EE SP2
New Member 帖子: 8 加入日期: 11-11-14 最近的帖子
Hi Magnus,
I think, You've done everything correctly. But as I can see, You miss one more thing!
The database won't create automaticaly. You should create a new schema 'lportal3' and run SQL scripts to create minimal-database. We are using MySQL DB, so I would use 'create-minimal-mysql.sql' which can be found in Liferay Downloads 'liferay-portal-sql-6.1.20-ee-ga2' - just pay attention what version do You use.
Also, please check 'create-minimal-mysql.sql' content and replace all 'lportal' to 'lportal3'.
Hope that helps!
Regards,
Kris
I think, You've done everything correctly. But as I can see, You miss one more thing!
The database won't create automaticaly. You should create a new schema 'lportal3' and run SQL scripts to create minimal-database. We are using MySQL DB, so I would use 'create-minimal-mysql.sql' which can be found in Liferay Downloads 'liferay-portal-sql-6.1.20-ee-ga2' - just pay attention what version do You use.
Also, please check 'create-minimal-mysql.sql' content and replace all 'lportal' to 'lportal3'.
Hope that helps!
Regards,
Kris
Marco Rosetti,修改在9 年前。
RE: Problem adding extra database to existing sharded Liferay 6.0 EE SP2
Junior Member 帖子: 68 加入日期: 13-3-6 最近的帖子Kris Sokolovski:
Hi Magnus,
I think, You've done everything correctly. But as I can see, You miss one more thing!
The database won't create automaticaly. You should create a new schema 'lportal3' and run SQL scripts to create minimal-database. We are using MySQL DB, so I would use 'create-minimal-mysql.sql' which can be found in Liferay Downloads 'liferay-portal-sql-6.1.20-ee-ga2' - just pay attention what version do You use.
Also, please check 'create-minimal-mysql.sql' content and replace all 'lportal' to 'lportal3'.
Hope that helps!
Regards,
Kris
This works fine for liferay-bundled plugins (for example calendar). Is there a way to handle also other plugins?
Thanks