diff --git a/CHANGES.md b/CHANGES.md index 724bf2e738e..a2bd1a5370c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ Apollo 2.1.0 * [Optimize Spring-Security Firewall Deny Request Response 400](https://github.com/apolloconfig/apollo/pull/4428) * [Optimize the UI experience of open platform authorization management](https://github.com/apolloconfig/apollo/pull/4436) * [Allow users to associate multiple public namespaces at a time](https://github.com/apolloconfig/apollo/pull/4437) +* [Move apollo-demo, scripts/docker-quick-start and scripts/apollo-on-kubernetes out of main repository](https://github.com/apolloconfig/apollo/pull/4440) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/11?closed=1) diff --git a/apollo-demo/pom.xml b/apollo-demo/pom.xml deleted file mode 100644 index 99a86e6d825..00000000000 --- a/apollo-demo/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - apollo - com.ctrip.framework.apollo - ${revision} - - 4.0.0 - apollo-demo - Apollo Demo - jar - - ${project.artifactId} - - - - com.ctrip.framework.apollo - apollo-client - ${project.version} - - - - org.springframework - spring-context - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.cloud - spring-cloud-context - - - - org.slf4j - jcl-over-slf4j - - - diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/ApolloConfigDemo.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/ApolloConfigDemo.java deleted file mode 100644 index 6413fb0a52b..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/ApolloConfigDemo.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.api; - -import com.ctrip.framework.apollo.internals.YamlConfigFile; -import com.google.common.base.Charsets; - -import com.ctrip.framework.apollo.Config; -import com.ctrip.framework.apollo.ConfigChangeListener; -import com.ctrip.framework.apollo.ConfigFile; -import com.ctrip.framework.apollo.ConfigFileChangeListener; -import com.ctrip.framework.apollo.ConfigService; -import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; -import com.ctrip.framework.apollo.model.ConfigChange; -import com.ctrip.framework.apollo.model.ConfigChangeEvent; -import com.ctrip.framework.apollo.model.ConfigFileChangeEvent; -import com.ctrip.framework.foundation.Foundation; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -public class ApolloConfigDemo { - private static final Logger logger = LoggerFactory.getLogger(ApolloConfigDemo.class); - private String DEFAULT_VALUE = "undefined"; - private Config config; - private Config yamlConfig; - private Config publicConfig; - private ConfigFile applicationConfigFile; - private ConfigFile xmlConfigFile; - private YamlConfigFile yamlConfigFile; - - public ApolloConfigDemo() { - ConfigChangeListener changeListener = new ConfigChangeListener() { - @Override - public void onChange(ConfigChangeEvent changeEvent) { - logger.info("Changes for namespace {}", changeEvent.getNamespace()); - for (String key : changeEvent.changedKeys()) { - ConfigChange change = changeEvent.getChange(key); - logger.info("Change - key: {}, oldValue: {}, newValue: {}, changeType: {}", - change.getPropertyName(), change.getOldValue(), change.getNewValue(), - change.getChangeType()); - } - } - }; - config = ConfigService.getAppConfig(); - config.addChangeListener(changeListener); - yamlConfig = ConfigService.getConfig("application.yaml"); - yamlConfig.addChangeListener(changeListener); - publicConfig = ConfigService.getConfig("TEST1.apollo"); - publicConfig.addChangeListener(changeListener); - applicationConfigFile = ConfigService.getConfigFile("application", ConfigFileFormat.Properties); - // datasources.xml - xmlConfigFile = ConfigService.getConfigFile("datasources", ConfigFileFormat.XML); - xmlConfigFile.addChangeListener(new ConfigFileChangeListener() { - @Override - public void onChange(ConfigFileChangeEvent changeEvent) { - logger.info(changeEvent.toString()); - } - }); - // application.yaml - yamlConfigFile = (YamlConfigFile) ConfigService.getConfigFile("application", ConfigFileFormat.YAML); - } - - private String getConfig(String key) { - String result = config.getProperty(key, DEFAULT_VALUE); - if (DEFAULT_VALUE.equals(result)) { - result = publicConfig.getProperty(key, DEFAULT_VALUE); - } - if (DEFAULT_VALUE.equals(result)) { - result = yamlConfig.getProperty(key, DEFAULT_VALUE); - } - logger.info(String.format("Loading key : %s with value: %s", key, result)); - return result; - } - - private void print(String namespace) { - switch (namespace) { - case "application": - print(applicationConfigFile); - return; - case "xml": - print(xmlConfigFile); - return; - case "yaml": - printYaml(yamlConfigFile); - return; - } - } - - private void print(ConfigFile configFile) { - if (!configFile.hasContent()) { - System.out.println("No config file content found for " + configFile.getNamespace()); - return; - } - System.out.println("=== Config File Content for " + configFile.getNamespace() + " is as follows: "); - System.out.println(configFile.getContent()); - } - - private void printYaml(YamlConfigFile configFile) { - System.out.println("=== Properties for " + configFile.getNamespace() + " is as follows: "); - System.out.println(configFile.asProperties()); - } - - private void printEnvInfo() { - String message = String.format("AppId: %s, Env: %s, DC: %s, IP: %s", Foundation.app() - .getAppId(), Foundation.server().getEnvType(), Foundation.server().getDataCenter(), - Foundation.net().getHostAddress()); - System.out.println(message); - } - - public static void main(String[] args) throws IOException { - ApolloConfigDemo apolloConfigDemo = new ApolloConfigDemo(); - apolloConfigDemo.printEnvInfo(); - System.out.println( - "Apollo Config Demo. Please input key to get the value."); - while (true) { - System.out.print("> "); - String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); - if (input == null || input.length() == 0) { - continue; - } - input = input.trim(); - try { - if (input.equalsIgnoreCase("application")) { - apolloConfigDemo.print("application"); - continue; - } - if (input.equalsIgnoreCase("xml")) { - apolloConfigDemo.print("xml"); - continue; - } - if (input.equalsIgnoreCase("yaml") || input.equalsIgnoreCase("yml")) { - apolloConfigDemo.print("yaml"); - continue; - } - if (input.equalsIgnoreCase("quit")) { - System.exit(0); - } - apolloConfigDemo.getConfig(input); - } catch (Throwable ex) { - logger.error("some error occurred", ex); - } - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java deleted file mode 100644 index 39415c910e5..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.api; - -import com.google.common.base.Charsets; - -import com.ctrip.framework.apollo.Config; -import com.ctrip.framework.apollo.ConfigChangeListener; -import com.ctrip.framework.apollo.ConfigService; -import com.ctrip.framework.apollo.model.ConfigChange; -import com.ctrip.framework.apollo.model.ConfigChangeEvent; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -public class SimpleApolloConfigDemo { - private static final Logger logger = LoggerFactory.getLogger(SimpleApolloConfigDemo.class); - private String DEFAULT_VALUE = "undefined"; - private Config config; - - public SimpleApolloConfigDemo() { - ConfigChangeListener changeListener = new ConfigChangeListener() { - @Override - public void onChange(ConfigChangeEvent changeEvent) { - logger.info("Changes for namespace {}", changeEvent.getNamespace()); - for (String key : changeEvent.changedKeys()) { - ConfigChange change = changeEvent.getChange(key); - logger.info("Change - key: {}, oldValue: {}, newValue: {}, changeType: {}", - change.getPropertyName(), change.getOldValue(), change.getNewValue(), - change.getChangeType()); - } - } - }; - config = ConfigService.getAppConfig(); - config.addChangeListener(changeListener); - } - - private String getConfig(String key) { - String result = config.getProperty(key, DEFAULT_VALUE); - logger.info(String.format("Loading key : %s with value: %s", key, result)); - return result; - } - - public static void main(String[] args) throws IOException { - SimpleApolloConfigDemo apolloConfigDemo = new SimpleApolloConfigDemo(); - System.out.println( - "Apollo Config Demo. Please input key to get the value. Input quit to exit."); - while (true) { - System.out.print("> "); - String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); - if (input == null || input.length() == 0) { - continue; - } - input = input.trim(); - if (input.equalsIgnoreCase("quit")) { - System.exit(0); - } - apolloConfigDemo.getConfig(input); - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/bean/AnnotatedBean.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/bean/AnnotatedBean.java deleted file mode 100644 index c2ff015b34d..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/bean/AnnotatedBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.common.bean; - -import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -@Component("annotatedBean") -public class AnnotatedBean { - private static final Logger logger = LoggerFactory.getLogger(AnnotatedBean.class); - - private int timeout; - private int batch; - private List jsonBeans; - - /** - * ApolloJsonValue annotated on fields example, the default value is specified as empty list - [] - *
- * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] - */ - @ApolloJsonValue("${jsonBeanProperty:[]}") - private List anotherJsonBeans; - - @Value("${batch:100}") - public void setBatch(int batch) { - logger.info("updating batch, old value: {}, new value: {}", this.batch, batch); - this.batch = batch; - } - - @Value("${timeout:200}") - public void setTimeout(int timeout) { - logger.info("updating timeout, old value: {}, new value: {}", this.timeout, timeout); - this.timeout = timeout; - } - - /** - * ApolloJsonValue annotated on methods example, the default value is specified as empty list - [] - *
- * jsonBeanProperty=[{"someString":"hello","someInt":100},{"someString":"world!","someInt":200}] - */ - @ApolloJsonValue("${jsonBeanProperty:[]}") - public void setJsonBeans(List jsonBeans) { - logger.info("updating json beans, old value: {}, new value: {}", this.jsonBeans, jsonBeans); - this.jsonBeans = jsonBeans; - } - - @Override - public String toString() { - return String.format("[AnnotatedBean] timeout: %d, batch: %d, jsonBeans: %s", timeout, batch, jsonBeans); - } - - private static class JsonBean{ - - private String someString; - private int someInt; - - @Override - public String toString() { - return "JsonBean{" + - "someString='" + someString + '\'' + - ", someInt=" + someInt + - '}'; - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AnotherAppConfig.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AnotherAppConfig.java deleted file mode 100644 index 785de5dd4b5..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AnotherAppConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.common.config; - -import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig; - -import org.springframework.context.annotation.Configuration; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -@Configuration -@EnableApolloConfig(value = {"TEST1.apollo", "application.yaml"}, order = 11) -public class AnotherAppConfig { -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AppConfig.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AppConfig.java deleted file mode 100644 index 659d1c4c551..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/common/config/AppConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.common.config; - -import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig; - -import org.springframework.context.annotation.Configuration; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -@Configuration -@EnableApolloConfig(value = "application", order = 10) -public class AppConfig { -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/javaConfigDemo/AnnotationApplication.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/javaConfigDemo/AnnotationApplication.java deleted file mode 100644 index 9624a3a816d..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/javaConfigDemo/AnnotationApplication.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.javaConfigDemo; - -import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean; -import com.google.common.base.Charsets; -import com.google.common.base.Strings; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - - -/** - * @author Jason Song(song_s@ctrip.com) - */ -public class AnnotationApplication { - public static void main(String[] args) throws IOException { - ApplicationContext context = new AnnotationConfigApplicationContext("com.ctrip.framework.apollo.demo.spring.common"); - AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class); - - System.out.println("AnnotationApplication Demo. Input any key except quit to print the values. Input quit to exit."); - while (true) { - System.out.print("> "); - String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); - if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) { - System.exit(0); - } - - System.out.println(annotatedBean); - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/SpringBootSampleApplication.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/SpringBootSampleApplication.java deleted file mode 100644 index fabe7636b26..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/SpringBootSampleApplication.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.springBootDemo; - -import com.ctrip.framework.apollo.demo.spring.springBootDemo.config.SampleRedisConfig; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.context.ApplicationContext; - -import com.ctrip.framework.apollo.demo.spring.common.bean.AnnotatedBean; -import com.google.common.base.Charsets; -import com.google.common.base.Strings; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -@SpringBootApplication(scanBasePackages = {"com.ctrip.framework.apollo.demo.spring.common", - "com.ctrip.framework.apollo.demo.spring.springBootDemo" -}) -public class SpringBootSampleApplication { - - public static void main(String[] args) throws IOException { - ApplicationContext context = new SpringApplicationBuilder(SpringBootSampleApplication.class).run(args); - AnnotatedBean annotatedBean = context.getBean(AnnotatedBean.class); - SampleRedisConfig redisConfig = null; - try { - redisConfig = context.getBean(SampleRedisConfig.class); - } catch (NoSuchBeanDefinitionException ex) { - System.out.println("SampleRedisConfig is null, 'redis.cache.enabled' must have been set to false."); - } - - System.out.println("SpringBootSampleApplication Demo. Input any key except quit to print the values. Input quit to exit."); - while (true) { - System.out.print("> "); - String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); - if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) { - System.exit(0); - } - - System.out.println(annotatedBean.toString()); - if (redisConfig != null) { - System.out.println(redisConfig.toString()); - } - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/config/SampleRedisConfig.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/config/SampleRedisConfig.java deleted file mode 100644 index 60857a18795..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/config/SampleRedisConfig.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.springBootDemo.config; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import java.util.List; -import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.context.config.annotation.RefreshScope; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; - -/** - * You may set up data like the following in Apollo: - *

- * Properties Sample: application.properties - *
- * redis.cache.enabled = true
- * redis.cache.expireSeconds = 100
- * redis.cache.clusterNodes = 1,2
- * redis.cache.commandTimeout = 50
- * redis.cache.someMap.key1 = a
- * redis.cache.someMap.key2 = b
- * redis.cache.someList[0] = c
- * redis.cache.someList[1] = d
- * 
- * - * Yaml Sample: application.yaml - *
- * redis:
- *   cache:
- *     enabled: true
- *     expireSeconds: 100
- *     clusterNodes: 1,2
- *     commandTimeout: 50
- *     someMap:
- *       key1: a
- *       key2: b
- *     someList:
- *     - c
- *     - d
- * 
- * - * To make @ConditionalOnProperty work properly, apollo.bootstrap.enabled should be set to true - * and redis.cache.enabled should also be set to true. Check 'src/main/resources/application.yml' for more information. - * - * @author Jason Song(song_s@ctrip.com) - */ -@ConditionalOnProperty("redis.cache.enabled") -@ConfigurationProperties(prefix = "redis.cache") -@Component("sampleRedisConfig") -@RefreshScope -public class SampleRedisConfig { - - private static final Logger logger = LoggerFactory.getLogger(SampleRedisConfig.class); - - private int expireSeconds; - private String clusterNodes; - private int commandTimeout; - - private Map someMap = Maps.newLinkedHashMap(); - private List someList = Lists.newLinkedList(); - - @PostConstruct - private void initialize() { - logger.info( - "SampleRedisConfig initialized - expireSeconds: {}, clusterNodes: {}, commandTimeout: {}, someMap: {}, someList: {}", - expireSeconds, clusterNodes, commandTimeout, someMap, someList); - } - - public void setExpireSeconds(int expireSeconds) { - this.expireSeconds = expireSeconds; - } - - public void setClusterNodes(String clusterNodes) { - this.clusterNodes = clusterNodes; - } - - public void setCommandTimeout(int commandTimeout) { - this.commandTimeout = commandTimeout; - } - - public Map getSomeMap() { - return someMap; - } - - public List getSomeList() { - return someList; - } - - @Override - public String toString() { - return String.format( - "[SampleRedisConfig] expireSeconds: %d, clusterNodes: %s, commandTimeout: %d, someMap: %s, someList: %s", - expireSeconds, clusterNodes, commandTimeout, someMap, someList); - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/refresh/SpringBootApolloRefreshConfig.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/refresh/SpringBootApolloRefreshConfig.java deleted file mode 100644 index a93b055a45d..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/refresh/SpringBootApolloRefreshConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.springBootDemo.refresh; - -import com.ctrip.framework.apollo.core.ConfigConsts; -import com.ctrip.framework.apollo.demo.spring.springBootDemo.config.SampleRedisConfig; -import com.ctrip.framework.apollo.model.ConfigChangeEvent; -import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.cloud.context.scope.refresh.RefreshScope; -import org.springframework.stereotype.Component; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -@ConditionalOnProperty("redis.cache.enabled") -@Component -public class SpringBootApolloRefreshConfig { - private static final Logger logger = LoggerFactory.getLogger(SpringBootApolloRefreshConfig.class); - - private final SampleRedisConfig sampleRedisConfig; - private final RefreshScope refreshScope; - - public SpringBootApolloRefreshConfig( - final SampleRedisConfig sampleRedisConfig, - final RefreshScope refreshScope) { - this.sampleRedisConfig = sampleRedisConfig; - this.refreshScope = refreshScope; - } - - @ApolloConfigChangeListener(value = {ConfigConsts.NAMESPACE_APPLICATION, "TEST1.apollo", "application.yaml"}, - interestedKeyPrefixes = {"redis.cache."}) - public void onChange(ConfigChangeEvent changeEvent) { - logger.info("before refresh {}", sampleRedisConfig.toString()); - refreshScope.refresh("sampleRedisConfig"); - logger.info("after refresh {}", sampleRedisConfig); - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/XmlApplication.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/XmlApplication.java deleted file mode 100644 index eb4859b249d..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/XmlApplication.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.xmlConfigDemo; - -import com.google.common.base.Strings; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean.XmlBean; -import com.google.common.base.Charsets; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -public class XmlApplication { - public static void main(String[] args) throws IOException { - ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml"); - XmlBean xmlBean = context.getBean(XmlBean.class); - - System.out.println("XmlApplication Demo. Input any key except quit to print the values. Input quit to exit."); - while (true) { - System.out.print("> "); - String input = new BufferedReader(new InputStreamReader(System.in, Charsets.UTF_8)).readLine(); - if (!Strings.isNullOrEmpty(input) && input.trim().equalsIgnoreCase("quit")) { - System.exit(0); - } - - System.out.println(xmlBean); - } - } -} diff --git a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/bean/XmlBean.java b/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/bean/XmlBean.java deleted file mode 100644 index d29c50f0810..00000000000 --- a/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/xmlConfigDemo/bean/XmlBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 Apollo Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.ctrip.framework.apollo.demo.spring.xmlConfigDemo.bean; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Jason Song(song_s@ctrip.com) - */ -public class XmlBean { - private static final Logger logger = LoggerFactory.getLogger(XmlBean.class); - - private int timeout; - private int batch; - - public void setTimeout(int timeout) { - logger.info("updating timeout, old value: {}, new value: {}", this.timeout, timeout); - this.timeout = timeout; - } - - public void setBatch(int batch) { - logger.info("updating batch, old value: {}, new value: {}", this.batch, batch); - this.batch = batch; - } - - public int getTimeout() { - return timeout; - } - - public int getBatch() { - return batch; - } - - @Override - public String toString() { - return String.format("[XmlBean] timeout: %d, batch: %d", timeout, batch); - } -} diff --git a/apollo-demo/src/main/resources/META-INF/app.properties b/apollo-demo/src/main/resources/META-INF/app.properties deleted file mode 100644 index 20f5e24af6f..00000000000 --- a/apollo-demo/src/main/resources/META-INF/app.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# test -app.id=100004458 -apollo.label=myLabel \ No newline at end of file diff --git a/apollo-demo/src/main/resources/application.yml b/apollo-demo/src/main/resources/application.yml deleted file mode 100644 index c5b4492806d..00000000000 --- a/apollo-demo/src/main/resources/application.yml +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -apollo: - bootstrap: - enabled: true - eagerLoad: - enabled: true - # will inject 'application' and 'TEST1.apollo' namespaces in bootstrap phase - namespaces: application,TEST1.apollo,application.yaml diff --git a/apollo-demo/src/main/resources/logback.xml b/apollo-demo/src/main/resources/logback.xml deleted file mode 100644 index 99476e81200..00000000000 --- a/apollo-demo/src/main/resources/logback.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/apollo-demo/src/main/resources/spring.xml b/apollo-demo/src/main/resources/spring.xml deleted file mode 100644 index bc0dab2019a..00000000000 --- a/apollo-demo/src/main/resources/spring.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - diff --git a/doc/images/local-development/apollo-demo-app-properties.jpg b/doc/images/local-development/apollo-demo-app-properties.jpg new file mode 100644 index 00000000000..295ab515877 Binary files /dev/null and b/doc/images/local-development/apollo-demo-app-properties.jpg differ diff --git a/doc/images/local-development/apollo-demo-app-properties.png b/doc/images/local-development/apollo-demo-app-properties.png deleted file mode 100644 index 69f2ebe591e..00000000000 Binary files a/doc/images/local-development/apollo-demo-app-properties.png and /dev/null differ diff --git a/doc/images/local-development/apollo-demo-overview.jpg b/doc/images/local-development/apollo-demo-overview.jpg new file mode 100644 index 00000000000..9286b118003 Binary files /dev/null and b/doc/images/local-development/apollo-demo-overview.jpg differ diff --git a/doc/images/local-development/apollo-demo-overview.png b/doc/images/local-development/apollo-demo-overview.png deleted file mode 100644 index 3ddbfa280ae..00000000000 Binary files a/doc/images/local-development/apollo-demo-overview.png and /dev/null differ diff --git a/doc/images/local-development/apollo-demo-vm-options.jpg b/doc/images/local-development/apollo-demo-vm-options.jpg new file mode 100644 index 00000000000..9754fd378a7 Binary files /dev/null and b/doc/images/local-development/apollo-demo-vm-options.jpg differ diff --git a/doc/images/local-development/apollo-demo-vm-options.png b/doc/images/local-development/apollo-demo-vm-options.png deleted file mode 100644 index e5a07a1b2ce..00000000000 Binary files a/doc/images/local-development/apollo-demo-vm-options.png and /dev/null differ diff --git a/docs/en/deployment/quick-start-docker.md b/docs/en/deployment/quick-start-docker.md index a626daf2cae..b2a19aae708 100644 --- a/docs/en/deployment/quick-start-docker.md +++ b/docs/en/deployment/quick-start-docker.md @@ -16,7 +16,15 @@ To speed up Docker image download, it is recommended to [configure image gas ped ### 1.2 Download Docker Quick Start configuration file -Make sure the [docker-quick-start](https://github.com/apolloconfig/apollo/tree/master/scripts/docker-quick-start) folder already exists locally, if the Apollo has already been cloned locally code, then you can skip this step. +Download [docker-compose.yml](https://github.com/apolloconfig/apollo-quick-start/blob/master/docker-compose.yml) and [sql folder](https://github.com/apolloconfig/apollo-quick-start/tree/master/sql) to a local directory, such as docker-quick-start. + +```bash +- docker-quick-start + - docker-compose.yml + - sql + - apolloconfigdb.sql + - apolloportaldb.sql +``` ## II. Starting Apollo Configuration Center diff --git a/docs/en/deployment/quick-start.md b/docs/en/deployment/quick-start.md index 58c55540122..e1f5a1c3d59 100644 --- a/docs/en/deployment/quick-start.md +++ b/docs/en/deployment/quick-start.md @@ -188,7 +188,7 @@ It should be noted that Quick Start does not support adding environments, but on > If prompted `system error, please retry or contact system owner`, please retry a few seconds later, because there is a refresh delay for services registered through Eureka. ### 4.1.2 Running the client application -We have prepared a simple [Demo client](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java) to demonstrate getting configuration from Apollo Configuration Center. +We have prepared a simple [Demo client](https://github.com/apolloconfig/apollo-demo-java/blob/main/api-demo/src/main/java/com/apolloconfig/apollo/demo/api/SimpleApolloConfigDemo.java) to demonstrate getting configuration from Apollo Configuration Center. The program is simple: the user enters the name of a key, and the program outputs the value corresponding to that key. diff --git a/docs/en/development/apollo-development-guide.md b/docs/en/development/apollo-development-guide.md index 1f9b24372fb..7aa8f8edfa4 100644 --- a/docs/en/development/apollo-development-guide.md +++ b/docs/en/development/apollo-development-guide.md @@ -145,13 +145,13 @@ You can refer to [General Application Access Guide](en/usage/apollo-user-guide?i ## 2.3 Java sample client startup -There is a sample client project in the project: `apollo-demo`, the following is an example of how to start it locally with Intellij Community 2016.2 version. +There is a sample client project: [apollo-demo-java](https://github.com/apolloconfig/apollo-demo-java), the following is an example of how to start it locally with Intellij. ### 2.3.1 Configure the project AppId -When creating a demo project in `2.2.5 Demo Application Access`, the system will ask to fill in a globally unique AppId, which we need to configure into the app.properties file of the `apollo-demo` project: `apollo-demo/src/main/resources/ META-INF/app.properties`. +When creating a demo project in `2.2.5 Demo Application Access`, the system will ask to fill in a globally unique AppId, which we need to configure into the app.properties file of the `apollo-demo` project: `apollo-demo-java/api-demo/src/main/resources/ META-INF/app.properties`. -![apollo-demo-app-properties](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-app-properties.png) +![apollo-demo-app-properties](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-app-properties.jpg) If our own demo project uses an AppId of 100004458, then the file content would be @@ -169,11 +169,11 @@ If our own demo project uses an AppId of 100004458, then the file content would ### 2.3.3 Main class configuration -`com.ctrip.framework.apollo.demo.api.SimpleApolloConfigDemo` +`com.apolloconfig.apollo.demo.api.SimpleApolloConfigDemo` ### 2.3.4 VM options configuration -![apollo-demo-vm-options](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-vm-options.png) +![apollo-demo-vm-options](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-vm-options.jpg) -Dapollo.meta=http://localhost:8080 @@ -183,7 +183,7 @@ If our own demo project uses an AppId of 100004458, then the file content would ### 2.3.5 Overview -![apollo-demo-overview](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-overview.png) +![apollo-demo-overview](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-overview.jpg) ### 2.3.6 Running diff --git a/docs/en/usage/java-sdk-user-guide.md b/docs/en/usage/java-sdk-user-guide.md index 820335e72e3..940f68bf5ba 100644 --- a/docs/en/usage/java-sdk-user-guide.md +++ b/docs/en/usage/java-sdk-user-guide.md @@ -992,7 +992,7 @@ public class AppConfig { } ```` -It should be noted that if `@ConfigurationProperties` needs to automatically update the injected value when the Apollo configuration changes, you need to use [EnvironmentChangeEvent](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_environment_changes) or [RefreshScope](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_refresh_scope). For related code implementation, please refer to [ZuulPropertiesRefresher.java](https://github.com/ctripcorp/apollo-use-cases/blob/master/spring-cloud-zuul/src/main/java/com/ctrip/framework/apollo/use/cases/spring/cloud/zuul/ZuulPropertiesRefresher.java#L48) and [SampleRedisConfig.java](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/config/SampleRedisConfig.java) and [SpringBootApolloRefreshConfig.java](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/refresh/SpringBootApolloRefreshConfig.java) +It should be noted that if `@ConfigurationProperties` needs to automatically update the injected value when the Apollo configuration changes, you need to use [EnvironmentChangeEvent](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_environment_changes) or [RefreshScope](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_refresh_scope). For related code implementation, please refer to [ZuulPropertiesRefresher.java](https://github.com/ctripcorp/apollo-use-cases/blob/master/spring-cloud-zuul/src/main/java/com/ctrip/framework/apollo/use/cases/spring/cloud/zuul/ZuulPropertiesRefresher.java#L48) and [SampleRedisConfig.java](https://github.com/apolloconfig/apollo-demo-java/blob/main/spring-boot-demo/src/main/java/com/apolloconfig/apollo/demo/springboot/config/SampleRedisConfig.java) and [SpringBootApolloRefreshConfig.java](https://github.com/apolloconfig/apollo-demo-java/blob/main/spring-boot-demo/src/main/java/com/apolloconfig/apollo/demo/springboot/refresh/SpringBootApolloRefreshConfig.java) ### 3.2.3 Spring Annotation Support diff --git a/docs/zh/deployment/quick-start-docker.md b/docs/zh/deployment/quick-start-docker.md index 0f32fff18ef..49dc37dd74f 100644 --- a/docs/zh/deployment/quick-start-docker.md +++ b/docs/zh/deployment/quick-start-docker.md @@ -16,7 +16,15 @@ docker -v ### 1.2 下载Docker Quick Start配置文件 -确保[docker-quick-start](https://github.com/apolloconfig/apollo/tree/master/scripts/docker-quick-start)文件夹已经在本地存在,如果本地已经clone过Apollo的代码,则可以跳过此步骤。 +下载[docker-compose.yml](https://github.com/apolloconfig/apollo-quick-start/blob/master/docker-compose.yml)和[sql 文件夹](https://github.com/apolloconfig/apollo-quick-start/tree/master/sql)到本地目录,如 docker-quick-start。 + +```bash +- docker-quick-start + - docker-compose.yml + - sql + - apolloconfigdb.sql + - apolloportaldb.sql +``` ## 二、启动Apollo配置中心 diff --git a/docs/zh/deployment/quick-start.md b/docs/zh/deployment/quick-start.md index 610e1d20cfe..982040426cc 100644 --- a/docs/zh/deployment/quick-start.md +++ b/docs/zh/deployment/quick-start.md @@ -184,7 +184,7 @@ Quick Start只是用来帮助大家快速体验Apollo项目,具体实际使用 > 如果提示`系统出错,请重试或联系系统负责人`,请稍后几秒钟重试一下,因为通过Eureka注册的服务有一个刷新的延时。 ### 4.1.2 运行客户端程序 -我们准备了一个简单的[Demo客户端](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/api/SimpleApolloConfigDemo.java)来演示从Apollo配置中心获取配置。 +我们准备了一个简单的[Demo客户端](https://github.com/apolloconfig/apollo-demo-java/blob/main/api-demo/src/main/java/com/apolloconfig/apollo/demo/api/SimpleApolloConfigDemo.java)来演示从Apollo配置中心获取配置。 程序很简单,就是用户输入一个key的名字,程序会输出这个key对应的值。 diff --git a/docs/zh/development/apollo-development-guide.md b/docs/zh/development/apollo-development-guide.md index 290e5f6ae9d..b84ea049351 100644 --- a/docs/zh/development/apollo-development-guide.md +++ b/docs/zh/development/apollo-development-guide.md @@ -130,12 +130,12 @@ Apollo本地开发需要以下组件: ## 2.3 Java样例客户端启动 -项目中有一个样例客户端的项目:`apollo-demo`,下面以Intellij Community 2016.2版本为例来说明如何在本地启动。 +仓库中有一个样例客户端的项目:[apollo-demo-java](https://github.com/apolloconfig/apollo-demo-java),下面以Intellij为例来说明如何在本地启动。 ### 2.3.1 配置项目AppId -在`2.2.5 Demo应用接入`中创建Demo项目时,系统会要求填入一个全局唯一的AppId,我们需要把这个AppId配置到`apollo-demo`项目的app.properties文件中:`apollo-demo/src/main/resources/META-INF/app.properties`。 +在`2.2.5 Demo应用接入`中创建Demo项目时,系统会要求填入一个全局唯一的AppId,我们需要把这个AppId配置到`apollo-demo`项目的app.properties文件中:`apollo-demo-java/api-demo/src/main/resources/META-INF/app.properties`。 -![apollo-demo-app-properties](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-app-properties.png) +![apollo-demo-app-properties](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-app-properties.jpg) 如我们自己的demo项目使用的AppId是100004458,那么文件内容就是: @@ -151,10 +151,10 @@ Apollo本地开发需要以下组件: ![NewConfiguration-Application](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/NewConfiguration-Application.png) ### 2.3.3 Main class配置 -`com.ctrip.framework.apollo.demo.api.SimpleApolloConfigDemo` +`com.apolloconfig.apollo.demo.api.SimpleApolloConfigDemo` ### 2.3.4 VM options配置 -![apollo-demo-vm-options](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-vm-options.png) +![apollo-demo-vm-options](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-vm-options.jpg) -Dapollo.meta=http://localhost:8080 @@ -164,7 +164,7 @@ Apollo本地开发需要以下组件: ### 2.3.5 概览 -![apollo-demo-overview](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-overview.png) +![apollo-demo-overview](https://cdn.jsdelivr.net/gh/apolloconfig/apollo@master/doc/images/local-development/apollo-demo-overview.jpg) ### 2.3.6 运行 对新建的运行配置点击Run或Debug皆可。 diff --git a/docs/zh/usage/java-sdk-user-guide.md b/docs/zh/usage/java-sdk-user-guide.md index b0df719db8d..f230196bc1a 100644 --- a/docs/zh/usage/java-sdk-user-guide.md +++ b/docs/zh/usage/java-sdk-user-guide.md @@ -940,7 +940,7 @@ public class AppConfig { } ``` -需要注意的是,`@ConfigurationProperties`如果需要在Apollo配置变化时自动更新注入的值,需要配合使用[EnvironmentChangeEvent](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_environment_changes)或[RefreshScope](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_refresh_scope)。相关代码实现,可以参考apollo-use-cases项目中的[ZuulPropertiesRefresher.java](https://github.com/ctripcorp/apollo-use-cases/blob/master/spring-cloud-zuul/src/main/java/com/ctrip/framework/apollo/use/cases/spring/cloud/zuul/ZuulPropertiesRefresher.java#L48)和apollo-demo项目中的[SampleRedisConfig.java](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/config/SampleRedisConfig.java)以及[SpringBootApolloRefreshConfig.java](https://github.com/apolloconfig/apollo/blob/master/apollo-demo/src/main/java/com/ctrip/framework/apollo/demo/spring/springBootDemo/refresh/SpringBootApolloRefreshConfig.java) +需要注意的是,`@ConfigurationProperties`如果需要在Apollo配置变化时自动更新注入的值,需要配合使用[EnvironmentChangeEvent](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_environment_changes)或[RefreshScope](https://cloud.spring.io/spring-cloud-static/spring-cloud.html#_refresh_scope)。相关代码实现,可以参考apollo-use-cases项目中的[ZuulPropertiesRefresher.java](https://github.com/ctripcorp/apollo-use-cases/blob/master/spring-cloud-zuul/src/main/java/com/ctrip/framework/apollo/use/cases/spring/cloud/zuul/ZuulPropertiesRefresher.java#L48)和apollo-demo项目中的[SampleRedisConfig.java](https://github.com/apolloconfig/apollo-demo-java/blob/main/spring-boot-demo/src/main/java/com/apolloconfig/apollo/demo/springboot/config/SampleRedisConfig.java)以及[SpringBootApolloRefreshConfig.java](https://github.com/apolloconfig/apollo-demo-java/blob/main/spring-boot-demo/src/main/java/com/apolloconfig/apollo/demo/springboot/refresh/SpringBootApolloRefreshConfig.java) ### 3.2.3 Spring Annotation支持 Apollo同时还增加了几个新的Annotation来简化在Spring环境中的使用。 diff --git a/pom.xml b/pom.xml index cbf57f6b123..863d7de4646 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,6 @@ apollo-adminservice apollo-portal apollo-assembly - apollo-demo apollo-mockserver apollo-openapi diff --git a/scripts/apollo-on-kubernetes/README.md b/scripts/apollo-on-kubernetes/README.md deleted file mode 100644 index 73708ddb94f..00000000000 --- a/scripts/apollo-on-kubernetes/README.md +++ /dev/null @@ -1,170 +0,0 @@ -# 使用方法 - -> Apollo 1.7.0版本增加了基于Kubernetes原生服务发现的[Helm Chart部署模式](https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide?id=_241-%e5%9f%ba%e4%ba%8ekubernetes%e5%8e%9f%e7%94%9f%e6%9c%8d%e5%8a%a1%e5%8f%91%e7%8e%b0),由于不再使用内置的Eureka,所以在整体部署上有很大简化,如无特殊需求,建议使用该模式部署。 - -## 1. 创建数据库 -具体步骤请参考 [2.1 创建数据库](https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide?id=_21-%e5%88%9b%e5%bb%ba%e6%95%b0%e6%8d%ae%e5%ba%93),需要注意的是 ApolloPortalDB 只需要在生产环境部署一个即可,而 ApolloConfigDB 需要在每个环境部署一套,示例假设你的 apollo 开启了 4 个环境, 即 dev、fat、uat、prod,那么就需要创建 4 个 ApolloConfigDB。 - -## 2. 调整部署配置 - -### 2.1 ApolloConfigDB 数据库连接信息 - -以 dev 环境为例,需要修改: - -1. `apollo-env-dev/service-apollo-config-server-dev.yaml`和`apollo-env-dev/service-apollo-admin-server-dev.yaml`中`application-github.properties`的`spring.datasource.url`,`spring.datasource.username`和`spring.datasource.password`配置 -2. `apollo-env-dev/service-mysql-for-apollo-dev-env.yaml`中 mysql endpoint 地址信息 - -### 2.2 eureka.service.url - -以 dev 环境为例,默认是以 replica 为 3 做的样例配置,如果 replica 数量改变了,那么也要对应修改`apollo-env-dev/service-apollo-config-server-dev.yaml`和`apollo-env-dev/service-apollo-admin-server-dev.yaml`中`application-github.properties`的`eureka.service.url`配置。 - -如果该配置希望以数据库中为准,那么在 yaml 中直接删除该配置项即可。 - -### 2.3 ApolloPortalDB 数据库连接信息 - -1. 修改`service-apollo-portal-server.yaml`中`application-github.properties`的`spring.datasource.url`,`spring.datasource.username`和`spring.datasource.password`配置 -2. 修改`service-apollo-portal-server.yaml`中 mysql endpoint 地址信息 - -### 2.4 ApolloPortal 的环境信息 - -1. 修改`service-apollo-portal-server.yaml`中`application-github.properties`的`apollo.portal.envs`配置 - * 如果该配置希望以数据库中为准,那么在 yaml 中直接删除该配置项即可。 -2. 修改`service-apollo-portal-server.yaml`中`apollo-env.properties`的各环境 meta server 地址信息 - -## 3. Deploy apollo on kubernetes - -示例假设 apollo 开启了 4 个环境, 即 dev、fat、uat、pro - -按照 scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh 文件的内容部署 apollo 即可。 - -```bash -scripts/apollo-on-kubernetes/kubernetes$ cat kubectl-apply.sh -# create namespace -kubectl create namespace sre - -# dev-env -kubectl apply -f apollo-env-dev/service-mysql-for-apollo-dev-env.yaml --record && \ -kubectl apply -f apollo-env-dev/service-apollo-config-server-dev.yaml --record && \ -kubectl apply -f apollo-env-dev/service-apollo-admin-server-dev.yaml --record - -# fat-env -kubectl apply -f apollo-env-fat/service-mysql-for-apollo-fat-env.yaml --record && \ -kubectl apply -f apollo-env-fat/service-apollo-config-server-fat.yaml --record && \ -kubectl apply -f apollo-env-fat/service-apollo-admin-server-fat.yaml --record - -# uat-env -kubectl apply -f apollo-env-uat/service-mysql-for-apollo-uat-env.yaml --record && \ -kubectl apply -f apollo-env-uat/service-apollo-config-server-uat.yaml --record && \ -kubectl apply -f apollo-env-uat/service-apollo-admin-server-uat.yaml --record - -# prod-env -kubectl apply -f apollo-env-prod/service-mysql-for-apollo-prod-env.yaml --record && \ -kubectl apply -f apollo-env-prod/service-apollo-config-server-prod.yaml --record && \ -kubectl apply -f apollo-env-prod/service-apollo-admin-server-prod.yaml --record - -# portal -kubectl apply -f service-apollo-portal-server.yaml --record -``` - -## 4. 验证所有 pod 处于 Running 并且 READY 状态 - -```bash -kubectl get pod -n sre -o wide - -# 示例结果 -NAME READY STATUS RESTARTS AGE IP NODE -deployment-apollo-admin-server-dev-b7bbd657-4d5jx 1/1 Running 0 2d 10.247.4.79 k8s-apollo-node-2 -deployment-apollo-admin-server-dev-b7bbd657-lwz5x 1/1 Running 0 2d 10.247.8.7 k8s-apollo-node-3 -deployment-apollo-admin-server-dev-b7bbd657-xs4wt 1/1 Running 0 2d 10.247.1.23 k8s-apollo-node-1 -deployment-apollo-admin-server-prod-699bbd894f-j977p 1/1 Running 0 2d 10.247.4.83 k8s-apollo-node-2 -deployment-apollo-admin-server-prod-699bbd894f-n9m54 1/1 Running 0 2d 10.247.8.11 k8s-apollo-node-3 -deployment-apollo-admin-server-prod-699bbd894f-vs56w 1/1 Running 0 2d 10.247.1.27 k8s-apollo-node-1 -deployment-apollo-admin-server-uat-7c855cd4f5-9br65 1/1 Running 0 2d 10.247.1.25 k8s-apollo-node-1 -deployment-apollo-admin-server-uat-7c855cd4f5-cck5g 1/1 Running 0 2d 10.247.8.9 k8s-apollo-node-3 -deployment-apollo-admin-server-uat-7c855cd4f5-x6gt4 1/1 Running 0 2d 10.247.4.81 k8s-apollo-node-2 -deployment-apollo-portal-server-6d4bbc879c-bv7cn 1/1 Running 0 2d 10.247.8.12 k8s-apollo-node-3 -deployment-apollo-portal-server-6d4bbc879c-c4zrb 1/1 Running 0 2d 10.247.1.28 k8s-apollo-node-1 -deployment-apollo-portal-server-6d4bbc879c-qm4mn 1/1 Running 0 2d 10.247.4.84 k8s-apollo-node-2 -statefulset-apollo-config-server-dev-0 1/1 Running 0 2d 10.247.8.6 k8s-apollo-node-3 -statefulset-apollo-config-server-dev-1 1/1 Running 0 2d 10.247.4.78 k8s-apollo-node-2 -statefulset-apollo-config-server-dev-2 1/1 Running 0 2d 10.247.1.22 k8s-apollo-node-1 -statefulset-apollo-config-server-prod-0 1/1 Running 0 2d 10.247.8.10 k8s-apollo-node-3 -statefulset-apollo-config-server-prod-1 1/1 Running 0 2d 10.247.4.82 k8s-apollo-node-2 -statefulset-apollo-config-server-prod-2 1/1 Running 0 2d 10.247.1.26 k8s-apollo-node-1 -statefulset-apollo-config-server-uat-0 1/1 Running 0 2d 10.247.8.8 k8s-apollo-node-3 -statefulset-apollo-config-server-uat-1 1/1 Running 0 2d 10.247.4.80 k8s-apollo-node-2 -statefulset-apollo-config-server-uat-2 1/1 Running 0 2d 10.247.1.24 k8s-apollo-node-1 -``` - -### 2.4 访问 apollo service - -- server 端(即 portal)
-    kubernetes-master-ip:30001 - -- client 端, 在 client 端无需再实现负载均衡
-Dev
-    kubernetes-master-ip:30002
-Fat
-    kubernetes-master-ip:30003
-Uat
-    kubernetes-master-ip:30004
-Prod
-    kubernetes-master-ip:30005
- -# FAQ - -## 关于 kubernetes yaml 文件 -具体内容请查看 `scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml` 注释
-其他类似。 - -## 关于 eureka.service.url -使用 meta-server(即 config-server) 的 pod name, config-server 务必使用 statefulset。 -格式为:`http://.:/eureka/`。 - -以 apollo-env-dev 为例: -```bash -('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔') -``` -你可以精简 config-server pod 的 name, 示例的长名字是为了更好的阅读与理解。 - -### 方式一:通过Spring Boot文件 application-github.properties配置(推荐) -推荐此方式配置 `eureka.service.url`,因为可以通过ConfigMap的方式传入容器,无需再修改数据库的字段。 - -Admin Server的配置: -```yaml ---- -# configmap for apollo-admin-server-dev -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-admin-server-dev -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = root - spring.datasource.password = test - eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ - -``` - -Config Server的配置: -```yaml ---- -# configmap for apollo-config-server-dev -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-config-server-dev -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env-mariadb.sre:3306/DevApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = root - spring.datasource.password = m6bCdQXa00 - eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/ - -``` - -### 方式二:修改数据表 ApolloConfigDB.ServerConfig -修改数据库表 ApolloConfigDB.ServerConfig的 eureka.service.url。 diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml deleted file mode 100755 index b14c1f1eb4a..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-admin-server-dev -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-admin-server-dev -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-admin-server-dev - labels: - app: service-apollo-admin-server-dev -spec: - ports: - - protocol: TCP - port: 8090 - targetPort: 8090 - selector: - app: pod-apollo-admin-server-dev - type: ClusterIP - sessionAffinity: ClientIP - ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: sre - name: deployment-apollo-admin-server-dev - labels: - app: deployment-apollo-admin-server-dev -spec: - replicas: 2 - selector: - matchLabels: - app: pod-apollo-admin-server-dev - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-admin-server-dev - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-admin-server-dev - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-admin-server-dev - configMap: - name: configmap-apollo-admin-server-dev - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-adminservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-admin-server-dev - ports: - - protocol: TCP - containerPort: 8090 - - volumeMounts: - - name: volume-configmap-apollo-admin-server-dev - mountPath: /apollo-adminservice/config/application-github.properties - subPath: application-github.properties - - env: - - name: APOLLO_ADMIN_SERVICE_NAME - value: "service-apollo-admin-server-dev.sre" - - readinessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-config-server-dev.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-config-server-dev.yaml deleted file mode 100755 index 3447f136500..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-config-server-dev.yaml +++ /dev/null @@ -1,142 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-config-server-dev -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-config-server-dev -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-meta-server-dev - labels: - app: service-apollo-meta-server-dev -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - selector: - app: pod-apollo-config-server-dev - type: ClusterIP - clusterIP: None - sessionAffinity: ClientIP - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-config-server-dev - labels: - app: service-apollo-config-server-dev -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30002 - selector: - app: pod-apollo-config-server-dev - type: NodePort - sessionAffinity: ClientIP - ---- -kind: StatefulSet -apiVersion: apps/v1 -metadata: - namespace: sre - name: statefulset-apollo-config-server-dev - labels: - app: statefulset-apollo-config-server-dev -spec: - serviceName: service-apollo-meta-server-dev - replicas: 2 - selector: - matchLabels: - app: pod-apollo-config-server-dev - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-config-server-dev - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-config-server-dev - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-config-server-dev - configMap: - name: configmap-apollo-config-server-dev - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-configservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-config-server-dev - ports: - - protocol: TCP - containerPort: 8080 - - volumeMounts: - - name: volume-configmap-apollo-config-server-dev - mountPath: /apollo-configservice/config/application-github.properties - subPath: application-github.properties - - env: - - name: APOLLO_CONFIG_SERVICE_NAME - value: "service-apollo-config-server-dev.sre" - - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml deleted file mode 100755 index 45351473aad..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# 为外部 mysql 服务设置 service -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-dev-env - labels: - app: service-mysql-for-apollo-dev-env -spec: - ports: - - protocol: TCP - port: 3306 - targetPort: 3306 - type: ClusterIP - sessionAffinity: None - ---- -kind: Endpoints -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-dev-env -subsets: - - addresses: - - ip: your-mysql-addresses - ports: - - protocol: TCP - port: 3306 diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-admin-server-fat.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-admin-server-fat.yaml deleted file mode 100755 index 0b6d2cea3f6..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-admin-server-fat.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-admin-server-fat -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-admin-server-fat -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-fat-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-fat-0.service-apollo-meta-server-fat:8080/eureka/,http://statefulset-apollo-config-server-fat-1.service-apollo-meta-server-fat:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-admin-server-fat - labels: - app: service-apollo-admin-server-fat -spec: - ports: - - protocol: TCP - port: 8090 - targetPort: 8090 - selector: - app: pod-apollo-admin-server-fat - type: ClusterIP - sessionAffinity: ClientIP - ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: sre - name: deployment-apollo-admin-server-fat - labels: - app: deployment-apollo-admin-server-fat -spec: - replicas: 2 - selector: - matchLabels: - app: pod-apollo-admin-server-fat - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-admin-server-fat - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-admin-server-fat - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-admin-server-fat - configMap: - name: configmap-apollo-admin-server-fat - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-adminservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-admin-server-fat - ports: - - protocol: TCP - containerPort: 8090 - - volumeMounts: - - name: volume-configmap-apollo-admin-server-fat - mountPath: /apollo-adminservice/config/application-github.properties - subPath: application-github.properties - - env: - - name: APOLLO_ADMIN_SERVICE_NAME - value: "service-apollo-admin-server-fat.sre" - - readinessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-config-server-fat.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-config-server-fat.yaml deleted file mode 100755 index fae5495e8e5..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-apollo-config-server-fat.yaml +++ /dev/null @@ -1,141 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-config-server-fat -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-config-server-fat -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-fat-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-fat-0.service-apollo-meta-server-fat:8080/eureka/,http://statefulset-apollo-config-server-fat-1.service-apollo-meta-server-fat:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-meta-server-fat - labels: - app: service-apollo-meta-server-fat -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - selector: - app: pod-apollo-config-server-fat - type: ClusterIP - clusterIP: None - sessionAffinity: ClientIP - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-config-server-fat - labels: - app: service-apollo-config-server-fat -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30003 - selector: - app: pod-apollo-config-server-fat - type: NodePort - sessionAffinity: ClientIP - ---- -kind: StatefulSet -apiVersion: apps/v1 -metadata: - namespace: sre - name: statefulset-apollo-config-server-fat - labels: - app: statefulset-apollo-config-server-fat -spec: - serviceName: service-apollo-meta-server-fat - replicas: 2 - selector: - matchLabels: - app: pod-apollo-config-server-fat - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-config-server-fat - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-config-server-fat - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-config-server-fat - configMap: - name: configmap-apollo-config-server-fat - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-configservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-config-server-fat - ports: - - protocol: TCP - containerPort: 8080 - - volumeMounts: - - name: volume-configmap-apollo-config-server-fat - mountPath: /apollo-configservice/config/application-github.properties - subPath: application-github.properties - env: - - name: APOLLO_CONFIG_SERVICE_NAME - value: "service-apollo-config-server-fat.sre" - - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-mysql-for-apollo-fat-env.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-mysql-for-apollo-fat-env.yaml deleted file mode 100755 index 08715055209..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-fat/service-mysql-for-apollo-fat-env.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-fat-env - labels: - app: service-mysql-for-apollo-fat-env -spec: - ports: - - protocol: TCP - port: 3306 - targetPort: 3306 - type: ClusterIP - sessionAffinity: None - ---- -kind: Endpoints -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-fat-env -subsets: - - addresses: - - ip: your-mysql-addresses - ports: - - protocol: TCP - port: 3306 \ No newline at end of file diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-admin-server-prod.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-admin-server-prod.yaml deleted file mode 100755 index d696b016bf0..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-admin-server-prod.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-admin-server-prod -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-admin-server-prod -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-prod-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-prod-0.service-apollo-meta-server-prod:8080/eureka/,http://statefulset-apollo-config-server-prod-1.service-apollo-meta-server-prod:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-admin-server-prod - labels: - app: service-apollo-admin-server-prod -spec: - ports: - - protocol: TCP - port: 8090 - targetPort: 8090 - selector: - app: pod-apollo-admin-server-prod - type: ClusterIP - sessionAffinity: ClientIP - ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: sre - name: deployment-apollo-admin-server-prod - labels: - app: deployment-apollo-admin-server-prod -spec: - replicas: 2 - selector: - matchLabels: - app: pod-apollo-admin-server-prod - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-admin-server-prod - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-admin-server-prod - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-admin-server-prod - configMap: - name: configmap-apollo-admin-server-prod - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-adminservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-admin-server-prod - ports: - - protocol: TCP - containerPort: 8090 - - volumeMounts: - - name: volume-configmap-apollo-admin-server-prod - mountPath: /apollo-adminservice/config/application-github.properties - subPath: application-github.properties - - env: - - name: APOLLO_ADMIN_SERVICE_NAME - value: "service-apollo-admin-server-prod.sre" - - readinessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-config-server-prod.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-config-server-prod.yaml deleted file mode 100755 index e83f01c780a..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-config-server-prod.yaml +++ /dev/null @@ -1,141 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-config-server-prod -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-config-server-prod -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-prod-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-prod-0.service-apollo-meta-server-prod:8080/eureka/,http://statefulset-apollo-config-server-prod-1.service-apollo-meta-server-prod:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-meta-server-prod - labels: - app: service-apollo-meta-server-prod -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - selector: - app: pod-apollo-config-server-prod - type: ClusterIP - clusterIP: None - sessionAffinity: ClientIP - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-config-server-prod - labels: - app: service-apollo-config-server-prod -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30005 - selector: - app: pod-apollo-config-server-prod - type: NodePort - sessionAffinity: ClientIP - ---- -kind: StatefulSet -apiVersion: apps/v1 -metadata: - namespace: sre - name: statefulset-apollo-config-server-prod - labels: - app: statefulset-apollo-config-server-prod -spec: - serviceName: service-apollo-meta-server-prod - replicas: 2 - selector: - matchLabels: - app: pod-apollo-config-server-prod - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-config-server-prod - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-config-server-prod - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-config-server-prod - configMap: - name: configmap-apollo-config-server-prod - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-configservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-config-server-prod - ports: - - protocol: TCP - containerPort: 8080 - - volumeMounts: - - name: volume-configmap-apollo-config-server-prod - mountPath: /apollo-configservice/config/application-github.properties - subPath: application-github.properties - env: - - name: APOLLO_CONFIG_SERVICE_NAME - value: "service-apollo-config-server-prod.sre" - - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml deleted file mode 100755 index 3350843ef0d..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-prod-env - labels: - app: service-mysql-for-apollo-prod-env -spec: - ports: - - protocol: TCP - port: 3306 - targetPort: 3306 - type: ClusterIP - sessionAffinity: None - ---- -kind: Endpoints -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-prod-env -subsets: - - addresses: - - ip: your-mysql-addresses - ports: - - protocol: TCP - port: 3306 \ No newline at end of file diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-admin-server-uat.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-admin-server-uat.yaml deleted file mode 100755 index a29836d41d6..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-admin-server-uat.yaml +++ /dev/null @@ -1,122 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-admin-server-uat -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-admin-server-uat -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-uat-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-uat-0.service-apollo-meta-server-uat:8080/eureka/,http://statefulset-apollo-config-server-uat-1.service-apollo-meta-server-uat:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-admin-server-uat - labels: - app: service-apollo-admin-server-uat -spec: - ports: - - protocol: TCP - port: 8090 - targetPort: 8090 - selector: - app: pod-apollo-admin-server-uat - type: ClusterIP - sessionAffinity: ClientIP - ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: sre - name: deployment-apollo-admin-server-uat - labels: - app: deployment-apollo-admin-server-uat -spec: - replicas: 2 - selector: - matchLabels: - app: pod-apollo-admin-server-uat - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-admin-server-uat - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-admin-server-uat - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-admin-server-uat - configMap: - name: configmap-apollo-admin-server-uat - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-adminservice:2.0.1 - imagePullPolicy: IfNotPresent - name: container-apollo-admin-server-uat - ports: - - protocol: TCP - containerPort: 8090 - - volumeMounts: - - name: volume-configmap-apollo-admin-server-uat - mountPath: /apollo-adminservice/config/application-github.properties - subPath: application-github.properties - - env: - - name: APOLLO_ADMIN_SERVICE_NAME - value: "service-apollo-admin-server-uat.sre" - - readinessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8090 - initialDelaySeconds: 120 - periodSeconds: 10 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-config-server-uat.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-config-server-uat.yaml deleted file mode 100755 index 94eff052229..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-apollo-config-server-uat.yaml +++ /dev/null @@ -1,141 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# configmap for apollo-config-server-uat -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-config-server-uat -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-uat-env.sre:3306/ApolloConfigDB?characterEncoding=utf8 - spring.datasource.username = FillInCorrectUser - spring.datasource.password = FillInCorrectPassword - eureka.service.url = http://statefulset-apollo-config-server-uat-0.service-apollo-meta-server-uat:8080/eureka/,http://statefulset-apollo-config-server-uat-1.service-apollo-meta-server-uat:8080/eureka/ - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-meta-server-uat - labels: - app: service-apollo-meta-server-uat -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - selector: - app: pod-apollo-config-server-uat - type: ClusterIP - clusterIP: None - sessionAffinity: ClientIP - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-config-server-uat - labels: - app: service-apollo-config-server-uat -spec: - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30004 - selector: - app: pod-apollo-config-server-uat - type: NodePort - sessionAffinity: ClientIP - ---- -kind: StatefulSet -apiVersion: apps/v1 -metadata: - namespace: sre - name: statefulset-apollo-config-server-uat - labels: - app: statefulset-apollo-config-server-uat -spec: - serviceName: service-apollo-meta-server-uat - replicas: 2 - selector: - matchLabels: - app: pod-apollo-config-server-uat - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-config-server-uat - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-config-server-uat - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-config-server-uat - configMap: - name: configmap-apollo-config-server-uat - items: - - key: application-github.properties - path: application-github.properties - - containers: - - image: apolloconfig/apollo-configservice:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-config-server-uat - ports: - - protocol: TCP - containerPort: 8080 - - volumeMounts: - - name: volume-configmap-apollo-config-server-uat - mountPath: /apollo-configservice/config/application-github.properties - subPath: application-github.properties - env: - - name: APOLLO_CONFIG_SERVICE_NAME - value: "service-apollo-config-server-uat.sre" - - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 120 - periodSeconds: 15 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-mysql-for-apollo-uat-env.yaml b/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-mysql-for-apollo-uat-env.yaml deleted file mode 100755 index bafb71c2188..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/apollo-env-uat/service-mysql-for-apollo-uat-env.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-uat-env - labels: - app: service-mysql-for-apollo-uat-env -spec: - ports: - - protocol: TCP - port: 3306 - targetPort: 3306 - type: ClusterIP - sessionAffinity: None - ---- -kind: Endpoints -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-apollo-uat-env -subsets: - - addresses: - - ip: your-mysql-addresses - ports: - - protocol: TCP - port: 3306 \ No newline at end of file diff --git a/scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh b/scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh deleted file mode 100755 index d8f134414bf..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# create namespace -kubectl create namespace sre - -# dev-env -kubectl apply -f apollo-env-dev/service-mysql-for-apollo-dev-env.yaml --record && \ -kubectl apply -f apollo-env-dev/service-apollo-config-server-dev.yaml --record && \ -kubectl apply -f apollo-env-dev/service-apollo-admin-server-dev.yaml --record - -# fat-env -kubectl apply -f apollo-env-fat/service-mysql-for-apollo-fat-env.yaml --record && \ -kubectl apply -f apollo-env-fat/service-apollo-config-server-fat.yaml --record && \ -kubectl apply -f apollo-env-fat/service-apollo-admin-server-fat.yaml --record - -# uat-env -kubectl apply -f apollo-env-uat/service-mysql-for-apollo-uat-env.yaml --record && \ -kubectl apply -f apollo-env-uat/service-apollo-config-server-uat.yaml --record && \ -kubectl apply -f apollo-env-uat/service-apollo-admin-server-uat.yaml --record - -# prod-env -kubectl apply -f apollo-env-prod/service-mysql-for-apollo-prod-env.yaml --record && \ -kubectl apply -f apollo-env-prod/service-apollo-config-server-prod.yaml --record && \ -kubectl apply -f apollo-env-prod/service-apollo-admin-server-prod.yaml --record - -# portal -kubectl apply -f service-apollo-portal-server.yaml --record diff --git a/scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml b/scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml deleted file mode 100755 index 7aea48601f1..00000000000 --- a/scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml +++ /dev/null @@ -1,170 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -# 为外部 mysql 服务设置 service -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-portal-server - labels: - app: service-mysql-for-portal-server -spec: - ports: - - protocol: TCP - port: 3306 - targetPort: 3306 - type: ClusterIP - sessionAffinity: None ---- -kind: Endpoints -apiVersion: v1 -metadata: - namespace: sre - name: service-mysql-for-portal-server -subsets: - - addresses: - # 更改为你的 mysql addresses, 例如 1.1.1.1 - - ip: your-mysql-addresses - ports: - - protocol: TCP - port: 3306 - ---- -# configmap for apollo-portal-server -kind: ConfigMap -apiVersion: v1 -metadata: - namespace: sre - name: configmap-apollo-portal-server -data: - application-github.properties: | - spring.datasource.url = jdbc:mysql://service-mysql-for-portal-server.sre:3306/ApolloPortalDB?characterEncoding=utf8 - # mysql username - spring.datasource.username = FillInCorrectUser - # mysql password - spring.datasource.password = FillInCorrectPassword - # enabled environments - apollo.portal.envs = dev,fat,uat,pro - apollo-env.properties: | - dev.meta=http://service-apollo-config-server-dev.sre:8080 - fat.meta=http://service-apollo-config-server-fat.sre:8080 - uat.meta=http://service-apollo-config-server-uat.sre:8080 - pro.meta=http://service-apollo-config-server-prod.sre:8080 - ---- -kind: Service -apiVersion: v1 -metadata: - namespace: sre - name: service-apollo-portal-server - labels: - app: service-apollo-portal-server -spec: - ports: - - protocol: TCP - port: 8070 - targetPort: 8070 - nodePort: 30001 - selector: - app: pod-apollo-portal-server - type: NodePort - # portal session 保持 - sessionAffinity: ClientIP - ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: sre - name: deployment-apollo-portal-server - labels: - app: deployment-apollo-portal-server -spec: - # 2 个实例 - replicas: 2 - selector: - matchLabels: - app: pod-apollo-portal-server - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: pod-apollo-portal-server - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - pod-apollo-portal-server - topologyKey: kubernetes.io/hostname - - volumes: - - name: volume-configmap-apollo-portal-server - configMap: - name: configmap-apollo-portal-server - items: - - key: application-github.properties - path: application-github.properties - - key: apollo-env.properties - path: apollo-env.properties - containers: - - image: apolloconfig/apollo-portal:2.0.1 - securityContext: - privileged: true - imagePullPolicy: IfNotPresent - name: container-apollo-portal-server - ports: - - protocol: TCP - containerPort: 8070 - - volumeMounts: - - name: volume-configmap-apollo-portal-server - mountPath: /apollo-portal/config/application-github.properties - subPath: application-github.properties - - name: volume-configmap-apollo-portal-server - mountPath: /apollo-portal/config/apollo-env.properties - subPath: apollo-env.properties - - env: - - name: APOLLO_PORTAL_SERVICE_NAME - value: "service-apollo-portal-server.sre" - - readinessProbe: - tcpSocket: - port: 8070 - initialDelaySeconds: 10 - periodSeconds: 5 - - livenessProbe: - tcpSocket: - port: 8070 - # 120s 内, server 未启动则重启 container - initialDelaySeconds: 120 - periodSeconds: 15 - - dnsPolicy: ClusterFirst - restartPolicy: Always diff --git a/scripts/docker-quick-start/docker-compose.yml b/scripts/docker-quick-start/docker-compose.yml deleted file mode 100644 index cf7cc3f23a8..00000000000 --- a/scripts/docker-quick-start/docker-compose.yml +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright 2022 Apollo Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -version: '2' - -services: - apollo-quick-start: - image: nobodyiam/apollo-quick-start - container_name: apollo-quick-start - depends_on: - - apollo-db - ports: - - "8080:8080" - - "8090:8090" - - "8070:8070" - links: - - apollo-db - - apollo-db: - image: mysql:5.7 - container_name: apollo-db - environment: - TZ: Asia/Shanghai - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - depends_on: - - apollo-dbdata - ports: - - "13306:3306" - volumes: - - ./sql:/docker-entrypoint-initdb.d - volumes_from: - - apollo-dbdata - - apollo-dbdata: - image: alpine:latest - container_name: apollo-dbdata - volumes: - - /var/lib/mysql diff --git a/scripts/docker-quick-start/sql/apolloconfigdb.sql b/scripts/docker-quick-start/sql/apolloconfigdb.sql deleted file mode 100644 index 3d25a99f559..00000000000 --- a/scripts/docker-quick-start/sql/apolloconfigdb.sql +++ /dev/null @@ -1,461 +0,0 @@ --- --- Copyright 2022 Apollo Authors --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - -# Create Database -# ------------------------------------------------------------ -CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4; - -Use ApolloConfigDB; - -# Dump of table app -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `App`; - -CREATE TABLE `App` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名', - `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id', - `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字', - `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName', - `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_Name` (`Name`(191)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; - - - -# Dump of table appnamespace -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `AppNamespace`; - -CREATE TABLE `AppNamespace` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一', - `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id', - `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型', - `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共', - `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`), - KEY `Name_AppId` (`Name`,`AppId`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义'; - - - -# Dump of table audit -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Audit`; - -CREATE TABLE `Audit` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名', - `EntityId` int(10) unsigned DEFAULT NULL COMMENT '记录ID', - `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型', - `Comment` varchar(500) DEFAULT NULL COMMENT '备注', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表'; - - - -# Dump of table cluster -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Cluster`; - -CREATE TABLE `Cluster` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字', - `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id', - `ParentClusterId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`), - KEY `IX_ParentClusterId` (`ParentClusterId`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群'; - - - -# Dump of table commit -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Commit`; - -CREATE TABLE `Commit` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `ChangeSets` longtext NOT NULL COMMENT '修改变更集', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', - `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', - `Comment` varchar(500) DEFAULT NULL COMMENT '备注', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `AppId` (`AppId`(191)), - KEY `ClusterName` (`ClusterName`(191)), - KEY `NamespaceName` (`NamespaceName`(191)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表'; - -# Dump of table grayreleaserule -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `GrayReleaseRule`; - -CREATE TABLE `GrayReleaseRule` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', - `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', - `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name', - `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则', - `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release', - `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表'; - - -# Dump of table instance -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Instance`; - -CREATE TABLE `Instance` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', - `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name', - `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `IX_UNIQUE_KEY` (`AppId`,`ClusterName`,`Ip`,`DataCenter`), - KEY `IX_IP` (`Ip`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例'; - - - -# Dump of table instanceconfig -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `InstanceConfig`; - -CREATE TABLE `InstanceConfig` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `InstanceId` int(11) unsigned DEFAULT NULL COMMENT 'Instance Id', - `ConfigAppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App Id', - `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name', - `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name', - `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', - `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceId`,`ConfigAppId`,`ConfigNamespaceName`), - KEY `IX_ReleaseKey` (`ReleaseKey`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_Valid_Namespace` (`ConfigAppId`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息'; - - - -# Dump of table item -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Item`; - -CREATE TABLE `Item` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', - `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key', - `Value` longtext NOT NULL COMMENT '配置项值', - `Comment` varchar(1024) DEFAULT '' COMMENT '注释', - `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `IX_GroupId` (`NamespaceId`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目'; - - - -# Dump of table namespace -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Namespace`; - -CREATE TABLE `Namespace` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name', - `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_ClusterName_NamespaceName_DeletedAt` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191),`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_NamespaceName` (`NamespaceName`(191)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间'; - - - -# Dump of table namespacelock -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `NamespaceLock`; - -CREATE TABLE `NamespaceLock` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id', - `NamespaceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceId', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_NamespaceId_DeletedAt` (`NamespaceId`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁'; - - - -# Dump of table release -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Release`; - -CREATE TABLE `Release` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key', - `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字', - `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', - `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', - `Configurations` longtext NOT NULL COMMENT '发布配置', - `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_ReleaseKey_DeletedAt` (`ReleaseKey`,`DeletedAt`), - KEY `AppId_ClusterName_GroupName` (`AppId`(191),`ClusterName`(191),`NamespaceName`(191)), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布'; - - -# Dump of table releasehistory -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ReleaseHistory`; - -CREATE TABLE `ReleaseHistory` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `AppId` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName', - `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName', - `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名', - `ReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release Id', - `PreviousReleaseId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseId', - `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度', - `OperationContext` longtext NOT NULL COMMENT '发布上下文信息', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `IX_Namespace` (`AppId`,`ClusterName`,`NamespaceName`,`BranchName`), - KEY `IX_ReleaseId` (`ReleaseId`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史'; - - -# Dump of table releasemessage -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ReleaseMessage`; - -CREATE TABLE `ReleaseMessage` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容', - `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_Message` (`Message`(191)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息'; - - - -# Dump of table serverconfig -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ServerConfig`; - -CREATE TABLE `ServerConfig` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key', - `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群', - `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值', - `Comment` varchar(1024) DEFAULT '' COMMENT '注释', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_Key_Cluster_DeletedAt` (`Key`,`Cluster`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置'; - -# Dump of table accesskey -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `AccessKey`; - -CREATE TABLE `AccessKey` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret', - `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_Secret_DeletedAt` (`AppId`,`Secret`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥'; - -# Config -# ------------------------------------------------------------ -INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`) -VALUES - ('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'), - ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'), - ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'), - ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!'), - ('item.key.length.limit', 'default', '128', 'item key 最大长度限制'); - -# Sample Data -# ------------------------------------------------------------ -INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`) -VALUES - ('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com'); - -INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`) -VALUES - ('application', 'SampleApp', 'properties', 0, 'default app namespace'); - -INSERT INTO `Cluster` (`Name`, `AppId`) -VALUES - ('default', 'SampleApp'); - -INSERT INTO `Namespace` (`Id`, `AppId`, `ClusterName`, `NamespaceName`) -VALUES - (1, 'SampleApp', 'default', 'application'); - - -INSERT INTO `Item` (`NamespaceId`, `Key`, `Value`, `Comment`, `LineNum`) -VALUES - (1, 'timeout', '100', 'sample timeout配置', 1); - -INSERT INTO `Release` (`ReleaseKey`, `Name`, `Comment`, `AppId`, `ClusterName`, `NamespaceName`, `Configurations`) -VALUES - ('20161009155425-d3a0749c6e20bc15', '20161009155424-release', 'Sample发布', 'SampleApp', 'default', 'application', '{\"timeout\":\"100\"}'); - -INSERT INTO `ReleaseHistory` (`AppId`, `ClusterName`, `NamespaceName`, `BranchName`, `ReleaseId`, `PreviousReleaseId`, `Operation`, `OperationContext`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`) -VALUES - ('SampleApp', 'default', 'application', 'default', 1, 0, 0, '{}', 'apollo', 'apollo'); - -INSERT INTO `ReleaseMessage` (`Message`) -VALUES - ('SampleApp+default+application'); - -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/scripts/docker-quick-start/sql/apolloportaldb.sql b/scripts/docker-quick-start/sql/apolloportaldb.sql deleted file mode 100644 index 54d27075364..00000000000 --- a/scripts/docker-quick-start/sql/apolloportaldb.sql +++ /dev/null @@ -1,420 +0,0 @@ --- --- Copyright 2022 Apollo Authors --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - -# Create Database -# ------------------------------------------------------------ -CREATE DATABASE IF NOT EXISTS ApolloPortalDB DEFAULT CHARACTER SET = utf8mb4; - -Use ApolloPortalDB; - -# Dump of table app -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `App`; - -CREATE TABLE `App` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名', - `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id', - `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字', - `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName', - `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_Name` (`Name`(191)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表'; - - - -# Dump of table appnamespace -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `AppNamespace`; - -CREATE TABLE `AppNamespace` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键', - `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一', - `AppId` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id', - `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型', - `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共', - `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`), - KEY `Name_AppId` (`Name`,`AppId`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义'; - - - -# Dump of table consumer -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Consumer`; - -CREATE TABLE `Consumer` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名', - `OrgId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门Id', - `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字', - `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName', - `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开放API消费者'; - - - -# Dump of table consumeraudit -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ConsumerAudit`; - -CREATE TABLE `ConsumerAudit` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id', - `Uri` varchar(1024) NOT NULL DEFAULT '' COMMENT '访问的Uri', - `Method` varchar(16) NOT NULL DEFAULT '' COMMENT '访问的Method', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_ConsumerId` (`ConsumerId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer审计表'; - - - -# Dump of table consumerrole -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ConsumerRole`; - -CREATE TABLE `ConsumerRole` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id', - `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_ConsumerId_RoleId_DeletedAt` (`ConsumerId`,`RoleId`,`DeletedAt`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_RoleId` (`RoleId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer和role的绑定表'; - - - -# Dump of table consumertoken -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ConsumerToken`; - -CREATE TABLE `ConsumerToken` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'ConsumerId', - `Token` varchar(128) NOT NULL DEFAULT '' COMMENT 'token', - `Expires` datetime NOT NULL DEFAULT '2099-01-01 00:00:00' COMMENT 'token失效时间', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_Token_DeletedAt` (`Token`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer token表'; - -# Dump of table favorite -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Favorite`; - -CREATE TABLE `Favorite` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `UserId` varchar(32) NOT NULL DEFAULT 'default' COMMENT '收藏的用户', - `AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID', - `Position` int(32) NOT NULL DEFAULT '10000' COMMENT '收藏顺序', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_UserId_AppId_DeletedAt` (`UserId`,`AppId`,`DeletedAt`), - KEY `AppId` (`AppId`(191)), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='应用收藏表'; - -# Dump of table permission -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Permission`; - -CREATE TABLE `Permission` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `PermissionType` varchar(32) NOT NULL DEFAULT '' COMMENT '权限类型', - `TargetId` varchar(256) NOT NULL DEFAULT '' COMMENT '权限对象类型', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_TargetId_PermissionType_DeletedAt` (`TargetId`,`PermissionType`,`DeletedAt`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='permission表'; - - - -# Dump of table role -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Role`; - -CREATE TABLE `Role` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `RoleName` varchar(256) NOT NULL DEFAULT '' COMMENT 'Role name', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_RoleName_DeletedAt` (`RoleName`,`DeletedAt`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表'; - - - -# Dump of table rolepermission -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `RolePermission`; - -CREATE TABLE `RolePermission` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id', - `PermissionId` int(10) unsigned DEFAULT NULL COMMENT 'Permission Id', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_RoleId_PermissionId_DeletedAt` (`RoleId`,`PermissionId`,`DeletedAt`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_PermissionId` (`PermissionId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和权限的绑定表'; - - - -# Dump of table serverconfig -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `ServerConfig`; - -CREATE TABLE `ServerConfig` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key', - `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值', - `Comment` varchar(1024) DEFAULT '' COMMENT '注释', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_Key_DeletedAt` (`Key`,`DeletedAt`), - KEY `DataChange_LastTime` (`DataChange_LastTime`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置'; - - - -# Dump of table userrole -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `UserRole`; - -CREATE TABLE `UserRole` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `UserId` varchar(128) DEFAULT '' COMMENT '用户身份标识', - `RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id', - `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal', - `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds', - `DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀', - `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀', - `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_UserId_RoleId_DeletedAt` (`UserId`,`RoleId`,`DeletedAt`), - KEY `IX_DataChange_LastTime` (`DataChange_LastTime`), - KEY `IX_RoleId` (`RoleId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和role的绑定表'; - -# Dump of table Users -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Users`; - -CREATE TABLE `Users` ( - `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `Username` varchar(64) NOT NULL DEFAULT 'default' COMMENT '用户登录账户', - `Password` varchar(512) NOT NULL DEFAULT 'default' COMMENT '密码', - `UserDisplayName` varchar(512) NOT NULL DEFAULT 'default' COMMENT '用户名称', - `Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址', - `Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效', - PRIMARY KEY (`Id`), - UNIQUE KEY `UK_Username` (`Username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表'; - - -# Dump of table Authorities -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `Authorities`; - -CREATE TABLE `Authorities` ( - `Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id', - `Username` varchar(64) NOT NULL, - `Authority` varchar(50) NOT NULL, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - - -# Config -# ------------------------------------------------------------ -INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`) -VALUES - ('apollo.portal.envs', 'dev', '可支持的环境列表'), - ('organizations', '[{\"orgId\":\"TEST1\",\"orgName\":\"样例部门1\"},{\"orgId\":\"TEST2\",\"orgName\":\"样例部门2\"}]', '部门列表'), - ('superAdmin', 'apollo', 'Portal超级管理员'), - ('api.readTimeout', '10000', 'http接口read timeout'), - ('consumer.token.salt', 'someSalt', 'consumer token salt'), - ('admin.createPrivateNamespace.switch', 'true', '是否允许项目管理员创建私有namespace'), - ('configView.memberOnly.envs', 'dev', '只对项目成员显示配置信息的环境列表,多个env以英文逗号分隔'), - ('apollo.portal.meta.servers', '{}', '各环境Meta Service列表'); - -INSERT INTO `Users` (`Username`, `Password`, `UserDisplayName`, `Email`, `Enabled`) -VALUES - ('apollo', '$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS', 'apollo', 'apollo@acme.com', 1); - -INSERT INTO `Authorities` (`Username`, `Authority`) VALUES ('apollo', 'ROLE_user'); - -# Sample Data -# ------------------------------------------------------------ -INSERT INTO `App` (`AppId`, `Name`, `OrgId`, `OrgName`, `OwnerName`, `OwnerEmail`) -VALUES - ('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com'); - -INSERT INTO `AppNamespace` (`Name`, `AppId`, `Format`, `IsPublic`, `Comment`) -VALUES - ('application', 'SampleApp', 'properties', 0, 'default app namespace'); - -INSERT INTO `Permission` (`Id`, `PermissionType`, `TargetId`) -VALUES - (1, 'CreateCluster', 'SampleApp'), - (2, 'CreateNamespace', 'SampleApp'), - (3, 'AssignRole', 'SampleApp'), - (4, 'ModifyNamespace', 'SampleApp+application'), - (5, 'ReleaseNamespace', 'SampleApp+application'); - -INSERT INTO `Role` (`Id`, `RoleName`) -VALUES - (1, 'Master+SampleApp'), - (2, 'ModifyNamespace+SampleApp+application'), - (3, 'ReleaseNamespace+SampleApp+application'); - -INSERT INTO `RolePermission` (`RoleId`, `PermissionId`) -VALUES - (1, 1), - (1, 2), - (1, 3), - (2, 4), - (3, 5); - -INSERT INTO `UserRole` (`UserId`, `RoleId`) -VALUES - ('apollo', 1), - ('apollo', 2), - ('apollo', 3); - --- spring session (https://github.com/spring-projects/spring-session/blob/faee8f1bdb8822a5653a81eba838dddf224d92d6/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc/schema-mysql.sql) -CREATE TABLE SPRING_SESSION ( - PRIMARY_ID CHAR(36) NOT NULL, - SESSION_ID CHAR(36) NOT NULL, - CREATION_TIME BIGINT NOT NULL, - LAST_ACCESS_TIME BIGINT NOT NULL, - MAX_INACTIVE_INTERVAL INT NOT NULL, - EXPIRY_TIME BIGINT NOT NULL, - PRINCIPAL_NAME VARCHAR(100), - CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID) -) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; - -CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID); -CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME); -CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME); - -CREATE TABLE SPRING_SESSION_ATTRIBUTES ( - SESSION_PRIMARY_ID CHAR(36) NOT NULL, - ATTRIBUTE_NAME VARCHAR(200) NOT NULL, - ATTRIBUTE_BYTES BLOB NOT NULL, - CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME), - CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) REFERENCES SPRING_SESSION(PRIMARY_ID) ON DELETE CASCADE -) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; - -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;