Hi guys,
How Can I save the runtime configurations when the rancher/server running in a docker instance?
Thanks,
Kevin Yang
Hi guys,
How Can I save the runtime configurations when the rancher/server running in a docker instance?
Thanks,
Kevin Yang
Hi have a look at http://docs.rancher.com/rancher/installing-rancher/installing-server/
“Bind Mount MySQL Volume” or “Using an external Database”
Thanks a lot, dude…
@frintrop Oops, It does not work for me.
I used external database solution to run a rancher/server container, but I got some ERROR messages what I listed at below:
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set db/core-077.xml::dump2::darren (generated):
Reason: liquibase.exception.DatabaseException: Error executing SQL CREATE INDEX idx_volume_uri ON cattle.volume(uri): Specified key was too long; max key length is 767 bytes
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:388) ~[liquibase-core-3.1.0.jar:na]
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:40) ~[liquibase-core-3.1.0.jar:na]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:64) ~[liquibase-core-3.1.0.jar:na]
at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.1.0.jar:na]
at liquibase.Liquibase.update(Liquibase.java:181) ~[liquibase-core-3.1.0.jar:na]
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:342) ~[liquibase-core-3.1.0.jar:na]
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:299) ~[liquibase-core-3.1.0.jar:na]
at io.cattle.platform.liquibase.Loader.afterPropertiesSet(Loader.java:62) ~[cattle-framework-db-loader-0.5.0-SNAPSHOT.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
… 44 common frames omitted
Caused by: liquibase.exception.DatabaseException: Error executing SQL CREATE INDEX idx_volume_uri ON cattle.volume(uri): Specified key was too long; max key length is 767 bytes
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:61) ~[liquibase-core-3.1.0.jar:na]
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:106) ~[liquibase-core-3.1.0.jar:na]
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1189) ~[liquibase-core-3.1.0.jar:na]
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1172) ~[liquibase-core-3.1.0.jar:na]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:352) ~[liquibase-core-3.1.0.jar:na]
… 53 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:125) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeQueryEpilog(MariaDbStatement.java:261) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:290) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:344) ~[mariadb-java-client-1.3.4.jar:na]
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) ~[commons-dbcp-1.4.jar:1.4]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:294) ~[liquibase-core-3.1.0.jar:na]
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:54) ~[liquibase-core-3.1.0.jar:na]
… 57 common frames omitted
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Specified key was too long; max key length is 767 bytes
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:475) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.result(AbstractQueryProtocol.java:396) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:378) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:334) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:280) ~[mariadb-java-client-1.3.4.jar:na]
… 62 common frames omitted
Can u help me solve it?
Looks like a mysql engine problem ( cisam/innodb ) or utf8 problem.
Have u setup database via
CREATE DATABASE IF NOT EXISTS cattle COLLATE = ‘utf8_general_ci’ CHARACTER SET = ‘utf8’;
GRANT ALL ON cattle.* TO ‘cattle’@’%’ IDENTIFIED BY ‘cattle’;
GRANT ALL ON cattle.* TO ‘cattle’@‘localhost’ IDENTIFIED BY ‘cattle’;
Found many solution in internet for that general problem …
@frintrop Thank you.
What I mean was that I strictly execute those of SQL scripts for initializing DB before I run up a docker instance of rancher/server. Are there any mistakes existed in the initializing procedure of rancher/server?
sql CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8'; GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY 'cattle'; GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY 'cattle';
We using a percona mysql cluster as external database and have not problems.
Internal database is running fine?!
OK, thank you very much
And … tried running with internal database ?