├── .gitignore ├── .gitmodules ├── .metadata ├── .nojekyll ├── .taskcat.yml ├── CODEOWNERS ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── docs ├── generated │ ├── parameters │ │ └── index.adoc │ ├── regions │ │ └── index.adoc │ └── services │ │ ├── index.adoc │ │ └── metadata.adoc ├── images │ ├── GrafanaConsole.png │ ├── aws-quickstart-graphic.png │ ├── cfn_outputs.png │ ├── clickhouse-architecture-diagram.png │ ├── clickhouse-architecture-diagram.pptx │ ├── clickhouse-cluster-architecture-diagram.png │ ├── clickhouse_cluster_architecture_diagram.png │ ├── cloudformation_outputs.png │ ├── ec2.png │ ├── secretsmanager.png │ ├── switchyOmega1.png │ ├── switchyOmega2.png │ ├── switchyOmega3.png │ └── switchyOmega4.png ├── languages │ └── docs-cn │ │ ├── _layout_cfn.adoc │ │ ├── index.adoc │ │ ├── partner_editable │ │ ├── _settings.adoc │ │ ├── additional_info.adoc │ │ ├── architecture.adoc │ │ ├── deploy_steps.adoc │ │ ├── deployment_options.adoc │ │ ├── faq_troubleshooting.adoc │ │ ├── licenses.adoc │ │ ├── overview_target_and_usage.adoc │ │ ├── pre-reqs.adoc │ │ ├── product_description.adoc │ │ ├── regions.adoc │ │ ├── service_limits.adoc │ │ └── specialized_knowledge.adoc │ │ └── translate-only │ │ ├── LICENSE │ │ ├── _layout_cfn_cdk_module.adoc │ │ ├── _layout_cfn_eks_module.adoc │ │ ├── cost.adoc │ │ ├── deployment_steps.adoc │ │ ├── deployment_steps_cdk_module.adoc │ │ ├── deployment_steps_eks_module.adoc │ │ ├── disclaimer.adoc │ │ ├── index-docinfo-footer.html │ │ ├── introduction.adoc │ │ ├── overview.adoc │ │ ├── planning_deployment.adoc │ │ └── planning_deployment_eks_module.adoc └── partner_editable │ ├── _settings.adoc │ ├── additional_info.adoc │ ├── architecture.adoc │ ├── deploy_steps.adoc │ ├── deployment_options.adoc │ ├── faq_troubleshooting.adoc │ ├── licenses.adoc │ ├── overview_target_and_usage.adoc │ ├── pre-reqs.adoc │ ├── product_description.adoc │ ├── regions.adoc │ ├── service_limits.adoc │ └── specialized_knowledge.adoc ├── scripts ├── .gitkeep ├── clickhouse-arm-client-install.sh ├── clickhouse-arm-install.sh ├── clickhouse-client-install.sh ├── clickhouse-install.sh ├── create-table-demo.sql ├── downloaddata.sh ├── find-clickhouse-node.py ├── find-secret.py ├── find-zookeeper-node.py └── zookeeper-install.sh └── templates ├── clickhouse-arm-entrypoint-existing-vpc.template.yaml ├── clickhouse-arm-entrypoint-new-vpc.template.yaml ├── clickhouse-entrypoint-existing-vpc.template.yaml ├── clickhouse-entrypoint-new-vpc.template.yaml ├── clickhouse.arm.template.yaml ├── clickhouse.template.yaml ├── cloudwatch-dashboard.template.yaml ├── nlb.template.yaml ├── securitygroups.template.yaml └── zookeeper.template.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # misc 2 | .DS_Store 3 | /taskcat_outputs -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs/boilerplate"] 2 | path = docs/boilerplate 3 | url = https://github.com/aws-quickstart/quickstart-documentation-base-common.git 4 | branch = main 5 | [submodule "submodules/quickstart-aws-vpc"] 6 | path = submodules/quickstart-aws-vpc 7 | url = https://github.com/aws-quickstart/quickstart-aws-vpc.git 8 | branch = main 9 | [submodule "submodules/quickstart-linux-bastion"] 10 | path = submodules/quickstart-linux-bastion 11 | url = https://github.com/aws-quickstart/quickstart-linux-bastion.git 12 | branch = main 13 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | language_type: cloudformation -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/.nojekyll -------------------------------------------------------------------------------- /.taskcat.yml: -------------------------------------------------------------------------------- 1 | project: 2 | name: quickstart-clickhouse-cluster 3 | regions: 4 | - us-east-1 5 | parameters: 6 | QSS3BucketName: $[taskcat_autobucket] 7 | QSS3BucketRegion: $[taskcat_current_region] 8 | tests: 9 | default: 10 | parameters: 11 | AvailabilityZones: $[taskcat_genaz_2] 12 | KeyPairName: override 13 | AlarmEmail: override 14 | template: ./templates/clickhouse-entrypoint-new-vpc.template.yaml -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @troy-ameigh @aws-quickstart/aws_quickstart_team -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2016-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 4 | 5 | http://aws.amazon.com/apache2.0/ 6 | 7 | or in the "license" file accompanying this file. This file 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. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # quickstart-clickhouse-cluster 2 | ## Deprecation Notice 3 | 4 | :x: This repository is subject to deprecation in Q4 2024. For more details, [please review this announcement](https://github.com/aws-ia/.announcements/issues/1). 5 | 6 | ## This repository has been deprecated in favor of https://github.com/aws-ia/cfn-ps-clickhouse-cluster. 7 | ***We will archive this repository and keep it publicly available until May 1, 2024.*** 8 | -------------------------------------------------------------------------------- /docs/generated/parameters/index.adoc: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /docs/generated/regions/index.adoc: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /docs/generated/services/index.adoc: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /docs/generated/services/metadata.adoc: -------------------------------------------------------------------------------- 1 | // placeholder 2 | -------------------------------------------------------------------------------- /docs/images/GrafanaConsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/GrafanaConsole.png -------------------------------------------------------------------------------- /docs/images/aws-quickstart-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/aws-quickstart-graphic.png -------------------------------------------------------------------------------- /docs/images/cfn_outputs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/cfn_outputs.png -------------------------------------------------------------------------------- /docs/images/clickhouse-architecture-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/clickhouse-architecture-diagram.png -------------------------------------------------------------------------------- /docs/images/clickhouse-architecture-diagram.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/clickhouse-architecture-diagram.pptx -------------------------------------------------------------------------------- /docs/images/clickhouse-cluster-architecture-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/clickhouse-cluster-architecture-diagram.png -------------------------------------------------------------------------------- /docs/images/clickhouse_cluster_architecture_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/clickhouse_cluster_architecture_diagram.png -------------------------------------------------------------------------------- /docs/images/cloudformation_outputs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/cloudformation_outputs.png -------------------------------------------------------------------------------- /docs/images/ec2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/ec2.png -------------------------------------------------------------------------------- /docs/images/secretsmanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/secretsmanager.png -------------------------------------------------------------------------------- /docs/images/switchyOmega1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/switchyOmega1.png -------------------------------------------------------------------------------- /docs/images/switchyOmega2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/switchyOmega2.png -------------------------------------------------------------------------------- /docs/images/switchyOmega3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/switchyOmega3.png -------------------------------------------------------------------------------- /docs/images/switchyOmega4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/docs/images/switchyOmega4.png -------------------------------------------------------------------------------- /docs/languages/docs-cn/_layout_cfn.adoc: -------------------------------------------------------------------------------- 1 | 2 | [.text-center] 3 | [discrete] 4 | == {partner-product-name} on the AWS Cloud 5 | :doctitle: {partner-product-name} on the AWS Cloud 6 | :!toc: 7 | [.text-left] 8 | include::translate-only/introduction.adoc[] 9 | 10 | == Overview 11 | include::translate-only/overview.adoc[] 12 | 13 | 14 | == {partner-product-name} on AWS 15 | ifndef::production_build[] 16 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/product_description.adoc`**_ 17 | [.preview_mode] 18 | |=== 19 | a| 20 | endif::production_build[] 21 | include::{specificdir}/product_description.adoc[] 22 | ifndef::production_build[] 23 | |=== 24 | endif::production_build[] 25 | 26 | == Cost 27 | include::translate-only/cost.adoc[] 28 | 29 | ifndef::disable_licenses[] 30 | == Software licenses 31 | ifndef::production_build[] 32 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/licenses.adoc`**_ 33 | [.preview_mode] 34 | |=== 35 | a| 36 | endif::production_build[] 37 | include::{specificdir}/licenses.adoc[] 38 | ifndef::production_build[] 39 | |=== 40 | endif::production_build[] 41 | endif::disable_licenses[] 42 | 43 | == Architecture 44 | ifndef::production_build[] 45 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/architecture.adoc`**_ 46 | [.preview_mode] 47 | |=== 48 | a| 49 | endif::production_build[] 50 | include::{specificdir}/architecture.adoc[] 51 | ifndef::production_build[] 52 | |=== 53 | endif::production_build[] 54 | 55 | == Planning the deployment 56 | include::translate-only/planning_deployment.adoc[] 57 | 58 | == Deployment steps 59 | include::translate-only/deployment_steps.adoc[] 60 | 61 | // == Parameters 62 | // include::../{generateddir}/parameters/index.adoc[] 63 | 64 | // additional_info.adoc contains 3 sections: Best Practice, Security & Other information 65 | 66 | ifndef::production_build[] 67 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/additional_info.adoc`**_ 68 | ++++ 69 |
70 | ++++ 71 | endif::production_build[] 72 | include::{specificdir}/additional_info.adoc[] 73 | 74 | 75 | 76 | ifndef::production_build[] 77 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/faq_troubleshooting.adoc`**_ 78 | ++++ 79 |
80 | ++++ 81 | endif::production_build[] 82 | include::{specificdir}/faq_troubleshooting.adoc[] 83 | ifndef::production_build[] 84 | ++++ 85 |
86 | ++++ 87 | endif::production_build[] 88 | 89 | ifndef::no_parameters[] 90 | ifdef::parameters_as_appendix[] 91 | == Parameter reference 92 | 93 | NOTE: Unless you are customizing the Quick Start templates for your own deployment projects, we recommend that you keep the default settings for the parameters labeled `Quick Start S3 bucket name`, `Quick Start S3 bucket 94 | Region`, and `Quick Start S3 key prefix`. Changing these parameter settings automatically updates code references to point to a new Quick Start location. For more information, see the https://aws-quickstart.github.io/option1.html[AWS Quick Start Contributor’s Guide^]. 95 | 96 | include::../../{generateddir}/parameters/index.adoc[] 97 | endif::parameters_as_appendix[] 98 | endif::no_parameters[] 99 | 100 | == Send us feedback 101 | 102 | To post feedback, submit feature ideas, or report bugs, use the *Issues* section of the https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] for this Quick Start. To submit code, see the https://aws-quickstart.github.io/[Quick Start Contributor’s Guide^]. 103 | 104 | == Quick Start reference deployments 105 | 106 | See the https://aws.amazon.com/quickstart/[AWS Quick Start home page]. 107 | 108 | 109 | == GitHub repository 110 | 111 | Visit our https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] to download 112 | the templates and scripts for this Quick Start, to post your comments, 113 | and to share your customizations with others. 114 | 115 | ''' 116 | include::translate-only/disclaimer.adoc[] 117 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/index.adoc: -------------------------------------------------------------------------------- 1 | :imagesdir: images 2 | :includedir: boilerplate 3 | :specificdir: partner_editable 4 | :generateddir: generated 5 | :langdir: docs-cn 6 | :icons: font 7 | :toc2: left 8 | :toc-title: 9 | :toclevels: 2 10 | :stylesheet: ../../{includedir}/.css/quickstart.css 11 | :project_cfn: 12 | :template_services_ec2: 13 | include::{specificdir}/_settings.adoc[] 14 | 15 | // the next two lines are needed for quickstarts that are not built with a partner, if removed, footer text is mangled for those quickstarts. They must be below _settings.adoc 16 | ifdef::partner-company-name[:partner-company-footer: {sp}and {partner-company-name}] 17 | ifndef::partner-company-name[:partner-company-footer:] 18 | 19 | // the next 3 lines must remain below partner-company-footer definitions 20 | :nofooter: 21 | :docinfodir: boilerplate 22 | :docinfo: 23 | 24 | :title: {partner-product-name} on the AWS Cloud 25 | ifdef::project_cfn[include::_layout_cfn.adoc[]] 26 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/_settings.adoc: -------------------------------------------------------------------------------- 1 | // Change the following attributes. 2 | :quickstart-project-name: quickstart-documentation-base 3 | :partner-product-name: Example Product Name 4 | // For the following attribute, if you have no short name, enter the same name as partner-product-name. 5 | :partner-product-short-name: Example Product Name 6 | // If there's no partner, comment partner-company-name. 7 | :partner-company-name: Example Company Name, Ltd. 8 | :doc-month: Month of launch or significant update (spelled out) 9 | :doc-year: Year 10 | // Uncomment the following "contributor" attributes as appropriate. If the partner agrees to include names, enter contributor names for every line we use. If partner doesn't want to include names, delete all placeholder names and keep only "{partner-company-name}" and "AWS Quick Start team." 11 | //:partner-contributors: Shuai Ye, Michael McConnell, and John Smith, {partner-company-name} 12 | //:other-contributors: Akua Mansa, Trek10 13 | //:aws-contributors: Janine Singh, AWS IoT Partner team 14 | :quickstart-contributors: Toni Jones, AWS Quick Start team 15 | // For deployment_time, use minutes if deployment takes an hour or less, 16 | // for example, 30 minutes or 60 minutes. 17 | // Use hours for deployment times greater than 60 minutes (rounded to a quarter hour), 18 | // for example, 1.25 hours, 2 hours, 2.5 hours. 19 | :deployment_time: 15 minutes / 60 minutes / 1.5 hours 20 | :default_deployment_region: us-east-1 21 | :parameters_as_appendix: 22 | // Uncomment the following two attributes if you are using an AWS Marketplace listing. 23 | // Additional content will be generated automatically based on these attributes. 24 | // :marketplace_subscription: 25 | // :marketplace_listing_url: https://example.com/ 26 | // Uncomment the following attribute to add a statement about AWS and our stance on compliance-related Quick Starts. 27 | // :compliance-statement: Deploying this Quick Start does not guarantee an organization’s compliance with any laws, certifications, policies, or other regulations. 28 | // Uncomment the following two attributes if you are deploying a CDK Quick Start. Make sure to comment out :parameters_as_appendix: also. 29 | // :cdk_qs: 30 | // :no_parameters: 31 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/additional_info.adoc: -------------------------------------------------------------------------------- 1 | // Add steps as necessary for accessing the software, post-configuration, and testing. Don’t include full usage instructions for your software, but add links to your product documentation for that information. 2 | //Should any sections not be applicable, remove them 3 | 4 | == Test the deployment 5 | // If steps are required to test the deployment, add them here. If not, remove the heading 6 | 7 | == Post-deployment steps 8 | // If post-deployment steps are required, add them here. If not, remove the heading 9 | 10 | == Best practices for using {partner-product-short-name} on AWS 11 | // Provide post-deployment best practices for using the technology on AWS, including considerations such as migrating data, backups, ensuring high performance, high availability, etc. Link to software documentation for detailed information. 12 | 13 | _Add any best practices for using the software._ 14 | 15 | == Security 16 | // Provide post-deployment best practices for using the technology on AWS, including considerations such as migrating data, backups, ensuring high performance, high availability, etc. Link to software documentation for detailed information. 17 | 18 | _Add any security-related information._ 19 | 20 | == Other useful information 21 | //Provide any other information of interest to users, especially focusing on areas where AWS or cloud usage differs from on-premises usage. 22 | 23 | _Add any other details that will help the customer use the software on AWS._ 24 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/architecture.adoc: -------------------------------------------------------------------------------- 1 | :xrefstyle: short 2 | 3 | Deploying this Quick Start for a new virtual private cloud (VPC) with 4 | default parameters builds the following {partner-product-short-name} environment in the 5 | AWS Cloud. 6 | 7 | // Replace this example diagram with your own. Follow our wiki guidelines: https://w.amazon.com/bin/view/AWS_Quick_Starts/Process_for_PSAs/#HPrepareyourarchitecturediagram. Upload your source PowerPoint file to the GitHub {deployment name}/docs/images/ directory in this repo. 8 | 9 | [#architecture1] 10 | .Quick Start architecture for {partner-product-short-name} on AWS 11 | image::../images/architecture_diagram.png[Architecture] 12 | 13 | As shown in <>, the Quick Start sets up the following: 14 | 15 | * A highly available architecture that spans two Availability Zones.* 16 | * A VPC configured with public and private subnets, according to AWS 17 | best practices, to provide you with your own virtual network on AWS.* 18 | * In the public subnets: 19 | ** Managed network address translation (NAT) gateways to allow outbound 20 | internet access for resources in the private subnets.* 21 | ** A Linux bastion host in an Auto Scaling group to allow inbound Secure 22 | Shell (SSH) access to EC2 instances in public and private subnets.* 23 | * In the private subnets: 24 | ** . 25 | ** . 26 | // Add bullet points for any additional components that are included in the deployment. Make sure that the additional components are also represented in the architecture diagram. End each bullet with a period. 27 | * . 28 | 29 | [.small]#* The template that deploys the Quick Start into an existing VPC skips the components marked by asterisks and prompts you for your existing VPC configuration.# 30 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/deploy_steps.adoc: -------------------------------------------------------------------------------- 1 | === Confirm your AWS account configuration 2 | 3 | . Sign in to your AWS account at https://aws.amazon.com with an IAM user role that has the necessary permissions. For details, see link:#_planning_the_deployment[Planning the deployment] earlier in this guide. 4 | . Make sure that your AWS account is configured correctly, as discussed in the link:#_technical_requirements[Technical requirements] section. 5 | 6 | // Optional based on Marketplace listing. Not to be edited 7 | ifdef::marketplace_subscription[] 8 | === Subscribe to the {partner-product-short-name} AMI 9 | 10 | This Quick Start requires a subscription to the AMI for {partner-product-short-name} in AWS Marketplace. 11 | 12 | . Sign in to your AWS account. 13 | . Open the page for the {marketplace_listing_url}[{partner-product-short-name} AMI in AWS Marketplace^], and then choose *Continue to Subscribe*. 14 | . Review the terms and conditions for software usage, and then choose *Accept Terms*. + 15 | A confirmation page loads, and an email confirmation is sent to the account owner. For detailed subscription instructions, see the https://aws.amazon.com/marketplace/help/200799470[AWS Marketplace documentation^]. 16 | 17 | . When the subscription process is complete, exit out of AWS Marketplace without further action. *Do not* provision the software from AWS Marketplace—the Quick Start deploys the AMI for you. 18 | endif::marketplace_subscription[] 19 | // \Not to be edited 20 | 21 | === Launch the Quick Start 22 | // Adapt the following warning to your Quick Start. 23 | WARNING: If you’re deploying {partner-product-short-name} into an existing VPC, make sure that your VPC has two private subnets in different Availability Zones for the workload instances and that the subnets aren’t shared. This Quick Start doesn’t support https://docs.aws.amazon.com/vpc/latest/userguide/vpc-sharing.html[shared subnets^]. These subnets require https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html[NAT gateways^] in their route tables to allow the instances to download packages and software without exposing them to the internet. Also make sure that the domain name option in the DHCP options is configured as explained in http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html[DHCP options sets^]. You provide your VPC settings when you launch the Quick Start. 24 | 25 | Each deployment takes about {deployment_time} to complete. 26 | 27 | . Sign in to your AWS account, and choose one of the following options to launch the AWS CloudFormation template. For help with choosing an option, see link:#_deployment_options[Deployment options] earlier in this guide. 28 | + 29 | [cols="3,1"] 30 | |=== 31 | ^|http://qs_launch_permalink[Deploy {partner-product-short-name} into a new VPC on AWS^] 32 | ^|http://qs_template_permalink[View template^] 33 | 34 | ^|http://qs_launch_permalink[Deploy {partner-product-short-name} into an existing VPC on AWS^] 35 | ^|http://qs_template_permalink[View template^] 36 | |=== 37 | + 38 | . Check the AWS Region that’s displayed in the upper-right corner of the navigation bar, and change it if necessary. This Region is where the network infrastructure for {partner-product-short-name} is built. The template is launched in the {default_deployment_region} Region by default. For other choices, see link:#_supported_regions[Supported Regions] earlier in this guide. 39 | . On the *Create stack* page, keep the default setting for the template URL, and then choose *Next*. 40 | . On the *Specify stack details* page, change the stack name if needed. Review the parameters for the template. Provide values for the parameters that require input. For all other parameters, review the default settings and customize them as necessary. For details on each parameter, see the link:#_parameter_reference[Parameter reference] section of this guide. When you finish reviewing and customizing the parameters, choose *Next*. 41 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/deployment_options.adoc: -------------------------------------------------------------------------------- 1 | // Edit this placeholder text to accurately describe your architecture. 2 | 3 | This Quick Start provides two deployment options: 4 | 5 | * *Deploy {partner-product-short-name} into a new VPC*. This option builds a new AWS environment consisting of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys {partner-product-short-name} into this new VPC. 6 | * *Deploy {partner-product-short-name} into an existing VPC*. This option provisions {partner-product-short-name} in your existing AWS infrastructure. 7 | 8 | The Quick Start provides separate templates for these options. It also lets you configure Classless Inter-Domain Routing (CIDR) blocks, instance types, and {partner-product-short-name} settings, as discussed later in this guide. 9 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/faq_troubleshooting.adoc: -------------------------------------------------------------------------------- 1 | // Add any tips or answers to anticipated questions. 2 | 3 | == FAQ 4 | 5 | *Q.* I encountered a *CREATE_FAILED* error when I launched the Quick Start. 6 | 7 | *A.* If AWS CloudFormation fails to create the stack, relaunch the template with *Rollback on failure* set to *Disabled*. This setting is under *Advanced* in the AWS CloudFormation console on the *Configure stack options* page. With this setting, the stack’s state is retained, and the instance keeps running so that you can troubleshoot the issue. (For Windows, look at the log files in `%ProgramFiles%\Amazon\EC2ConfigService` and `C:\cfn\log`.) 8 | // Customize this answer if needed. For example, if you’re deploying on Linux instances, either provide the location for log files on Linux or omit the final sentence. If the Quick Start has no EC2 instances, revise accordingly (something like "and the assets keep running"). 9 | 10 | WARNING: When you set *Rollback on failure* to *Disabled*, you continue to incur AWS charges for this stack. Delete the stack when you finish troubleshooting. 11 | 12 | For more information, see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html[Troubleshooting AWS CloudFormation^]. 13 | 14 | *Q.* I encountered a size-limitation error when I deployed the AWS CloudFormation templates. 15 | 16 | *A.* Launch the Quick Start templates from the links in this guide or from another S3 bucket. If you deploy the templates from a local copy on your computer or from a location other than an S3 bucket, you might encounter template-size limitations. For more information, see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html[AWS CloudFormation quotas^]. 17 | 18 | 19 | == Troubleshooting 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/licenses.adoc: -------------------------------------------------------------------------------- 1 | // Include details about any licenses and how to sign up. Provide links as appropriate. If no licenses are required, clarify that. The following paragraphs provide examples of details you can provide. Remove italics, and rephrase as appropriate. 2 | 3 | _No licenses are required to deploy this Quick Start. All AWS service resources consumed during the launch of the Quick Start incur AWS service usage costs._ 4 | 5 | _Some configurations of the {partner-product-short-name} Quick Start involve the use of third-party software. You are responsible for obtaining a license directly from the software vendor._ 6 | 7 | _This Quick Start requires a license for {partner-product-short-name}. To use the Quick Start in your production environment, sign up for a license at . When you launch the Quick Start, place the license key in an S3 bucket and specify its location._ 8 | 9 | _If you don’t have a license, the Quick Start deploys with a trial license. The trial license gives you days of free usage in a non-production environment. After this time, you can upgrade to a production license by following the instructions at ._ 10 | 11 | // Or, if the deployment uses an AMI, update this paragraph. If it doesn’t, remove the paragraph. 12 | _The Quick Start requires a subscription to the Amazon Machine Image (AMI) for {partner-product-short-name}, which is available from https://aws.amazon.com/marketplace/[AWS Marketplace^]. Additional pricing, terms, and conditions may apply. For instructions, see link:#step-2.-subscribe-to-the-software-ami[step 2] in the deployment section._ 13 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/overview_target_and_usage.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // Identify your target audience and explain how/why they would use this Quick Start. 3 | //Avoid borrowing text from third-party websites (copying text from AWS service documentation is fine). Also, avoid marketing-speak, focusing instead on the technical aspect. 4 | 5 | This guide provides instructions for deploying the {partner-product-short-name} Quick Start reference architecture on the AWS Cloud. 6 | 7 | This Quick Start is for users who 8 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/pre-reqs.adoc: -------------------------------------------------------------------------------- 1 | // If no preperation is required, remove all content from here 2 | 3 | ==== Prepare your AWS account 4 | 5 | _Describe any setup required in the AWS account prior to template launch_ 6 | 7 | ==== Prepare your {partner-company-name} account 8 | 9 | _Describe any setup required in the partner portal/account prior to template launch_ 10 | 11 | ==== Prepare for the deployment 12 | 13 | _Describe any preparation required to complete the product build, such as obtaining licenses or placing files in S3_ -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/product_description.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // Briefly describe the software. Use consistent and clear branding. 3 | // Include the benefits of using the software on AWS, and provide details on usage scenarios. 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/regions.adoc: -------------------------------------------------------------------------------- 1 | This Quick Start supports the following Regions: 2 | 3 | * us-east-1, US East (N. Virginia) (EXAMPLE) 4 | * us-east-2, US East (Ohio) (EXAMPLE) 5 | 6 | //Full list: https://docs.aws.amazon.com/general/latest/gr/rande.html 7 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/service_limits.adoc: -------------------------------------------------------------------------------- 1 | // Replace the in each row to specify the number of resources used in this deployment. Remove the rows for resources that aren’t used. 2 | |=== 3 | |Resource |This deployment uses 4 | 5 | // Space needed to maintain table headers 6 | |VPCs | 7 | |Elastic IP addresses | 8 | |Security groups | 9 | |AWS Identity and Access Management (IAM) roles | 10 | |Auto Scaling groups | 11 | |Application Load Balancers | 12 | |Network Load Balancers | 13 | | instances | 14 | |=== 15 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/partner_editable/specialized_knowledge.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // For example: “familiarity with basic concepts in networking, database operations, and data encryption” or “familiarity with .” 3 | // Include links if helpful. 4 | // You don't need to list AWS services or point to general info about AWS; the boilerplate already covers this. 5 | 6 | This Quick Start also assumes familiarity with . 7 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | . 203 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/_layout_cfn_cdk_module.adoc: -------------------------------------------------------------------------------- 1 | 2 | [.text-center] 3 | [discrete] 4 | == {partner-product-name} on the AWS Cloud 5 | :doctitle: {partner-product-name} on the AWS Cloud 6 | :!toc: 7 | [.text-left] 8 | include::../{includedir}/introduction.adoc[] 9 | 10 | == Overview 11 | include::../{includedir}/overview.adoc[] 12 | 13 | 14 | == {partner-product-name} on AWS 15 | ifndef::production_build[] 16 | _**This portion of the deployment guide is located at `docs/{specificdir}/product_description.adoc`**_ 17 | [.preview_mode] 18 | |=== 19 | a| 20 | endif::production_build[] 21 | include::../{specificdir}/product_description.adoc[] 22 | ifndef::production_build[] 23 | |=== 24 | endif::production_build[] 25 | 26 | == AWS costs 27 | include::../{includedir}/cost.adoc[] 28 | 29 | ifndef::disable_licenses[] 30 | == Software licenses 31 | ifndef::production_build[] 32 | _**This portion of the deployment guide is located at `docs/{specificdir}/licenses.adoc`**_ 33 | [.preview_mode] 34 | |=== 35 | a| 36 | endif::production_build[] 37 | include::../{specificdir}/licenses.adoc[] 38 | ifndef::production_build[] 39 | |=== 40 | endif::production_build[] 41 | endif::disable_licenses[] 42 | 43 | == Architecture 44 | ifndef::production_build[] 45 | _**This portion of the deployment guide is located at `docs/{specificdir}/architecture.adoc`**_ 46 | [.preview_mode] 47 | |=== 48 | a| 49 | endif::production_build[] 50 | include::../{specificdir}/architecture.adoc[] 51 | ifndef::production_build[] 52 | |=== 53 | endif::production_build[] 54 | 55 | //== Planning the deployment 56 | 57 | //include::../{includedir}/planning_deployment.adoc[] 58 | 59 | == Planning the deployment 60 | 61 | include::../{includedir}/planning_deployment.adoc[] 62 | 63 | == Deployment steps 64 | include::../{includedir}/deployment_steps_cdk_module.adoc[] 65 | 66 | // == Parameters 67 | // include::../{generateddir}/parameters/index.adoc[] 68 | 69 | // additional_info.adoc contains 3 sections: Best Practice, Security & Other information 70 | 71 | ifndef::production_build[] 72 | _**This portion of the deployment guide is located at `docs/{specificdir}/additional_info.adoc`**_ 73 | ++++ 74 |
75 | ++++ 76 | endif::production_build[] 77 | include::../{specificdir}/additional_info.adoc[] 78 | 79 | 80 | 81 | ifndef::production_build[] 82 | _**This portion of the deployment guide is located at `docs/{specificdir}/faq_troubleshooting.adoc`**_ 83 | ++++ 84 |
85 | ++++ 86 | endif::production_build[] 87 | include::../{specificdir}/faq_troubleshooting.adoc[] 88 | ifndef::production_build[] 89 | ++++ 90 |
91 | ++++ 92 | endif::production_build[] 93 | 94 | //ifndef::no_parameters[] 95 | //ifdef::parameters_as_appendix[] 96 | 97 | //== Parameter reference 98 | 99 | //NOTE: Unless you are customizing the Quick Start templates for your own deployment projects, we recommend that you keep the default settings for the parameters labeled `Quick Start S3 bucket name`, `Quick Start S3 bucket 100 | //Region`, and `Quick Start S3 key prefix`. Changing these parameter settings automatically updates code references to point to a new Quick Start location. For more information, see the https://aws-quickstart.github.io/option1.html[AWS Quick Start Contributor’s Guide^]. 101 | 102 | //include::../{generateddir}/parameters/index.adoc[] 103 | //endif::parameters_as_appendix[] 104 | //endif::no_parameters[] 105 | 106 | == Send us feedback 107 | 108 | To post feedback, submit feature ideas, or report bugs, use the *Issues* section of the https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] for this Quick Start. To submit code, see the https://aws-quickstart.github.io/[Quick Start Contributor’s Guide^]. 109 | 110 | == Quick Start reference deployments 111 | 112 | See the https://aws.amazon.com/quickstart/[AWS Quick Start home page]. 113 | 114 | 115 | == GitHub repository 116 | 117 | Visit our https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] to download 118 | the templates and scripts for this Quick Start, to post your comments, 119 | and to share your customizations with others. 120 | 121 | ''' 122 | include::../{includedir}/disclaimer.adoc[] 123 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/_layout_cfn_eks_module.adoc: -------------------------------------------------------------------------------- 1 | :parameters_as_appendix: 2 | [.text-center] 3 | [discrete] 4 | == {partner-product-name} 5 | :doctitle: {partner-product-name} 6 | :!toc: 7 | [.text-left] 8 | include::../{includedir}/introduction.adoc[] 9 | 10 | == Overview 11 | include::../{includedir}/overview.adoc[] 12 | 13 | ifndef::disable_licenses[] 14 | == Software licenses 15 | ifndef::production_build[] 16 | _**This portion of the deployment guide is located in `docs/{specificdir}/licenses.adoc`**_ 17 | [.preview_mode] 18 | |=== 19 | a| 20 | endif::production_build[] 21 | include::../{specificdir}/licenses.adoc[] 22 | ifndef::production_build[] 23 | |=== 24 | endif::production_build[] 25 | endif::disable_licenses[] 26 | 27 | == Architecture 28 | Deploying this Quick Start with default parameters into an existing Amazon EKS cluster builds the following environment. For a diagram of the new virtual private cloud (VPC) and Amazon EKS cluster, see https://aws-quickstart.github.io/quickstart-amazon-eks/[Amazon EKS on the AWS Cloud^]. 29 | 30 | [#architecture1] 31 | .Quick Start architecture for _{partner-product-name}_ 32 | [link=images/architecture_diagram.png] 33 | image::../images/architecture_diagram.png[Architecture] 34 | 35 | As shown in Figure 1, the Quick Start sets up the following: 36 | 37 | ifndef::production_build[] 38 | _**This portion of the deployment guide is located in `docs/{specificdir}/architecture.adoc`**_ 39 | [.preview_mode] 40 | |=== 41 | a| 42 | endif::production_build[] 43 | include::../{specificdir}/architecture.adoc[] 44 | ifndef::production_build[] 45 | |=== 46 | endif::production_build[] 47 | 48 | == Planning the deployment 49 | 50 | include::../{includedir}/planning_deployment_eks_module.adoc[] 51 | 52 | == Deployment steps 53 | include::../{includedir}/deployment_steps_eks_module.adoc[] 54 | 55 | 56 | ifndef::production_build[] 57 | _**This portion of the deployment guide is located in `docs/{specificdir}/additional_info.adoc`**_ 58 | ++++ 59 |
60 | ++++ 61 | endif::production_build[] 62 | include::../{specificdir}/additional_info.adoc[] 63 | 64 | 65 | 66 | ifndef::production_build[] 67 | _**This portion of the deployment guide is located in `docs/{specificdir}/faq_troubleshooting.adoc`**_ 68 | ++++ 69 |
70 | ++++ 71 | endif::production_build[] 72 | include::../{specificdir}/faq_troubleshooting.adoc[] 73 | ifndef::production_build[] 74 | ++++ 75 |
76 | ++++ 77 | endif::production_build[] 78 | 79 | == Parameter reference 80 | 81 | === Deploy into a new VPC and new Amazon EKS cluster 82 | 83 | The full list of parameters for this entrypoint are documented in https://aws-quickstart.github.io/quickstart-amazon-eks/#_launch_into_a_new_vpc[Amazon EKS on the AWS Cloud^]. 84 | 85 | 86 | === Deploy into a new Amazon EKS cluster in an existing VPC 87 | 88 | The full list of parameters for this entrypoint are documented in https://aws-quickstart.github.io/quickstart-amazon-eks/#_launch_into_an_existing_vpc[Amazon EKS on the AWS Cloud^]. 89 | 90 | include::../{generateddir}/parameters/index.adoc[] 91 | 92 | == Send us feedback 93 | 94 | To post feedback, submit feature ideas, or report bugs, use the *Issues* section of the https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] for this Quick Start. If you want to submit code, review the https://aws-quickstart.github.io/[Quick Start Contributor’s Guide^]. 95 | 96 | == Quick Start reference deployments 97 | 98 | See the https://aws.amazon.com/quickstart/[AWS Quick Start home page^]. 99 | 100 | 101 | == GitHub repository 102 | 103 | See the https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] to download 104 | the templates and scripts for this Quick Start, post comments, 105 | and share customizations with others. 106 | 107 | ''' 108 | include::../{includedir}/disclaimer.adoc[] 109 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/cost.adoc: -------------------------------------------------------------------------------- 1 | 2 | You are responsible for the cost of the AWS services and any third-party licenses used while running this Quick Start. There is no additional cost for 3 | using the Quick Start. 4 | 5 | The AWS CloudFormation templates for Quick Starts include 6 | configuration parameters that you can customize. Some of the settings, 7 | such as the instance type, affect the cost of deployment. For cost estimates, 8 | see the pricing pages for each AWS service you use. Prices are subject to change. 9 | 10 | TIP: After you deploy the Quick Start, https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-reports-gettingstarted-turnonreports.html[create AWS Cost and Usage Reports^] to deliver billing metrics to an Amazon Simple Storage Service (Amazon S3) bucket in your account. These reports provide cost estimates based on usage throughout each month and aggregate the data at the end of the month. For more information, see https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-reports-costusage.html[What are AWS Cost and Usage Reports?^] 11 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/deployment_steps.adoc: -------------------------------------------------------------------------------- 1 | :xrefstyle: short 2 | 3 | ifndef::production_build[] 4 | _**This portion of the deployment guide is located at `docs/{specificdir}/deploy_steps.adoc`**_ 5 | ++++ 6 |
7 | ++++ 8 | endif::production_build[] 9 | include::../{specificdir}/deploy_steps.adoc[] 10 | ifndef::production_build[] 11 | ++++ 12 |
13 | ++++ 14 | endif::production_build[] 15 | + 16 | ifndef::custom_number_of_deploy_steps[] 17 | ifndef::no_parameters[] 18 | ifndef::parameters_as_appendix[] 19 | In the following tables, parameters are listed by category and described separately for the deployment options. When you finish reviewing and customizing the parameters, choose *Next*. 20 | + 21 | NOTE: Unless you are customizing the Quick Start templates for your own deployment projects, keep the default settings for the parameters *Quick Start S3 bucket name*, *Quick Start S3 bucket Region*, and *Quick Start S3 key prefix*. Changing these settings automatically updates code references to point to a new Quick Start location. For more information, see the https://aws-quickstart.github.io/option1.html[AWS Quick Start Contributor’s Guide^]. 22 | + 23 | // Parameter tables linked in here 24 | include::../{generateddir}/parameters/index.adoc[] 25 | endif::parameters_as_appendix[] 26 | endif::no_parameters[] 27 | + 28 | . On the *Configure stack options* page, you can https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html[specify tags^] (key-value pairs) for resources in your stack and https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html[set advanced options^]. When you’re finished, choose *Next*. 29 | . On the *Review* page, review and confirm the template settings. Under *Capabilities*, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros. 30 | . Choose *Create stack* to deploy the stack. 31 | ifndef::partner-product-short-name[. Monitor the status of the stack. When the status is *CREATE_COMPLETE*, the {partner-product-name} deployment is ready.] 32 | ifdef::partner-product-short-name[. Monitor the status of the stack. When the status is *CREATE_COMPLETE*, the {partner-product-short-name} deployment is ready.] 33 | . Use the values displayed in the *Outputs* tab for the stack, as shown in <>, to view the created resources. 34 | 35 | [#cfn_outputs] 36 | ifndef::partner-product-short-name[.{partner-product-name} outputs after successful deployment] 37 | ifdef::partner-product-short-name[.{partner-product-short-name} outputs after successful deployment] 38 | [link=images/cfn_outputs.png] 39 | image::../images/cfn_outputs.png[cfn_outputs,width=100%,height=100%] 40 | endif::custom_number_of_deploy_steps[] 41 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/deployment_steps_cdk_module.adoc: -------------------------------------------------------------------------------- 1 | 2 | ifndef::production_build[] 3 | _**This portion of the deployment guide is located at `docs/{specificdir}/deploy_steps.adoc`**_ 4 | ++++ 5 |
6 | ++++ 7 | endif::production_build[] 8 | include::../{specificdir}/deploy_steps.adoc[] 9 | ifndef::production_build[] 10 | ++++ 11 |
12 | ++++ 13 | endif::production_build[] 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/deployment_steps_eks_module.adoc: -------------------------------------------------------------------------------- 1 | :xrefstyle: short 2 | 3 | === Prepare an existing EKS cluster 4 | NOTE: This step is only required if you launch this Quick Start into an existing Amazon EKS cluster that was not created using the https://aws-quickstart.github.io/quickstart-amazon-eks/[Amazon EKS on the AWS Cloud^] deployment. If you want to create a new EKS cluster with your deployment, skip to step 3. 5 | 6 | . Sign in to your AWS account at https://aws.amazon.com[https://aws.amazon.com^] with an IAM user role that has the necessary permissions. For details, see link:#_planning_the_deployment[Planning the deployment], earlier in this guide. 7 | . Launch the https://us-east-2.console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/create/template?stackName=Amazon-EKS&templateURL=https://aws-quickstart.s3.us-east-1.amazonaws.com/quickstart-amazon-eks/templates/amazon-eks-entrypoint-existing-cluster.template.yaml[cluster preparation template^]. 8 | . The template launches in the US East (Ohio) Region by default. To change the Region, choose another Region from the list in the upper-right corner of the navigation bar. 9 | . On the *Create stack* page, keep the default setting for the template URL, and then choose *Next*. 10 | . On the *Specify stack details* page, change the stack name if needed. Enter the name of the Amazon EKS cluster you want to deploy to in addition to the subnet IDs and security group ID associated with the cluster. These can be obtained from the EKS cluster console. 11 | . On the *Options* page, specify the key-value pairs for resources in your stack, and set advanced options. When you’re done, choose *Next*. 12 | . On the *Review* page, review and confirm your template settings. Under *Capabilities*, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros. 13 | . Choose *Create stack* to deploy the stack. 14 | . Monitor the stack's status until it is *CREATE_COMPLETE*. 15 | . From the *Outputs* section of the stack, note the `KubernetesRoleArn` and `HelmRoleArn` roles. 16 | . Add the roles to the `aws-auth config` map in your cluster, specifying `system:masters` for the groups. This allows the Quick Start to manage your cluster via AWS CloudFormation. For more information, see https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html[Managing users or IAM roles for your cluster^]. 17 | 18 | NOTE: Unless you are customizing the Quick Start templates for your own deployment projects, we recommend that you keep the default settings for the parameters labeled `Quick Start S3 bucket name`, `Quick Start S3 bucket 19 | Region`, and `Quick Start S3 key prefix`. Changing these parameter settings automatically updates code references to point to a new Quick Start location. For more information, see the https://aws-quickstart.github.io/option1.html[AWS Quick Start Contributor’s Guide^]. 20 | 21 | include::../{specificdir}/pre-launch-steps.adoc[] 22 | 23 | 24 | === Launch the Quick Start 25 | 26 | NOTE: You are responsible for the cost of the AWS services used while running this Quick Start reference deployment. There is no additional cost for using this Quick Start. For full details, see the pricing pages for each AWS service used by this Quick Start. Prices are subject to change. 27 | 28 | . Sign in to your AWS account, and choose one of the following options to launch the AWS CloudFormation template. For help with choosing an option, see the link:#_deployment_options[Deployment options] section, earlier in this guide. 29 | 30 | [cols=3*] 31 | |=== 32 | ^|{launch_new_vpc}[Deploy into a new VPC and new Amazon EKS cluster^] 33 | ^|{launch_existing_vpc}[Deploy into a new Amazon EKS cluster in an existing VPC^] 34 | ^|{launch_existing_cluster}[Deploy into an existing Amazon EKS cluster^] 35 | 36 | ^|{template_new_vpc}[View template^] 37 | ^|{template_existing_vpc}[View template^] 38 | ^|{template_existing_cluster}[View template^] 39 | |=== 40 | New clusters take about 1.5 hours to deploy. Existing clusters take about {deployment_time} to deploy. 41 | 42 | WARNING: If you deploy {partner-product-short-name} into an existing VPC, ensure that any private subnets have https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html[NAT gateways^] in their route tables to allow the Quick Start to download packages and software. Also, ensure that the domain name in the DHCP options is configured. For more information, see http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html[DHCP options sets^]. 43 | 44 | [start=2] 45 | . Check the AWS Region that’s displayed in the upper-right corner of the navigation bar, and change it if necessary. This is where the network infrastructure for {partner-product-short-name} is built. The template launches in the {default_deployment_region} Region by default. 46 | . On the *Create stack* page, keep the default setting for the template URL, and then choose *Next*. 47 | . On the *Specify stack details* page, change the stack name if needed. Review the parameters for the template. Provide values for the parameters that require input. For all other parameters, review the default settings, and customize them as necessary. For details on each parameter, see the link:#_parameter_reference[Parameter reference] section of this guide. When you finish reviewing and customizing the parameters, choose *Next*. 48 | 49 | . On the *Options* page, specify the https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html[key-value pairs^] for resources in your stack, and https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html[set advanced options^]. When you’re done, choose *Next*. 50 | . On the *Review* page, review and confirm the template settings. Under *Capabilities*, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros. 51 | . Choose *Create stack* to deploy the stack. 52 | ifndef::partner-product-short-name[. Monitor the status of the stack. When the status is *CREATE_COMPLETE*, the {partner-product-name} deployment is ready.] 53 | ifdef::partner-product-short-name[. Monitor the status of the stack. When the status is *CREATE_COMPLETE*, the {partner-product-short-name} deployment is ready.] 54 | . Use the values displayed in the *Outputs* tab for the stack, as shown in the following figure. 55 | 56 | [#cfn_outputs] 57 | ifndef::partner-product-short-name[.{partner-product-name} outputs after successful deployment] 58 | ifdef::partner-product-short-name[.{partner-product-short-name} outputs after successful deployment] 59 | [link=images/cfn_outputs.png] 60 | image::../images/cfn_outputs.png[cfn_outputs,width=648,height=439] 61 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/disclaimer.adoc: -------------------------------------------------------------------------------- 1 | 2 | == Notices 3 | 4 | This document is provided for informational purposes only. It represents AWS’s current product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers. 5 | 6 | The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/[http://aws.amazon.com/apache2.0/^] or in the accompanying "license" file. This code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for specific language governing permissions and limitations. 7 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/index-docinfo-footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/introduction.adoc: -------------------------------------------------------------------------------- 1 | [.text-center] 2 | [discrete] 3 | == Quick Start Reference Deployment 4 | 5 | // Do not change the URL below. The aws-quickstart-graphic.png icon needs to come from the aws-quickstart S3 bucket. 6 | [.text-center] 7 | image::https://aws-quickstart.s3.amazonaws.com/{quickstart-project-name}/docs/boilerplate/.images/aws-quickstart-graphic.png[QS,80,80] 8 | 9 | ifndef::production_build[] 10 | [.text-center] 11 | [discrete] 12 | === DRAFT DOCUMENT / UNOFFICIAL GUIDANCE 13 | _**This portion of the deployment guide is located at `docs/{specificdir}/__settings_.adoc`**_ 14 | [.preview_mode] 15 | |=== 16 | a| 17 | endif::production_build[] 18 | [.text-center] 19 | *{doc-month} {doc-year}* + 20 | ifdef::partner-contributors[] 21 | _{partner-contributors}_ + 22 | endif::partner-contributors[] 23 | ifdef::other-contributors[] 24 | _{other-contributors}_ + 25 | endif::other-contributors[] 26 | ifdef::aws-contributors[] 27 | _{aws-contributors}_ + 28 | endif::aws-contributors[] 29 | _{quickstart-contributors}_ 30 | [.text-left] 31 | 32 | ifndef::production_build[] 33 | |=== 34 | endif::production_build[] 35 | 36 | TIP: Visit our https://github.com/aws-quickstart/{quickstart-project-name}[GitHub repository^] for source files and to post feedback, 37 | report bugs, or submit feature ideas for this Quick Start. 38 | 39 | ifdef::partner-company-name[] 40 | [.text-left] 41 | This Quick Start was created by {partner-company-name} in collaboration with Amazon Web Services (AWS). http://aws.amazon.com/quickstart/[Quick Starts^] are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices. 42 | endif::[] 43 | 44 | ifndef::partner-company-name[] 45 | [.text-left] 46 | This Quick Start was created by Amazon Web Services (AWS). http://aws.amazon.com/quickstart/[Quick Starts^] are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices. 47 | endif::[] 48 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/overview.adoc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ifndef::production_build[] 4 | _**This portion of the deployment guide is located at `docs/{specificdir}/overview_target_and_usage.adoc`**_ 5 | [.preview_mode] 6 | |=== 7 | a| 8 | endif::production_build[] 9 | include::../{specificdir}/overview_target_and_usage.adoc[] 10 | ifndef::production_build[] 11 | |=== 12 | endif::production_build[] 13 | 14 | ifdef::partner-company-name[] 15 | NOTE: Amazon may share user-deployment information with the AWS Partner that collaborated with AWS on the Quick Start. 16 | endif::partner-company-name[] 17 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/planning_deployment.adoc: -------------------------------------------------------------------------------- 1 | === Specialized knowledge 2 | 3 | This deployment requires a moderate level of familiarity with AWS services. If you’re new to AWS, visit https://aws.amazon.com/getting-started/[Getting Started with AWS^] and https://aws.amazon.com/training/[Training and Certification^]. These sites provide materials for learning how to design, deploy, and operate your infrastructure and applications on the AWS Cloud. 4 | 5 | ifndef::production_build[] 6 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/specialized_knowledge.adoc`**_ 7 | [.preview_mode] 8 | |=== 9 | a| 10 | endif::production_build[] 11 | include::../{specificdir}/specialized_knowledge.adoc[] 12 | ifndef::production_build[] 13 | |=== 14 | endif::production_build[] 15 | 16 | === AWS account 17 | 18 | If you don’t already have an AWS account, create one at https://aws.amazon.com/[https://aws.amazon.com^] by following the on-screen instructions. Part of the sign-up process involves receiving a phone call and entering a PIN using the phone keypad. 19 | 20 | Your AWS account is automatically signed up for all AWS services. You are charged only for the services you use. 21 | 22 | ifndef::disable_requirements[] 23 | === Technical requirements 24 | 25 | Before you launch the Quick Start, review the following information and ensure that your account is properly configured. Otherwise, deployment might fail. 26 | endif::disable_requirements[] 27 | 28 | ==== Resource quotas 29 | If necessary, request https://console.aws.amazon.com/servicequotas/home?region=us-east-2#!/[service quota increases^] for the following resources. You might need to request increases if your existing deployment currently uses these resources and if this Quick Start deployment could result in exceeding the default quotas. The https://console.aws.amazon.com/servicequotas/home?region=us-east-2#!/[Service Quotas console^] displays your usage and quotas for some aspects of some services. For more information, see https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html[What is Service Quotas?^] and https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html[AWS service quotas^]. 30 | 31 | ifndef::production_build[] 32 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/service_limits.adoc`**_ 33 | ++++ 34 |
35 | ++++ 36 | endif::production_build[] 37 | include::../{specificdir}/service_limits.adoc[] 38 | ifndef::production_build[] 39 | ++++ 40 |
41 | ++++ 42 | endif::production_build[] 43 | include::../../../{generateddir}/services/metadata.adoc[] 44 | 45 | ifndef::disable_regions[] 46 | // We can also pull in Regions automatically. 47 | ==== Supported Regions 48 | 49 | ifdef::template_not_all_regions[] 50 | This deployment includes , which isn’t currently supported in https://aws.amazon.com/about-aws/global-infrastructure/[all AWS Regions^]. 51 | endif::template_not_all_regions[] 52 | 53 | ifdef::auto_populate_regions[] 54 | The following Regions are currently supported by this Quick Start. 55 | include::../{generateddir}/regions/index.adoc[] 56 | endif::auto_populate_regions[] 57 | 58 | ifndef::auto_populate_regions[] 59 | 60 | ifndef::production_build[] 61 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/regions.adoc`**_ 62 | ++++ 63 |
64 | ++++ 65 | endif::production_build[] 66 | include::../{specificdir}/regions.adoc[] 67 | ifndef::production_build[] 68 | ++++ 69 |
70 | ++++ 71 | endif::production_build[] 72 | 73 | endif::auto_populate_regions[] 74 | 75 | TIP: Certain Regions are available on an opt-in basis. See https://docs.aws.amazon.com/general/latest/gr/rande-manage.html[Managing AWS Regions^]. 76 | 77 | endif::disable_regions[] 78 | ifdef::template_deterministic_ec2_instances[] 79 | ==== EC2 key pairs 80 | ifndef::production_build[====] 81 | ifndef::production_build[_This section applies only if the CloudFormation templates include EC2 instances._] 82 | ifndef::production_build[====] 83 | Make sure that at least one https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html[Amazon EC2 key pair^] exists in your AWS account in the Region where you plan to deploy the Quick Start. Make note of the key pair name. You need it during deployment. To create a key pair, see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html[Amazon EC2 key pairs and Linux instances^]. 84 | 85 | For testing or proof-of-concept purposes, we recommend creating a new key pair instead of using one that’s already being used by a production instance. 86 | endif::template_deterministic_ec2_instances[] 87 | 88 | ==== IAM permissions 89 | //todo: scope of least-privilege 90 | Before launching the Quick Start, you must sign in to the AWS Management Console with IAM permissions for the resources that the templates deploy. The _AdministratorAccess_ managed policy within IAM provides sufficient permissions, although your organization may choose to use a custom policy with more restrictions. For more information, see https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html[AWS managed policies for job functions^]. 91 | 92 | ifndef::production_build[] 93 | _**This portion of the deployment guide is located at `docs/languages/{langdir}/{specificdir}/pre-reqs.adoc`**_ 94 | [.preview_mode] 95 | |=== 96 | a| 97 | endif::production_build[] 98 | include::../{specificdir}/pre-reqs.adoc[] 99 | ifndef::production_build[] 100 | |=== 101 | endif::production_build[] 102 | 103 | ==== Deployment options 104 | ifndef::production_build[] 105 | _**This portion of the deployment guide is located at `_**This portion of the deployment guide is located at `docs/languages/docs-{LANG_CODE}/{specificdir}/pre-reqs.adoc`**_ 106 | /{specificdir}/deployment_options.adoc`**_ 107 | [.preview_mode] 108 | |=== 109 | a| 110 | endif::production_build[] 111 | include::../{specificdir}/deployment_options.adoc[] 112 | ifndef::production_build[] 113 | |=== 114 | endif::production_build[] 115 | -------------------------------------------------------------------------------- /docs/languages/docs-cn/translate-only/planning_deployment_eks_module.adoc: -------------------------------------------------------------------------------- 1 | === Specialized knowledge 2 | 3 | This deployment guide requires a moderate level of familiarity with 4 | AWS services. If you’re new to AWS, see the https://aws.amazon.com/getting-started/[Getting Started Resource Center^] 5 | and https://aws.amazon.com/training/[AWS Training and Certification^]. These sites provide materials for learning how to design, 6 | deploy, and operate your infrastructure and applications on the AWS Cloud. 7 | 8 | ifndef::production_build[] 9 | _**This portion of the deployment guide is located at `docs/{specificdir}/specialized_knowledge.adoc`**_ 10 | [.preview_mode] 11 | |=== 12 | a| 13 | endif::production_build[] 14 | include::../{specificdir}/specialized_knowledge.adoc[] 15 | ifndef::production_build[] 16 | |=== 17 | endif::production_build[] 18 | 19 | === AWS account 20 | 21 | If you don’t already have an AWS account, create one at https://aws.amazon.com/[https://aws.amazon.com^] by following the on-screen instructions. Part of the sign-up process involves receiving a phone call and entering a PIN using your phone's keypad. 22 | 23 | Your AWS account is automatically signed up for all AWS services. You are charged only for the services you use. 24 | 25 | === Amazon EKS cluster 26 | 27 | If you deploy your cluster into an existing Amazon EKS cluster that was not created by the https://aws-quickstart.github.io/quickstart-amazon-eks/[Amazon EKS on the AWS Cloud^] Quick Start, you must configure your cluster to allow this Quick Start to manage it. For more information, see the link:#_deployment_steps[Deployment steps] section. 28 | 29 | 30 | === IAM permissions 31 | //TODO: scope of least-privilege 32 | Before launching the Quick Start, you must log in to the AWS Management Console with https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html[AWS Identity and Access Management (IAM)^] permissions for the resources and actions that each template deploys. 33 | 34 | The _AdministratorAccess_ managed policy within IAM provides sufficient permissions, although your organization may choose to use a custom policy with more restrictions. 35 | 36 | === Deployment options 37 | 38 | This Quick Start provides three deployment options: 39 | 40 | * *Deploy {partner-product-short-name} into a new VPC (end-to-end deployment)*. This option builds a new AWS environment consisting of the VPC, subnets, NAT gateways, security groups, bastion hosts, EKS cluster, a node group, and other infrastructure components. It then deploys {partner-product-short-name} into this new EKS cluster. 41 | * *Deploy {partner-product-short-name} into a new EKS cluster of an existing VPC*. This option builds a new Amazon EKS cluster, node group, and other infrastructure components into an existing VPC. It then deploys {partner-product-short-name} into this new EKS cluster. 42 | * *Deploy {partner-product-short-name} into an existing EKS cluster*. This option provisions {partner-product-short-name} in your existing AWS infrastructure. Note that when deploying into an EKS cluster that was not created by the https://aws-quickstart.github.io/quickstart-amazon-eks/[Amazon EKS on the AWS Cloud^] Quick Start, you must prepare the cluster as described in the link:#_deployment_steps[Deployment steps] section. 43 | -------------------------------------------------------------------------------- /docs/partner_editable/_settings.adoc: -------------------------------------------------------------------------------- 1 | :quickstart-project-name: quickstart-clickhouse-cluster 2 | :partner-product-name: ClickHouse Cluster 3 | :partner-product-short-name: ClickHouse 4 | :partner-company-name: AWS Great China Region Solution team 5 | :doc-month: October 6 | :doc-year: 2021 7 | :aws-contributors: Wei Qiao, AWS Great China Region Solution team 8 | :quickstart-contributors: Troy Ameigh, AWS Integration & Automation team 9 | :deployment_time: 60 minutes 10 | :default_deployment_region: us-east-1 11 | :no_parameters: 12 | //doc -------------------------------------------------------------------------------- /docs/partner_editable/additional_info.adoc: -------------------------------------------------------------------------------- 1 | === Log in to a ClickHouse server node 2 | 3 | . Locate your private key, which is used to launch `clickhouse.pem`. Run the following command to ensure your key is not publicly viewable: 4 | 5 | [source,bash] 6 | -- 7 | chmod 400 ./clickhouse.pem 8 | -- 9 | 10 | [start=2] 11 | . Upload the PEM key pair to the bastion host: 12 | 13 | [source,bash] 14 | -- 15 | scp -i "clickhouse.pem" ./clickhouse.pem ec2-user@ec2-11-11-11-11.compute-1.amazonaws.com:/home/ec2-user 16 | -- 17 | 18 | [start=3] 19 | . Sign in to the bastion host: 20 | 21 | [source,bash] 22 | -- 23 | ssh -i "clickhouse.pem" ec2-user@ec2-11-11-11-11.compute-1.amazonaws.com 24 | -- 25 | 26 | :xrefstyle: short 27 | [start=4] 28 | . Obtain the IP address from the Amazon EC2 console. 29 | .. Navigate to the https://console.aws.amazon.com/ec2/[Amazon EC2 console^]. 30 | .. On the *Instances* page, select the check box for your instance. In the *Description* tab, note the *Private IPs*, as shown in <>. 31 | 32 | [#IPaddress] 33 | [link=images/ec2.png] 34 | .Private IP address for Amazon EC2 instance 35 | image::../images/ec2.png[ClickHouseClientAddress,width=75%,height=75%] 36 | 37 | [start=5] 38 | . From the bastion host, ensure that the PEM key pair file is in the bastion host directory, and then log in to the client node: 39 | 40 | + 41 | [source,bash] 42 | ---- 43 | (ec2-user@ip-11-11-11-11) $ ssh -i "clickhouse.pem" ec2-user@ec2-22-22-22-22.compute-1.amazonaws.com 44 | 45 | 46 | __| __|_ ) 47 | _| ( / Amazon Linux 2 AMI 48 | ___|\___|___| 49 | 50 | https://aws.amazon.com/amazon-linux-2/ 51 | No packages needed for security; 2 packages available 52 | Run "sudo yum update" to apply all updates. 53 | [ec2-user@ip-22-22-22-22 ~]$ 54 | ---- 55 | + 56 | 57 | [start=6] 58 | . To query, manage, and diagnose issues, use the https://clickhouse.tech/docs/en/interfaces/cli/[ClickHouse command line client^]. 59 | 60 | === Grafana web console 61 | 62 | By default, the deployment installs the Grafana web console on the ClickHouse client host in the private subnets. The subnets cannot be accessed directly through a browser. To access port `3000` of the private IP address of the Grafana server, configure an SSH (Secure Shell) connection using the tunnel of the bastion host. Then use the SSH tunnel to access the web console. 63 | 64 | [#step1] 65 | . Connect to the bastion host using SSH. Replace `port number`, `key pair.pem`, `user name`, and `host name` with your parameters: 66 | 67 | + 68 | `ssh -qTfnN -D _port number_ -i "_key pair.pem_" _user name_@_host name_` 69 | 70 | + 71 | For example: 72 | 73 | + 74 | `ssh -qTfnN -D 40011 -i "clickhouse.pem" \ec2-user@ec2-54-223-36-247.cn-north-1.compute.amazonaws.com.cn` 75 | 76 | . Set up a proxy manager, such as Proxy SwitchyOmega, in your browser. There are many proxy manager plugins available. The following example uses https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif[Proxy SwitchyOmega^]. 77 | ** https://microsoftedge.microsoft.com/addons/detail/proxy-switchyomega/fdbloeknjpnloaggplaobopplkdhnikc?hl=en-US[Install Proxy SwitchyOmega for Microsoft Edge^] 78 | ** https://addons.mozilla.org/en-US/firefox/addon/switchyomega/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search[[Install Proxy SwitchyOmega for Mozilla Firefox^] 79 | ** https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif?hl=en-US[[Install Proxy SwitchyOmega for Google Chrome^]] 80 | 81 | + 82 | 83 | .. Open the SwitchyOmega *Options* page, and choose *New Profile* in the left sidebar. 84 | 85 | + 86 | 87 | :xrefstyle: short 88 | [#addprofile] 89 | [link=images/SwitchyOmega1.png] 90 | .Add a new SwitchyOmega profile. 91 | image::../images/switchyOmega1.png[SwitchyOmega,width=50%,height=50%] 92 | 93 | + 94 | [start=3] 95 | .. Enter a name, and choose *Create*. 96 | 97 | + 98 | 99 | :xrefstyle: short 100 | [#profilename] 101 | [link=images/SwitchyOmega2.png] 102 | .Profile name 103 | image::../images/switchyOmega2.png[SwitchyOmega,width=50%,height=50%] 104 | 105 | + 106 | [start=4] 107 | :xrefstyle: short 108 | .. Provide the protocol, server, and port for the proxy server. The port is the local port where you set up the SSH tunnel. 109 | 110 | + 111 | 112 | [#proxyserverinfo] 113 | [link=images/SwitchyOmega3.png] 114 | .Proxy servers. 115 | image::../images/switchyOmega3.png[SwitchyOmega,width=50%,height=50%] 116 | 117 | + 118 | [start=5] 119 | .. Choose *Apply Changes*. 120 | .. Access SwitchyOmega through the extension in your browser. Choose your created profile in the proxy list. The browser sends all traffic through port `40011` to the bastion host. 121 | 122 | + 123 | 124 | :xrefstyle: short 125 | [#proxylist] 126 | [link=images/SwitchyOmega4.png] 127 | .Proxy list. 128 | image::../images/switchyOmega4.png[SwitchyOmega,width=50%,height=50%] 129 | 130 | + 131 | 132 | [start=3] 133 | . To view the Grafana web console on the ClickHouse client host, navigate to `http://10.0.xx.xx:3000` (replace `xx.xx` with the private IP address of the client host). You can find the private IP address of the server named `ClickHouseAdminClient` in the Amazon EC2 console. 134 | 135 | + 136 | :xrefstyle: short 137 | [#ec2console] 138 | [link=images/ec2.png] 139 | .Private IP address of the ClickHouse client host in the Amazon EC2 console. 140 | image::../images/ec2.png[ec2,width=50%,height=50%] 141 | 142 | 143 | + 144 | 145 | [#webconsole] 146 | [link=images/GrafanaConsole.png] 147 | .Grafana web console 148 | image::../images/GrafanaConsole.png[console,width=50%,height=50%] 149 | 150 | [start=4] 151 | . The user name is `admin`. To retrieve the password for the Grafana web console, navigate to the AWS CloudFormation console, choose *Outputs*, and search for the `DBPassword` parameter. 152 | 153 | + 154 | 155 | [#cloudformationconsole] 156 | [link=images/cloudformation_outputs.png] 157 | .AWS CloudFormation outputs 158 | image::../images/cloudformation_outputs.png[console,width=50%,height=50%] 159 | 160 | [start=5] 161 | . To find the password, navigate to the AWS Secrets Manager console, and choose *Retrieve secret value*. 162 | 163 | + 164 | 165 | [#secretsmanagerconsole] 166 | [link=images/secretsmanager.png] 167 | .AWS Secrets Manager console 168 | image::../images/secretsmanager.png[console,width=50%,height=50%] 169 | 170 | == Resources 171 | 172 | === ClickHouse server nodes 173 | 174 | * ClickHouse server installation directory: `/etc/clickhouse-server` 175 | * ClickHouse server data directory in local file storage: `/home/clickhouse/data` 176 | * ClickHouse server data directory in S3 bucket: `clickhouse-data-vpcid` 177 | * Deployment script installation log to troubleshoot error messages: `/home/ec2-user/ch-install.log` 178 | 179 | === ClickHouse client nodes 180 | 181 | * ClickHouse client installation directory: `/etc/clickhouse-client` 182 | * Deployment script installation log to troubleshoot error messages: `/home/ec2-user/clickhouse-client-install.log` 183 | * Grafana web console: `/etc/grafana` 184 | 185 | === ZooKeeper server nodes 186 | 187 | * Apache ZooKeeper installation directory: `/usr/local/apache-zookeeper-3.5.9-bin/` 188 | * Deployment script installation logs: `/home/ec2-user/zk.log` 189 | 190 | 191 | == {partner-product-short-name} resources 192 | // Provide post-deployment best practices for using the technology on AWS, including considerations such as migrating data, backups, ensuring high performance, high availability, etc. Link to software documentation for detailed information. 193 | 194 | * https://clickhouse.tech/blog/en/2021/reading-from-external-memory/[A journey to io_uring, AIO and modern storage devices^] 195 | * https://habr.com/en/company/yandex/blog/457612/[How to speed up LZ4 decompression in ClickHouse?^] 196 | * https://clickhouse.tech/blog/en/2021/fuzzing-clickhouse/[Fuzzing ClickHouse^] 197 | * https://habr.com/en/company/yandex/blog/485096/[Five Methods For Database Obfuscation^] 198 | -------------------------------------------------------------------------------- /docs/partner_editable/architecture.adoc: -------------------------------------------------------------------------------- 1 | :xrefstyle: short 2 | 3 | Deploying this Quick Start for a new virtual private cloud (VPC) with 4 | default parameters builds the following {partner-product-short-name} environment in the 5 | AWS Cloud. 6 | 7 | [#architecture1] 8 | .Quick Start architecture for {partner-product-short-name} on AWS 9 | image::../images/clickhouse_cluster_architecture_diagram.png[Architecture,width=100%,height=100%] 10 | 11 | As shown in <>, the Quick Start sets up the following: 12 | 13 | * A highly available architecture that spans two Availability Zones.* 14 | * A VPC configured with public and private subnets, according to AWS best practices, to provide you with your own virtual network on AWS.* 15 | ** An internet gateway to allow internet access for bastion hosts.* 16 | * In the public subnets: 17 | ** Managed network address translation (NAT) gateways to allow outbound internet access for resources in the private subnets.* 18 | ** A Linux bastion host in an Auto Scaling group to allow inbound Secure Shell (SSH) access to Amazon EC2 instances in public and private subnets.* 19 | * In the private subnets: 20 | ** A ClickHouse client in an Auto Scaling group to allow administrators to connect to the ClickHouse cluster. 21 | ** A ClickHouse database cluster that contains Amazon EC2 instances. 22 | ** A ZooKeeper cluster that contains Amazon EC2 instances for storing metadata for ClickHouse replication. Each replica stores its state in ZooKeeper as the set of parts and its checksums. The default is three. 23 | * Elastic Load Balancing for the ClickHouse cluster. 24 | * An Amazon S3 bucket for tiered storage of the ClickHouse cluster. 25 | * Amazon CloudWatch Logs to centralize ClickHouse logs and modify the log-retention policy. 26 | * Amazon Simple Notification Service (Amazon SNS) for sending email notifications when an alarm triggers. 27 | * AWS Secrets Manager to store dynamically generated passwords. 28 | 29 | [.small]#* The template that deploys the Quick Start into an existing VPC skips the components marked by asterisks and prompts you for your existing VPC configuration.# 30 | -------------------------------------------------------------------------------- /docs/partner_editable/deploy_steps.adoc: -------------------------------------------------------------------------------- 1 | === Confirm your AWS account configuration 2 | 3 | . Sign in to your AWS account at https://aws.amazon.com with an IAM user role that has the necessary permissions. For details, see link:#_planning_the_deployment[Planning the deployment] earlier in this guide. 4 | . Make sure that your AWS account is configured correctly, as discussed in the link:#_technical_requirements[Technical requirements] section. 5 | 6 | // Optional based on Marketplace listing. Not to be edited 7 | ifdef::marketplace_subscription[] 8 | === Subscribe to the {partner-product-short-name} AMI 9 | 10 | This Quick Start requires a subscription to the AMI for {partner-product-short-name} in AWS Marketplace. 11 | 12 | . Sign in to your AWS account. 13 | . Open the page for the {marketplace_listing_url}[{partner-product-short-name} AMI in AWS Marketplace^], and then choose *Continue to Subscribe*. 14 | . Review the terms and conditions for software usage, and then choose *Accept Terms*. + 15 | A confirmation page loads, and an email confirmation is sent to the account owner. For detailed subscription instructions, see the https://aws.amazon.com/marketplace/help/200799470[AWS Marketplace documentation^]. 16 | 17 | . When the subscription process is complete, exit out of AWS Marketplace without further action. *Do not* provision the software from AWS Marketplace—the Quick Start deploys the AMI for you. 18 | endif::marketplace_subscription[] 19 | // \Not to be edited 20 | 21 | === Launch the Quick Start 22 | // Adapt the following warning to your Quick Start. 23 | WARNING: If you’re deploying {partner-product-short-name} into an existing VPC, make sure that your VPC has two private subnets in different Availability Zones for the workload instances and that the subnets aren’t shared. This Quick Start doesn’t support https://docs.aws.amazon.com/vpc/latest/userguide/vpc-sharing.html[shared subnets^]. These subnets require https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html[NAT gateways^] in their route tables to allow the instances to download packages and software without exposing them to the internet. Also make sure that the domain name option in the DHCP options is configured as explained in http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html[DHCP options sets^]. You provide your VPC settings when you launch the Quick Start. 24 | 25 | Each deployment takes about {deployment_time} to complete. 26 | 27 | . Sign in to your AWS account, and choose one of the following options to launch the AWS CloudFormation template. For help with choosing an option, see link:#_deployment_options[Deployment options] earlier in this guide. 28 | + 29 | [cols="3,1"] 30 | |=== 31 | ^|https://fwd.aws/N4maE?[Deploy {partner-product-short-name} into a new VPC on AWS^] 32 | ^|https://fwd.aws/6QaWE?[View template^] 33 | 34 | ^|https://fwd.aws/y4mMk?[Deploy {partner-product-short-name} into an existing VPC on AWS^] 35 | ^|https://fwd.aws/XynX5?[View template^] 36 | |=== 37 | + 38 | . Check the AWS Region that’s displayed in the upper-right corner of the navigation bar, and change it if necessary. This Region is where the network infrastructure for {partner-product-short-name} is built. The template is launched in the {default_deployment_region} Region by default. For other choices, see link:#_supported_regions[Supported Regions], earlier in this guide. 39 | . On the *Create stack* page, keep the default setting for the template URL, and then choose *Next*. 40 | . On the *Specify stack details* page, change the stack name if needed. Review the parameters for the template, and provide values for any parameters that require input. For all other parameters, review the default settings and customize them as necessary. When you finish reviewing and customizing the parameters, choose *Next*. 41 | -------------------------------------------------------------------------------- /docs/partner_editable/deployment_options.adoc: -------------------------------------------------------------------------------- 1 | // Edit this placeholder text to accurately describe your architecture. 2 | 3 | This Quick Start provides two deployment options: 4 | 5 | * *Deploy {partner-product-short-name} into a new VPC*. This option builds a new AWS environment consisting of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys {partner-product-short-name} into this new VPC. 6 | * *Deploy {partner-product-short-name} into an existing VPC*. This option provisions {partner-product-short-name} in your existing AWS infrastructure. 7 | 8 | The Quick Start provides separate templates for these options. It also lets you configure Classless Inter-Domain Routing (CIDR) blocks, instance types, and {partner-product-short-name} settings, as discussed later in this guide. 9 | -------------------------------------------------------------------------------- /docs/partner_editable/faq_troubleshooting.adoc: -------------------------------------------------------------------------------- 1 | // Add any tips or answers to anticipated questions. 2 | 3 | == FAQ 4 | 5 | *Q.* I encountered a *CREATE_FAILED* error when I launched the Quick Start. 6 | 7 | *A.* If AWS CloudFormation fails to create the stack, relaunch the template with *Rollback on failure* set to *Disabled*. This setting is under *Advanced* in the AWS CloudFormation console on the *Configure stack options* page. With this setting, the stack’s state is retained, and the instance keeps running so that you can troubleshoot the issue. (For Windows, look at the log files in `%ProgramFiles%\Amazon\EC2ConfigService` and `C:\cfn\log`.) 8 | // Customize this answer if needed. For example, if you’re deploying on Linux instances, either provide the location for log files on Linux or omit the final sentence. If the Quick Start has no EC2 instances, revise accordingly (something like "and the assets keep running"). 9 | 10 | WARNING: When you set *Rollback on failure* to *Disabled*, you continue to incur AWS charges for this stack. Delete the stack when you finish troubleshooting. 11 | 12 | For more information, see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html[Troubleshooting AWS CloudFormation^]. 13 | 14 | *Q.* I encountered a size-limitation error when I deployed the AWS CloudFormation templates. 15 | 16 | *A.* Launch the Quick Start templates from the links in this guide or from another S3 bucket. If you deploy the templates from a local copy on your computer or from a location other than an S3 bucket, you might encounter template-size limitations. For more information, see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html[AWS CloudFormation quotas^]. 17 | 18 | *Q.* How can I access ClickHouse internal logs? 19 | 20 | *A.* Internal ClickHouse and ZooKeeper logs are found in the dashboard. On the AWS CloudFormation *Service* page, choose the Quick Start stack you created, and then choose `CloudWatchDashboard` from *Outputs*. 21 | -------------------------------------------------------------------------------- /docs/partner_editable/licenses.adoc: -------------------------------------------------------------------------------- 1 | // Include details about any licenses and how to sign up. Provide links as appropriate. If no licenses are required, clarify that. The following paragraphs provide examples of details you can provide. Remove italics, and rephrase as appropriate. 2 | 3 | No additional licenses are required to deploy this Quick Start. -------------------------------------------------------------------------------- /docs/partner_editable/overview_target_and_usage.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // Identify your target audience and explain how/why they would use this Quick Start. 3 | //Avoid borrowing text from third-party websites (copying text from AWS service documentation is fine). Also, avoid marketing-speak, focusing instead on the technical aspect. 4 | 5 | This Quick Start guide provides instructions for deploying a https://clickhouse.com/docs/en/[ClickHouse cluster^] on the AWS Cloud. ClickHouse is an open-source, column-oriented database management system (DBMS), which can be used for online analytical processing of queries (OLAP). 6 | 7 | This deployment is for customers who want to process analytical queries using a DBMS, such as MySQL, PostgreSQL, and Oracle Database. During the deployment, customers can configure the AWS CloudFormation templates to define the desired cluster nodes and settings. -------------------------------------------------------------------------------- /docs/partner_editable/pre-reqs.adoc: -------------------------------------------------------------------------------- 1 | // If no preperation is required, remove all content from here -------------------------------------------------------------------------------- /docs/partner_editable/product_description.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // Briefly describe the software. Use consistent and clear branding. 3 | // Include the benefits of using the software on AWS, and provide details on usage scenarios. 4 | 5 | ClickHouse is an SQL-based DBMS that customers can use to store, retrieve, and update data. Functions of a DBMS include the following: 6 | 7 | * User-defined catalog of metadata 8 | * Transaction support 9 | * Database recovery 10 | * Access management 11 | * Database constraints -------------------------------------------------------------------------------- /docs/partner_editable/regions.adoc: -------------------------------------------------------------------------------- 1 | This Quick Start is available for all AWS Regions. For more information, see https://docs.aws.amazon.com/general/latest/gr/rande.html[AWS service endpoints^]. 2 | //Full list: https://docs.aws.amazon.com/general/latest/gr/rande.html 3 | -------------------------------------------------------------------------------- /docs/partner_editable/service_limits.adoc: -------------------------------------------------------------------------------- 1 | // Replace the in each row to specify the number of resources used in this deployment. Remove the rows for resources that aren’t used. 2 | |=== 3 | |Resource |This deployment uses 4 | 5 | // Space needed to maintain table headers 6 | |VPCs | 1 7 | |Elastic IP addresses | 3 8 | |Security groups | 3 9 | |AWS Identity and Access Management (IAM) roles | 2 10 | |Auto Scaling groups | 2 11 | |Network Load Balancers | 1 12 | |Amazon CloudWatch dashboard | 1 13 | |S3 bucket | 1 14 | |m5.xlarge instances (ClickHouse cluster)| 2 15 | |m5.xlarge instances (ClickHouse client)| 1 16 | |m5.large instances (ZooKeeper cluster)| 3 17 | |t2.micro instances (bastion hosts) | 1 18 | |=== 19 | -------------------------------------------------------------------------------- /docs/partner_editable/specialized_knowledge.adoc: -------------------------------------------------------------------------------- 1 | // Replace the content in <> 2 | // For example: “familiarity with basic concepts in networking, database operations, and data encryption” or “familiarity with .” 3 | // Include links if helpful. 4 | // You don't need to list AWS services or point to general info about AWS; the boilerplate already covers this. 5 | 6 | This Quick Start assumes familiarity with https://aws.amazon.com/ec2/[Amazon EC2^], https://aws.amazon.com/vpc/[Amazon Virtual Private Cloud (VPC)^], and https://clickhouse.tech/[ClickHouse^]. 7 | -------------------------------------------------------------------------------- /scripts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-clickhouse-cluster/34a5ab1538ac1575d1667c38190846fe59ff5d9b/scripts/.gitkeep -------------------------------------------------------------------------------- /scripts/clickhouse-arm-client-install.sh: -------------------------------------------------------------------------------- 1 | #################### 2 | 3 | 4 | # ${ClickHouseVersion} 1 5 | # ${DBPassword} 2 6 | # ${RootStackName} 3 7 | # ${AWS::Region} 4 8 | # ${DemoDataSize} 5 9 | # ${ClickHouseNodeCount} 6 10 | # ${GrafanaVersion} 7 11 | 12 | 13 | # Install the basics 14 | apt install unzip 15 | 16 | flag=600 17 | while((flag > 0)) 18 | do 19 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica01 --region $4` > instancelist-1 20 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-1` 21 | if (( $count >= 1 )) 22 | then 23 | python3 find-clickhouse-node.py instancelist-1 result-1 24 | node1=`sed -n '1p' result-1` 25 | break 26 | fi 27 | echo $flag 28 | let flag-- 29 | sleep 1 30 | done 31 | 32 | flag=600 33 | while((flag > 0)) 34 | do 35 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica02 --region $4` > instancelist-2 36 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-2` 37 | if (( $count >= 1 )) 38 | then 39 | python3 find-clickhouse-node.py instancelist-2 result-2 40 | node2=`sed -n '1p' result-2` 41 | break 42 | fi 43 | echo $flag 44 | let flag-- 45 | sleep 1 46 | done 47 | 48 | if (( $6 >= 4)) 49 | then 50 | flag=600 51 | while((flag > 0)) 52 | do 53 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica01 --region $4` > instancelist-3 54 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-3` 55 | if (( $count >= 1 )) 56 | then 57 | python3 find-clickhouse-node.py instancelist-3 result-3 58 | node3=`sed -n '1p' result-3` 59 | break 60 | fi 61 | let flag-- 62 | sleep 1 63 | done 64 | 65 | flag=600 66 | while((flag > 0)) 67 | do 68 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica02 --region $4` > instancelist-4 69 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-4` 70 | if (( $count >= 1 )) 71 | then 72 | python3 find-clickhouse-node.py instancelist-4 result-4 73 | node4=`sed -n '1p' result-4` 74 | break 75 | fi 76 | let flag-- 77 | sleep 1 78 | done 79 | fi 80 | 81 | if (( $6 >= 6)) 82 | then 83 | flag=600 84 | while((flag > 0)) 85 | do 86 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica01 --region $4` > instancelist-5 87 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-5` 88 | if (( $count >= 1 )) 89 | then 90 | python3 find-clickhouse-node.py instancelist-5 result-5 91 | node5=`sed -n '1p' result-5` 92 | break 93 | fi 94 | let flag-- 95 | sleep 1 96 | done 97 | 98 | flag=600 99 | while((flag > 0)) 100 | do 101 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica02 --region $4` > instancelist-6 102 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-6` 103 | if (( $count >= 1 )) 104 | then 105 | python3 find-clickhouse-node.py instancelist-6 result-6 106 | node6=`sed -n '1p' result-6` 107 | break 108 | fi 109 | let flag-- 110 | sleep 1 111 | done 112 | fi 113 | 114 | if (( $6 >= 8)) 115 | then 116 | flag=600 117 | while((flag > 0)) 118 | do 119 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica01 --region $4` > instancelist-7 120 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-7` 121 | if (( $count >= 1 )) 122 | then 123 | python3 find-clickhouse-node.py instancelist-7 result-7 124 | node7=`sed -n '1p' result-7` 125 | break 126 | fi 127 | let flag-- 128 | sleep 1 129 | done 130 | 131 | flag=600 132 | while((flag > 0)) 133 | do 134 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica02 --region $4` > instancelist-8 135 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-8` 136 | if (( $count >= 1 )) 137 | then 138 | python3 find-clickhouse-node.py instancelist-8 result-8 139 | node8=`sed -n '1p' result-8` 140 | break 141 | fi 142 | let flag-- 143 | sleep 1 144 | done 145 | fi 146 | 147 | # install grafana 148 | mkdir -p /root/tools/install/ 149 | cd /root/tools/install/ 150 | mkdir /root/tools/install/grafana 151 | sudo apt-get install -y adduser libfontconfig1 152 | wget https://dl.grafana.com/oss/release/grafana_${7}_arm64.deb 153 | sudo dpkg -i grafana_${7}_arm64.deb 154 | sleep 1 155 | grafana-cli plugins install vertamedia-clickhouse-datasource 156 | 157 | systemctl stop grafana-server 158 | systemctl start grafana-server 159 | sleep 1 160 | systemctl status grafana-server 161 | 162 | # Change the default password 163 | grafana-cli admin reset-admin-password ${2} 164 | 165 | systemctl stop grafana-server 166 | systemctl start grafana-server 167 | 168 | echo "systemctl start grafana-server" > /root/grafana-start.sh 169 | chmod +x /root/grafana-start.sh 170 | 171 | echo "[Install]" >> /lib/systemd/system/rc-local.service 172 | echo "WantedBy=multi-user.target" >> /lib/systemd/system/rc-local.service 173 | echo "Alias=rc-local.service" >> /lib/systemd/system/rc-local.service 174 | ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/ 175 | 176 | # No default rc.local on Ubuntu 18+ 177 | cat << EOF > /etc/rc.local 178 | #!/bin/bash -e 179 | /root/grafana-start.sh 180 | EOF 181 | chmod +x /etc/rc.local 182 | 183 | # demo data 184 | 185 | if [ $5 = small ]; then 186 | ontimefrom=1988 187 | ontimeto=1989 188 | elif [ $5 = medium ]; then 189 | ontimefrom=1988 190 | ontimeto=1995 191 | elif [ $5 = large ]; then 192 | ontimefrom=1988 193 | ontimeto=2010 194 | elif [ $5 = none ]; then 195 | ontimefrom=0 196 | ontimeto=0 197 | else 198 | echo "Parameters not found or inaccessible." 199 | fi 200 | 201 | mkdir -pv /root/tools/install/demodata 202 | cd /root/tools/install/demodata 203 | mv /root/downloaddata.sh . 204 | 205 | sed -i "s|ontimefrom|$ontimefrom|" /root/tools/install/demodata/downloaddata.sh 206 | sed -i "s|ontimeto|$ontimeto|" /root/tools/install/demodata/downloaddata.sh 207 | 208 | chmod +x /root/tools/install/demodata/downloaddata.sh 209 | ./downloaddata.sh 210 | sleep 1 211 | # Retry to download the missing file 212 | ./downloaddata.sh 213 | 214 | ls -1 *.zip | xargs -I{} -P $(nproc) bash -c "echo {}; unzip -cq {} '*.csv' | sed 's/\.00//g' | clickhouse-client --host ${node1} --password $2 --input_format_with_names_use_header=0 --query='INSERT INTO ontime FORMAT CSVWithNames'" 215 | sleep 1 216 | #echo 'INSERT INTO ontime FORMAT CSVWithNames' | curl 'http://localhost:9099/?user=$replica-write&password=$replicapassword' -d @- 217 | 218 | # Clean 219 | rm -rf /root/find-clickhouse-node.py 220 | rm -rf /root/instancelist-1 221 | rm -rf /root/result-1 222 | rm -rf /root/instancelist-2 223 | rm -rf /root/result-2 224 | rm -rf /root/instancelist-3 225 | rm -rf /root/result-3 226 | rm -rf /root/instancelist-4 227 | rm -rf /root/result-4 228 | rm -rf /root/instancelist-5 229 | rm -rf /root/result-5 230 | rm -rf /root/instancelist-6 231 | rm -rf /root/result-6 232 | rm -rf /root/instancelist-7 233 | rm -rf /root/result-7 234 | rm -rf /root/instancelist-8 235 | rm -rf /root/result-8 236 | rm -rf /root/tools/install/grafana_${7}_arm64.deb 237 | rm -rf /root/tools/install/demodata/downloaddata.sh 238 | 239 | echo " Done with installations" 240 | -------------------------------------------------------------------------------- /scripts/clickhouse-arm-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ${ClickHouseVersion} 1 4 | # ${ClickHouseNodeCount} 2 5 | # ${RootStackName} 3 6 | # ${AWS::Region} 4 7 | # http://s3.${AWS::Region}.${AWS::URLSuffix}/${ClickHouseBucketName}/quickstart-clickhouse-data/ 5 8 | # ${MoveFactor} 6 9 | # ${ClickHouseTimezone} 7 10 | # ${ZookeeperPrivateIp1} 8 11 | # ${ZookeeperPrivateIp2} 9 12 | # ${ZookeeperPrivateIp3} 10 13 | # `python3 ./find-secret.py secretfile ` 11 14 | # ${MaxThreads} 12 15 | # ${MaxInsertThreads} 13 16 | # ${DistributedProductMode} 14 17 | # ${MaxMemoryUsage} 15 18 | # ${LoadBalancing} 16 19 | # ${MaxDataPartSize} 17 20 | # ShardNum 18 21 | # ReplicaNum 19 22 | # ${ClickHousePkgS3URI} 20 23 | 24 | sudo useradd -m -s /bin/bash clickhouse 25 | passwd clickhouse<" >> /etc/clickhouse-server/metrika.xml 79 | echo "" >> /etc/clickhouse-server/metrika.xml 80 | echo " " >> /etc/clickhouse-server/metrika.xml 81 | echo " " >> /etc/clickhouse-server/metrika.xml 82 | echo " true" >> /etc/clickhouse-server/metrika.xml 83 | echo " " >> /etc/clickhouse-server/metrika.xml 84 | echo " ClickHouseNode1" >> /etc/clickhouse-server/metrika.xml 85 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 86 | echo " default" >> /etc/clickhouse-server/metrika.xml 87 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 88 | echo " " >> /etc/clickhouse-server/metrika.xml 89 | echo " " >> /etc/clickhouse-server/metrika.xml 90 | echo " ClickHouseNode2" >> /etc/clickhouse-server/metrika.xml 91 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 92 | echo " default" >> /etc/clickhouse-server/metrika.xml 93 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 94 | echo " " >> /etc/clickhouse-server/metrika.xml 95 | echo " " >> /etc/clickhouse-server/metrika.xml 96 | 97 | if [ $2 -ge 4 ] 98 | then 99 | echo " " >> /etc/clickhouse-server/metrika.xml 100 | echo " true" >> /etc/clickhouse-server/metrika.xml 101 | echo " " >> /etc/clickhouse-server/metrika.xml 102 | echo " ClickHouseNode3" >> /etc/clickhouse-server/metrika.xml 103 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 104 | echo " default" >> /etc/clickhouse-server/metrika.xml 105 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 106 | echo " " >> /etc/clickhouse-server/metrika.xml 107 | echo " " >> /etc/clickhouse-server/metrika.xml 108 | echo " ClickHouseNode4" >> /etc/clickhouse-server/metrika.xml 109 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 110 | echo " default" >> /etc/clickhouse-server/metrika.xml 111 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 112 | echo " " >> /etc/clickhouse-server/metrika.xml 113 | echo " " >> /etc/clickhouse-server/metrika.xml 114 | fi 115 | 116 | if [ $2 -ge 6 ] 117 | then 118 | echo " " >> /etc/clickhouse-server/metrika.xml 119 | echo " true" >> /etc/clickhouse-server/metrika.xml 120 | echo " " >> /etc/clickhouse-server/metrika.xml 121 | echo " ClickHouseNode5" >> /etc/clickhouse-server/metrika.xml 122 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 123 | echo " default" >> /etc/clickhouse-server/metrika.xml 124 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 125 | echo " " >> /etc/clickhouse-server/metrika.xml 126 | echo " " >> /etc/clickhouse-server/metrika.xml 127 | echo " ClickHouseNode6" >> /etc/clickhouse-server/metrika.xml 128 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 129 | echo " default" >> /etc/clickhouse-server/metrika.xml 130 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 131 | echo " " >> /etc/clickhouse-server/metrika.xml 132 | echo " " >> /etc/clickhouse-server/metrika.xml 133 | fi 134 | 135 | if [ $2 -ge 8 ] 136 | then 137 | echo " " >> /etc/clickhouse-server/metrika.xml 138 | echo " true" >> /etc/clickhouse-server/metrika.xml 139 | echo " " >> /etc/clickhouse-server/metrika.xml 140 | echo " ClickHouseNode7" >> /etc/clickhouse-server/metrika.xml 141 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 142 | echo " default" >> /etc/clickhouse-server/metrika.xml 143 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 144 | echo " " >> /etc/clickhouse-server/metrika.xml 145 | echo " " >> /etc/clickhouse-server/metrika.xml 146 | echo " ClickHouseNode8" >> /etc/clickhouse-server/metrika.xml 147 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 148 | echo " default" >> /etc/clickhouse-server/metrika.xml 149 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 150 | echo " " >> /etc/clickhouse-server/metrika.xml 151 | echo " " >> /etc/clickhouse-server/metrika.xml 152 | fi 153 | 154 | echo " " >> /etc/clickhouse-server/metrika.xml 155 | echo "" >> /etc/clickhouse-server/metrika.xml 156 | echo "" >> /etc/clickhouse-server/metrika.xml 157 | echo " " >> /etc/clickhouse-server/metrika.xml 158 | echo " $8" >> /etc/clickhouse-server/metrika.xml 159 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 160 | echo " " >> /etc/clickhouse-server/metrika.xml 161 | echo " " >> /etc/clickhouse-server/metrika.xml 162 | echo " $9" >> /etc/clickhouse-server/metrika.xml 163 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 164 | echo " " >> /etc/clickhouse-server/metrika.xml 165 | echo " " >> /etc/clickhouse-server/metrika.xml 166 | echo " ${10}" >> /etc/clickhouse-server/metrika.xml 167 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 168 | echo " " >> /etc/clickhouse-server/metrika.xml 169 | echo "" >> /etc/clickhouse-server/metrika.xml 170 | echo "" >> /etc/clickhouse-server/metrika.xml 171 | echo " ::/0" >> /etc/clickhouse-server/metrika.xml 172 | echo "" >> /etc/clickhouse-server/metrika.xml 173 | echo "" >> /etc/clickhouse-server/metrika.xml 174 | echo "" >> /etc/clickhouse-server/metrika.xml 175 | echo " 10000000000" >> /etc/clickhouse-server/metrika.xml 176 | echo " 0.01" >> /etc/clickhouse-server/metrika.xml 177 | echo " lz4" >> /etc/clickhouse-server/metrika.xml 178 | echo "" >> /etc/clickhouse-server/metrika.xml 179 | echo "" >> /etc/clickhouse-server/metrika.xml 180 | echo "" >> /etc/clickhouse-server/metrika.xml 181 | 182 | flag=600 183 | while((flag > 0)) 184 | do 185 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica01 --region $4` > instancelist-1 186 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-1` 187 | if (( $count >= 1 )) 188 | then 189 | python3 find-clickhouse-node.py instancelist-1 result-1 190 | node1=`sed -n '1p' result-1` 191 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode1|${node1}|g" 192 | break 193 | fi 194 | echo $flag 195 | let flag-- 196 | sleep 1 197 | done 198 | 199 | flag=600 200 | while((flag > 0)) 201 | do 202 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica02 --region $4` > instancelist-2 203 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-2` 204 | if (( $count >= 1 )) 205 | then 206 | python3 find-clickhouse-node.py instancelist-2 result-2 207 | node2=`sed -n '1p' result-2` 208 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode2|${node2}|g" 209 | break 210 | fi 211 | echo $flag 212 | let flag-- 213 | sleep 1 214 | done 215 | 216 | if (( $2 >= 4)) 217 | then 218 | flag=600 219 | while((flag > 0)) 220 | do 221 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica01 --region $4` > instancelist-3 222 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-3` 223 | if (( $count >= 1 )) 224 | then 225 | python3 find-clickhouse-node.py instancelist-3 result-3 226 | node3=`sed -n '1p' result-3` 227 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode3|${node3}|g" 228 | break 229 | fi 230 | let flag-- 231 | sleep 1 232 | done 233 | 234 | flag=600 235 | while((flag > 0)) 236 | do 237 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica02 --region $4` > instancelist-4 238 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-4` 239 | if (( $count >= 1 )) 240 | then 241 | python3 find-clickhouse-node.py instancelist-4 result-4 242 | node4=`sed -n '1p' result-4` 243 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode4|${node4}|g" 244 | break 245 | fi 246 | let flag-- 247 | sleep 1 248 | done 249 | fi 250 | 251 | if (( $2 >= 6)) 252 | then 253 | flag=600 254 | while((flag > 0)) 255 | do 256 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica01 --region $4` > instancelist-5 257 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-5` 258 | if (( $count >= 1 )) 259 | then 260 | python3 find-clickhouse-node.py instancelist-5 result-5 261 | node5=`sed -n '1p' result-5` 262 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode5|${node5}|g" 263 | break 264 | fi 265 | let flag-- 266 | sleep 1 267 | done 268 | 269 | flag=600 270 | while((flag > 0)) 271 | do 272 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica02 --region $4` > instancelist-6 273 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-6` 274 | if (( $count >= 1 )) 275 | then 276 | python3 find-clickhouse-node.py instancelist-6 result-6 277 | node6=`sed -n '1p' result-6` 278 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode6|${node6}|g" 279 | break 280 | fi 281 | let flag-- 282 | sleep 1 283 | done 284 | fi 285 | 286 | if (( $2 >= 8)) 287 | then 288 | flag=600 289 | while((flag > 0)) 290 | do 291 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica01 --region $4` > instancelist-7 292 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-7` 293 | if (( $count >= 1 )) 294 | then 295 | python3 find-clickhouse-node.py instancelist-7 result-7 296 | node7=`sed -n '1p' result-7` 297 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode7|${node7}|g" 298 | break 299 | fi 300 | let flag-- 301 | sleep 1 302 | done 303 | 304 | flag=600 305 | while((flag > 0)) 306 | do 307 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica02 --region $4` > instancelist-8 308 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-8` 309 | if (( $count >= 1 )) 310 | then 311 | python3 find-clickhouse-node.py instancelist-8 result-8 312 | node8=`sed -n '1p' result-8` 313 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode8|${node8}|g" 314 | break 315 | fi 316 | let flag-- 317 | sleep 1 318 | done 319 | fi 320 | 321 | if [ $1 = 23.3.8.21 ]; then 322 | echo "Update the config.xml of $1" 323 | sed -i '783, 970d' /etc/clickhouse-server/config.xml 324 | fi 325 | 326 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e 's||/etc/clickhouse-server/metrika.xml|g' 327 | 328 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|trace|information|g" 329 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/log/clickhouse-server/clickhouse-server.log|/home/clickhouse/data/log/clickhouse-server.log|g" 330 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/log/clickhouse-server/clickhouse-server.err.log|/home/clickhouse/data/log/clickhouse-server.err.log|g" 331 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/lib/clickhouse/|/home/clickhouse/data/clickhouse-data/|g" 332 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/lib/clickhouse/|/home/clickhouse/data/|g" 333 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s||$7|g" 334 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s||0.0.0.0|g" 335 | 336 | find /etc/clickhouse-server/ -name 'users.xml' | xargs perl -pi -e "s||${11}|g" 337 | #password_sha256_hex=`echo -n '${11}' | sha256sum | tr -d '-' | sed 's/ //g'` 338 | #find /etc/clickhouse-server/ -name 'users.xml' | xargs perl -pi -e "s||${password_sha256_hex}|g" 339 | sudo sed -i "9a ${12}" /etc/clickhouse-server/users.xml 340 | sudo sed -i "9a ${13}" /etc/clickhouse-server/users.xml 341 | sudo sed -i "9a ${14}" /etc/clickhouse-server/users.xml 342 | sudo sed -i "s|10000000000|${15}|" /etc/clickhouse-server/users.xml 343 | sudo sed -i "s|random|${16}|" /etc/clickhouse-server/users.xml 344 | sudo sed -i 's||1|' /etc/clickhouse-server/users.xml 345 | 346 | 347 | echo "" >> /etc/clickhouse-server/config.d/storage.xml 348 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 349 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 350 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 351 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 352 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 353 | echo " default" >> /etc/clickhouse-server/config.d/storage.xml 354 | echo " ${17}" >> /etc/clickhouse-server/config.d/storage.xml 355 | echo " false" >> /etc/clickhouse-server/config.d/storage.xml 356 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 357 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 358 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 359 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 360 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 361 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 362 | 363 | #echo "" >> /etc/clickhouse-server/config.d/storage.xml 364 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 365 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 366 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 367 | #echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 368 | #echo " $5" >> /etc/clickhouse-server/config.d/storage.xml 369 | #echo " true" >> /etc/clickhouse-server/config.d/storage.xml 370 | #echo " 10000" >> /etc/clickhouse-server/config.d/storage.xml 371 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 372 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 373 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 374 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 375 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 376 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 377 | #echo " default" >> /etc/clickhouse-server/config.d/storage.xml 378 | #echo " ${17}" >> /etc/clickhouse-server/config.d/storage.xml 379 | #echo " false" >> /etc/clickhouse-server/config.d/storage.xml 380 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 381 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 382 | #echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 383 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 384 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 385 | #echo " ${6}" >> /etc/clickhouse-server/config.d/storage.xml 386 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 387 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 388 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 389 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 390 | #echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 391 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 392 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 393 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 394 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 395 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 396 | #echo "
" >> /etc/clickhouse-server/config.d/storage.xml 397 | 398 | echo "" >> /etc/clickhouse-server/config.d/macros.xml 399 | echo " " >> /etc/clickhouse-server/config.d/macros.xml 400 | echo " cluster01-${18}-${19}" >> /etc/clickhouse-server/config.d/macros.xml 401 | echo " ${18}" >> /etc/clickhouse-server/config.d/macros.xml 402 | echo " 01" >> /etc/clickhouse-server/config.d/macros.xml 403 | echo " " >> /etc/clickhouse-server/config.d/macros.xml 404 | echo "" >> /etc/clickhouse-server/config.d/macros.xml 405 | 406 | chown -R clickhouse.clickhouse /home/clickhouse/ 407 | chown -R clickhouse.clickhouse /etc/clickhouse-server/ 408 | 409 | echo "* soft nofile 65536" >> /etc/security/limits.conf 410 | echo "* hard nofile 65536" >> /etc/security/limits.conf 411 | echo "* soft nproc 131072" >> /etc/security/limits.conf 412 | echo "* hard nproc 131072" >> /etc/security/limits.conf 413 | 414 | systemctl stop clickhouse-server 415 | systemctl start clickhouse-server 416 | systemctl status clickhouse-server 417 | 418 | # Restart ClickHouse 419 | sleep 5 420 | systemctl stop clickhouse-server 421 | systemctl start clickhouse-server 422 | systemctl status clickhouse-server 423 | sleep 1 424 | 425 | echo "[Install]" >> /lib/systemd/system/rc-local.service 426 | echo "WantedBy=multi-user.target" >> /lib/systemd/system/rc-local.service 427 | echo "Alias=rc-local.service" >> /lib/systemd/system/rc-local.service 428 | ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/ 429 | 430 | # No default rc.local on Ubuntu 18+ 431 | cat << EOF > /etc/rc.local 432 | #!/bin/bash -e 433 | systemctl start clickhouse-server 434 | EOF 435 | chmod +x /etc/rc.local 436 | -------------------------------------------------------------------------------- /scripts/clickhouse-client-install.sh: -------------------------------------------------------------------------------- 1 | #################### 2 | 3 | 4 | # ${ClickHouseVersion} 1 5 | # ${DBPassword} 2 6 | # ${RootStackName} 3 7 | # ${AWS::Region} 4 8 | # ${DemoDataSize} 5 9 | # ${ClickHouseNodeCount} 6 10 | # ${GrafanaVersion} 7 11 | 12 | 13 | # Install the basics 14 | yum -y update -y 15 | yum -y install jq -y 16 | yum install python3.7 -y 17 | 18 | pip3 install awscli --upgrade --user 19 | echo "export PATH=~/.local/bin:$PATH" >> .bash_profile 20 | sleep 1 21 | pip3 install boto3 --user 22 | pip3 install awscli --upgrade --user 23 | sleep 1 24 | 25 | 26 | yum install yum-utils 27 | 28 | sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo 29 | sudo yum install clickhouse-client-$1 -y 30 | 31 | sleep 1 32 | if [ ! -d "/etc/clickhouse-client" ]; then 33 | echo "Try to download from https://mirrors.tuna.tsinghua.edu.cn/clickhouse/" 34 | rpm --import https://mirrors.tuna.tsinghua.edu.cn/clickhouse/CLICKHOUSE-KEY.GPG 35 | yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/clickhouse/rpm/stable/x86_64 36 | yum install clickhouse-client-$1 -y 37 | fi 38 | 39 | cd /home/ec2-user/ 40 | 41 | flag=600 42 | while((flag > 0)) 43 | do 44 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica01 --region $4` > instancelist-1 45 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-1` 46 | if (( $count >= 1 )) 47 | then 48 | python3 find-clickhouse-node.py instancelist-1 result-1 49 | node1=`sed -n '1p' result-1` 50 | break 51 | fi 52 | echo $flag 53 | let flag-- 54 | sleep 1 55 | done 56 | 57 | flag=600 58 | while((flag > 0)) 59 | do 60 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica02 --region $4` > instancelist-2 61 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-2` 62 | if (( $count >= 1 )) 63 | then 64 | python3 find-clickhouse-node.py instancelist-2 result-2 65 | node2=`sed -n '1p' result-2` 66 | break 67 | fi 68 | echo $flag 69 | let flag-- 70 | sleep 1 71 | done 72 | 73 | if (( $6 >= 4)) 74 | then 75 | flag=600 76 | while((flag > 0)) 77 | do 78 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica01 --region $4` > instancelist-3 79 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-3` 80 | if (( $count >= 1 )) 81 | then 82 | python3 find-clickhouse-node.py instancelist-3 result-3 83 | node3=`sed -n '1p' result-3` 84 | break 85 | fi 86 | let flag-- 87 | sleep 1 88 | done 89 | 90 | flag=600 91 | while((flag > 0)) 92 | do 93 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica02 --region $4` > instancelist-4 94 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-4` 95 | if (( $count >= 1 )) 96 | then 97 | python3 find-clickhouse-node.py instancelist-4 result-4 98 | node4=`sed -n '1p' result-4` 99 | break 100 | fi 101 | let flag-- 102 | sleep 1 103 | done 104 | fi 105 | 106 | if (( $6 >= 6)) 107 | then 108 | flag=600 109 | while((flag > 0)) 110 | do 111 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica01 --region $4` > instancelist-5 112 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-5` 113 | if (( $count >= 1 )) 114 | then 115 | python3 find-clickhouse-node.py instancelist-5 result-5 116 | node5=`sed -n '1p' result-5` 117 | break 118 | fi 119 | let flag-- 120 | sleep 1 121 | done 122 | 123 | flag=600 124 | while((flag > 0)) 125 | do 126 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica02 --region $4` > instancelist-6 127 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-6` 128 | if (( $count >= 1 )) 129 | then 130 | python3 find-clickhouse-node.py instancelist-6 result-6 131 | node6=`sed -n '1p' result-6` 132 | break 133 | fi 134 | let flag-- 135 | sleep 1 136 | done 137 | fi 138 | 139 | if (( $6 >= 8)) 140 | then 141 | flag=600 142 | while((flag > 0)) 143 | do 144 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica01 --region $4` > instancelist-7 145 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-7` 146 | if (( $count >= 1 )) 147 | then 148 | python3 find-clickhouse-node.py instancelist-7 result-7 149 | node7=`sed -n '1p' result-7` 150 | break 151 | fi 152 | let flag-- 153 | sleep 1 154 | done 155 | 156 | flag=600 157 | while((flag > 0)) 158 | do 159 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica02 --region $4` > instancelist-8 160 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-8` 161 | if (( $count >= 1 )) 162 | then 163 | python3 find-clickhouse-node.py instancelist-8 result-8 164 | node8=`sed -n '1p' result-8` 165 | break 166 | fi 167 | let flag-- 168 | sleep 1 169 | done 170 | fi 171 | 172 | # install grafana 173 | mkdir -p /home/ec2-user/tools/install/ 174 | cd /home/ec2-user/tools/install/ 175 | mkdir /home/ec2-user/tools/install/grafana 176 | wget https://dl.grafana.com/oss/release/grafana-$7.x86_64.rpm 177 | yum install grafana-$7.x86_64.rpm -y 178 | sleep 1 179 | grafana-cli plugins install vertamedia-clickhouse-datasource 180 | 181 | systemctl stop grafana-server 182 | systemctl start grafana-server 183 | sleep 1 184 | systemctl status grafana-server 185 | 186 | # Change the default password 187 | grafana-cli admin reset-admin-password ${2} 188 | 189 | systemctl stop grafana-server 190 | systemctl start grafana-server 191 | 192 | echo "systemctl start grafana-server" > /home/ec2-user/grafana-start.sh 193 | chmod +x /home/ec2-user/grafana-start.sh 194 | echo "/home/ec2-user/grafana-start.sh" >> /etc/rc.d/rc.local 195 | chmod +x /etc/rc.d/rc.local 196 | 197 | # demo data 198 | 199 | if [ $5 = small ]; then 200 | ontimefrom=1988 201 | ontimeto=1989 202 | elif [ $5 = medium ]; then 203 | ontimefrom=1988 204 | ontimeto=1995 205 | elif [ $5 = large ]; then 206 | ontimefrom=1988 207 | ontimeto=2010 208 | elif [ $5 = none ]; then 209 | ontimefrom=0 210 | ontimeto=0 211 | else 212 | echo "Parameters not found or inaccessible." 213 | fi 214 | 215 | mkdir -pv /home/ec2-user/tools/install/demodata 216 | cd /home/ec2-user/tools/install/demodata 217 | mv /home/ec2-user/downloaddata.sh . 218 | 219 | sed -i "s|ontimefrom|$ontimefrom|" /home/ec2-user/tools/install/demodata/downloaddata.sh 220 | sed -i "s|ontimeto|$ontimeto|" /home/ec2-user/tools/install/demodata/downloaddata.sh 221 | 222 | chmod +x /home/ec2-user/tools/install/demodata/downloaddata.sh 223 | ./downloaddata.sh 224 | sleep 1 225 | # Retry to download the missing file 226 | ./downloaddata.sh 227 | 228 | ls -1 *.zip | xargs -I{} -P $(nproc) bash -c "echo {}; unzip -cq {} '*.csv' | sed 's/\.00//g' | clickhouse-client --host ${node1} --password $2 --input_format_with_names_use_header=0 --query='INSERT INTO ontime FORMAT CSVWithNames'" 229 | sleep 1 230 | #echo 'INSERT INTO ontime FORMAT CSVWithNames' | curl 'http://localhost:9099/?user=$replica-write&password=$replicapassword' -d @- 231 | 232 | # Clean 233 | rm -rf /home/ec2-user/find-clickhouse-node.py 234 | rm -rf /home/ec2-user/instancelist-1 235 | rm -rf /home/ec2-user/result-1 236 | rm -rf /home/ec2-user/instancelist-2 237 | rm -rf /home/ec2-user/result-2 238 | rm -rf /home/ec2-user/instancelist-3 239 | rm -rf /home/ec2-user/result-3 240 | rm -rf /home/ec2-user/instancelist-4 241 | rm -rf /home/ec2-user/result-4 242 | rm -rf /home/ec2-user/instancelist-5 243 | rm -rf /home/ec2-user/result-5 244 | rm -rf /home/ec2-user/instancelist-6 245 | rm -rf /home/ec2-user/result-6 246 | rm -rf /home/ec2-user/instancelist-7 247 | rm -rf /home/ec2-user/result-7 248 | rm -rf /home/ec2-user/instancelist-8 249 | rm -rf /home/ec2-user/result-8 250 | rm -rf /home/ec2-user/tools/install/grafana-$7.x86_64.rpm 251 | rm -rf /home/ec2-user/tools/install/demodata/downloaddata.sh 252 | 253 | echo " Done with installations" 254 | -------------------------------------------------------------------------------- /scripts/clickhouse-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ${ClickHouseVersion} 1 4 | # ${ClickHouseNodeCount} 2 5 | # ${RootStackName} 3 6 | # ${AWS::Region} 4 7 | # http://s3.${AWS::Region}.${AWS::URLSuffix}/${ClickHouseBucketName}/quickstart-clickhouse-data/ 5 # S3VPCEndpoint 8 | # ${MoveFactor} 6 9 | # ${ClickHouseTimezone} 7 10 | # ${ZookeeperPrivateIp1} 8 11 | # ${ZookeeperPrivateIp2} 9 12 | # ${ZookeeperPrivateIp3} 10 13 | # ${DBPassword} 11 14 | # ${MaxThreads} 12 15 | # ${MaxInsertThreads} 13 16 | # ${DistributedProductMode} 14 17 | # ${MaxMemoryUsage} 15 18 | # ${LoadBalancing} 16 19 | # ${MaxDataPartSize} 17 20 | # "01" 18 # ShardNumber 21 | # "01" 19 # ReplicaNumber 22 | # ${ClickHousePkgS3URI} 20 23 | 24 | sudo adduser clickhouse 25 | sudo usermod -G clickhouse clickhouse 26 | 27 | # If one disk only, use root disk 28 | sudo mkdir -p /home/clickhouse/data 29 | 30 | sudo mkdir /home/clickhouse/data/format_schemas/ 31 | sudo mkdir /home/clickhouse/data/access/ 32 | sudo mkdir /home/clickhouse/data/user_files/ 33 | sudo mkdir /home/clickhouse/data/tmp/ 34 | sudo mkdir /home/clickhouse/data/log/ 35 | sudo mkdir /home/clickhouse/data/clickhouse-data/ 36 | 37 | sudo chown -R clickhouse.clickhouse /home/clickhouse/ 38 | rm -rf /var/log/clickhouse-server/ 39 | ln -s /home/clickhouse/data/log/ /var/log/clickhouse-server 40 | 41 | yum install yum-utils 42 | 43 | if [ $1 = 23.3.8.21 ] && [ "${20}" != "none" ]; then 44 | sudo aws s3 sync ${20} ./ --region $4 45 | find clickhouse*.tgz -exec tar -xzvf {} \; 46 | 47 | sudo clickhouse-common-static-$1/install/doinst.sh 48 | pw="" 49 | sudo yum install expect -y 50 | expect -f - <<-EOF 51 | set timeout 10 52 | spawn sudo "clickhouse-server-$1/install/doinst.sh" 53 | expect "*?assword*" 54 | send -- "$pw\r" 55 | expect eof 56 | EOF 57 | sudo "clickhouse-client-$1/install/doinst.sh" 58 | else 59 | sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo 60 | sudo yum install clickhouse-server-$1 clickhouse-client-$1 -y 61 | 62 | if [ ! -d "/etc/clickhouse-server" ]; then 63 | rpm --import https://mirrors.aliyun.com/clickhouse/CLICKHOUSE-KEY.GPG 64 | yum-config-manager --add-repo https://mirrors.aliyun.com/clickhouse/rpm/stable/ 65 | yum install clickhouse-server-$1 clickhouse-client-$1 -y 66 | fi 67 | fi 68 | 69 | echo "" >> /etc/clickhouse-server/metrika.xml 70 | echo "" >> /etc/clickhouse-server/metrika.xml 71 | echo " " >> /etc/clickhouse-server/metrika.xml 72 | echo " " >> /etc/clickhouse-server/metrika.xml 73 | echo " true" >> /etc/clickhouse-server/metrika.xml 74 | echo " " >> /etc/clickhouse-server/metrika.xml 75 | echo " ClickHouseNode1" >> /etc/clickhouse-server/metrika.xml 76 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 77 | echo " default" >> /etc/clickhouse-server/metrika.xml 78 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 79 | echo " " >> /etc/clickhouse-server/metrika.xml 80 | echo " " >> /etc/clickhouse-server/metrika.xml 81 | echo " ClickHouseNode2" >> /etc/clickhouse-server/metrika.xml 82 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 83 | echo " default" >> /etc/clickhouse-server/metrika.xml 84 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 85 | echo " " >> /etc/clickhouse-server/metrika.xml 86 | echo " " >> /etc/clickhouse-server/metrika.xml 87 | if [ $2 -ge 4 ] 88 | then 89 | echo " " >> /etc/clickhouse-server/metrika.xml 90 | echo " true" >> /etc/clickhouse-server/metrika.xml 91 | echo " " >> /etc/clickhouse-server/metrika.xml 92 | echo " ClickHouseNode3" >> /etc/clickhouse-server/metrika.xml 93 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 94 | echo " default" >> /etc/clickhouse-server/metrika.xml 95 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 96 | echo " " >> /etc/clickhouse-server/metrika.xml 97 | echo " " >> /etc/clickhouse-server/metrika.xml 98 | echo " ClickHouseNode4" >> /etc/clickhouse-server/metrika.xml 99 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 100 | echo " default" >> /etc/clickhouse-server/metrika.xml 101 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 102 | echo " " >> /etc/clickhouse-server/metrika.xml 103 | echo " " >> /etc/clickhouse-server/metrika.xml 104 | fi 105 | 106 | if [ $2 -ge 6 ] 107 | then 108 | echo " " >> /etc/clickhouse-server/metrika.xml 109 | echo " true" >> /etc/clickhouse-server/metrika.xml 110 | echo " " >> /etc/clickhouse-server/metrika.xml 111 | echo " ClickHouseNode5" >> /etc/clickhouse-server/metrika.xml 112 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 113 | echo " default" >> /etc/clickhouse-server/metrika.xml 114 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 115 | echo " " >> /etc/clickhouse-server/metrika.xml 116 | echo " " >> /etc/clickhouse-server/metrika.xml 117 | echo " ClickHouseNode6" >> /etc/clickhouse-server/metrika.xml 118 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 119 | echo " default" >> /etc/clickhouse-server/metrika.xml 120 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 121 | echo " " >> /etc/clickhouse-server/metrika.xml 122 | echo " " >> /etc/clickhouse-server/metrika.xml 123 | fi 124 | 125 | if [ $2 -ge 8 ] 126 | then 127 | echo " " >> /etc/clickhouse-server/metrika.xml 128 | echo " true" >> /etc/clickhouse-server/metrika.xml 129 | echo " " >> /etc/clickhouse-server/metrika.xml 130 | echo " ClickHouseNode7" >> /etc/clickhouse-server/metrika.xml 131 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 132 | echo " default" >> /etc/clickhouse-server/metrika.xml 133 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 134 | echo " " >> /etc/clickhouse-server/metrika.xml 135 | echo " " >> /etc/clickhouse-server/metrika.xml 136 | echo " ClickHouseNode8" >> /etc/clickhouse-server/metrika.xml 137 | echo " 9000" >> /etc/clickhouse-server/metrika.xml 138 | echo " default" >> /etc/clickhouse-server/metrika.xml 139 | echo " ${11}" >> /etc/clickhouse-server/metrika.xml 140 | echo " " >> /etc/clickhouse-server/metrika.xml 141 | echo " " >> /etc/clickhouse-server/metrika.xml 142 | fi 143 | 144 | echo " " >> /etc/clickhouse-server/metrika.xml 145 | echo "" >> /etc/clickhouse-server/metrika.xml 146 | echo "" >> /etc/clickhouse-server/metrika.xml 147 | echo " " >> /etc/clickhouse-server/metrika.xml 148 | echo " $8" >> /etc/clickhouse-server/metrika.xml 149 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 150 | echo " " >> /etc/clickhouse-server/metrika.xml 151 | echo " " >> /etc/clickhouse-server/metrika.xml 152 | echo " $9" >> /etc/clickhouse-server/metrika.xml 153 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 154 | echo " " >> /etc/clickhouse-server/metrika.xml 155 | echo " " >> /etc/clickhouse-server/metrika.xml 156 | echo " ${10}" >> /etc/clickhouse-server/metrika.xml 157 | echo " 2181" >> /etc/clickhouse-server/metrika.xml 158 | echo " " >> /etc/clickhouse-server/metrika.xml 159 | echo "" >> /etc/clickhouse-server/metrika.xml 160 | echo "" >> /etc/clickhouse-server/metrika.xml 161 | echo " ::/0" >> /etc/clickhouse-server/metrika.xml 162 | echo "" >> /etc/clickhouse-server/metrika.xml 163 | echo "" >> /etc/clickhouse-server/metrika.xml 164 | echo "" >> /etc/clickhouse-server/metrika.xml 165 | echo " 10000000000" >> /etc/clickhouse-server/metrika.xml 166 | echo " 0.01" >> /etc/clickhouse-server/metrika.xml 167 | echo " lz4" >> /etc/clickhouse-server/metrika.xml 168 | echo "" >> /etc/clickhouse-server/metrika.xml 169 | echo "" >> /etc/clickhouse-server/metrika.xml 170 | echo "" >> /etc/clickhouse-server/metrika.xml 171 | 172 | 173 | flag=600 174 | while((flag > 0)) 175 | do 176 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica01 --region $4` > instancelist-1 177 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-1` 178 | if (( $count >= 1 )) 179 | then 180 | python3 find-clickhouse-node.py instancelist-1 result-1 181 | node1=`sed -n '1p' result-1` 182 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode1|${node1}|g" 183 | break 184 | fi 185 | echo $flag 186 | let flag-- 187 | sleep 1 188 | done 189 | 190 | flag=600 191 | while((flag > 0)) 192 | do 193 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard01-replica02 --region $4` > instancelist-2 194 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-2` 195 | if (( $count >= 1 )) 196 | then 197 | python3 find-clickhouse-node.py instancelist-2 result-2 198 | node2=`sed -n '1p' result-2` 199 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode2|${node2}|g" 200 | break 201 | fi 202 | echo $flag 203 | let flag-- 204 | sleep 1 205 | done 206 | 207 | if (( $2 >= 4)) 208 | then 209 | flag=600 210 | while((flag > 0)) 211 | do 212 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica01 --region $4` > instancelist-3 213 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-3` 214 | if (( $count >= 1 )) 215 | then 216 | python3 find-clickhouse-node.py instancelist-3 result-3 217 | node3=`sed -n '1p' result-3` 218 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode3|${node3}|g" 219 | break 220 | fi 221 | let flag-- 222 | sleep 1 223 | done 224 | 225 | flag=600 226 | while((flag > 0)) 227 | do 228 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard02-replica02 --region $4` > instancelist-4 229 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-4` 230 | if (( $count >= 1 )) 231 | then 232 | python3 find-clickhouse-node.py instancelist-4 result-4 233 | node4=`sed -n '1p' result-4` 234 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode4|${node4}|g" 235 | break 236 | fi 237 | let flag-- 238 | sleep 1 239 | done 240 | fi 241 | 242 | if (( $2 >= 6)) 243 | then 244 | flag=600 245 | while((flag > 0)) 246 | do 247 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica01 --region $4` > instancelist-5 248 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-5` 249 | if (( $count >= 1 )) 250 | then 251 | python3 find-clickhouse-node.py instancelist-5 result-5 252 | node5=`sed -n '1p' result-5` 253 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode5|${node5}|g" 254 | break 255 | fi 256 | let flag-- 257 | sleep 1 258 | done 259 | 260 | flag=600 261 | while((flag > 0)) 262 | do 263 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard03-replica02 --region $4` > instancelist-6 264 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-6` 265 | if (( $count >= 1 )) 266 | then 267 | python3 find-clickhouse-node.py instancelist-6 result-6 268 | node6=`sed -n '1p' result-6` 269 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode6|${node6}|g" 270 | break 271 | fi 272 | let flag-- 273 | sleep 1 274 | done 275 | fi 276 | 277 | if (( $2 >= 8)) 278 | then 279 | flag=600 280 | while((flag > 0)) 281 | do 282 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica01 --region $4` > instancelist-7 283 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-7` 284 | if (( $count >= 1 )) 285 | then 286 | python3 find-clickhouse-node.py instancelist-7 result-7 287 | node7=`sed -n '1p' result-7` 288 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode7|${node7}|g" 289 | break 290 | fi 291 | let flag-- 292 | sleep 1 293 | done 294 | 295 | flag=600 296 | while((flag > 0)) 297 | do 298 | echo `aws ec2 describe-tags --filters Name=key,Values=$3-clickhouse-shard04-replica02 --region $4` > instancelist-8 299 | count=`awk -v RS="@#$j" '{print gsub(/instance/,"&")}' instancelist-8` 300 | if (( $count >= 1 )) 301 | then 302 | python3 find-clickhouse-node.py instancelist-8 result-8 303 | node8=`sed -n '1p' result-8` 304 | find /etc/clickhouse-server/ -name 'metrika.xml' | xargs perl -pi -e "s|ClickHouseNode8|${node8}|g" 305 | break 306 | fi 307 | let flag-- 308 | sleep 1 309 | done 310 | fi 311 | 312 | # if [ $1 = 21.4.5.46-2 ]; then 313 | if [ $1 = 21.4.7.3-2 ]; then 314 | echo "Update the config.xml of $1" 315 | sed -i '508, 617d' /etc/clickhouse-server/config.xml 316 | # elif [ $1 = 21.5.5.12-2 ]; then 317 | elif [ $1 = 21.5.9.4-2 ]; then 318 | echo "Update the config.xml of $1" 319 | sed -i '520, 630d' /etc/clickhouse-server/config.xml 320 | elif [ $1 = 23.3.8.21 ]; then 321 | echo "Update the config.xml of $1" 322 | sed -i '783, 970d' /etc/clickhouse-server/config.xml 323 | fi 324 | 325 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e 's||/etc/clickhouse-server/metrika.xml|g' 326 | 327 | #find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e 's||/etc/clickhouse-server/metrika.xml|g' 328 | 329 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|trace|information|g" 330 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/log/clickhouse-server/clickhouse-server.log|/home/clickhouse/data/log/clickhouse-server.log|g" 331 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/log/clickhouse-server/clickhouse-server.err.log|/home/clickhouse/data/log/clickhouse-server.err.log|g" 332 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/lib/clickhouse/|/home/clickhouse/data/clickhouse-data/|g" 333 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s|/var/lib/clickhouse/|/home/clickhouse/data/|g" 334 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s||$7|g" 335 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s||0.0.0.0|g" 336 | find /etc/clickhouse-server/ -name 'config.xml' | xargs perl -pi -e "s||/etc/pki/tls/certs/ca-bundle.crt|g" 337 | 338 | find /etc/clickhouse-server/ -name 'users.xml' | xargs perl -pi -e "s||${11}|g" 339 | sudo sed -i "9a ${12}" /etc/clickhouse-server/users.xml 340 | sudo sed -i "9a ${13}" /etc/clickhouse-server/users.xml 341 | sudo sed -i "9a ${14}" /etc/clickhouse-server/users.xml 342 | sudo sed -i "s|10000000000|${15}|" /etc/clickhouse-server/users.xml 343 | sudo sed -i "s|random|${16}|" /etc/clickhouse-server/users.xml 344 | sudo sed -i 's||1|' /etc/clickhouse-server/users.xml 345 | 346 | 347 | echo "" >> /etc/clickhouse-server/config.d/storage.xml 348 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 349 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 350 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 351 | echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 352 | echo " $5" >> /etc/clickhouse-server/config.d/storage.xml 353 | echo " true" >> /etc/clickhouse-server/config.d/storage.xml 354 | echo " 10000" >> /etc/clickhouse-server/config.d/storage.xml 355 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 356 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 357 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 358 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 359 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 360 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 361 | #echo " default" >> /etc/clickhouse-server/config.d/storage.xml 362 | #echo " ${17}" >> /etc/clickhouse-server/config.d/storage.xml 363 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 364 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 365 | #echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 366 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 367 | #echo " " >> /etc/clickhouse-server/config.d/storage.xml 368 | #echo " $6" >> /etc/clickhouse-server/config.d/storage.xml 369 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 370 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 371 | echo " default" >> /etc/clickhouse-server/config.d/storage.xml 372 | echo " ${17}" >> /etc/clickhouse-server/config.d/storage.xml 373 | echo " false" >> /etc/clickhouse-server/config.d/storage.xml 374 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 375 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 376 | echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 377 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 378 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 379 | echo " ${6}" >> /etc/clickhouse-server/config.d/storage.xml 380 | 381 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 382 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 383 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 384 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 385 | echo " s3" >> /etc/clickhouse-server/config.d/storage.xml 386 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 387 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 388 | echo " " >> /etc/clickhouse-server/config.d/storage.xml 389 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 390 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 391 | echo "
" >> /etc/clickhouse-server/config.d/storage.xml 392 | 393 | echo "" >> /etc/clickhouse-server/config.d/macros.xml 394 | echo " " >> /etc/clickhouse-server/config.d/macros.xml 395 | echo " cluster01-${18}-${19}" >> /etc/clickhouse-server/config.d/macros.xml 396 | echo " ${18}" >> /etc/clickhouse-server/config.d/macros.xml 397 | echo " 01" >> /etc/clickhouse-server/config.d/macros.xml 398 | echo " " >> /etc/clickhouse-server/config.d/macros.xml 399 | echo "" >> /etc/clickhouse-server/config.d/macros.xml 400 | 401 | chown -R clickhouse.clickhouse /home/clickhouse/ 402 | chown -R clickhouse.clickhouse /etc/clickhouse-server/ 403 | 404 | echo "* soft nofile 65536" >> /etc/security/limits.conf 405 | echo "* hard nofile 65536" >> /etc/security/limits.conf 406 | echo "* soft nproc 131072" >> /etc/security/limits.conf 407 | echo "* hard nproc 131072" >> /etc/security/limits.conf 408 | 409 | systemctl stop clickhouse-server 410 | systemctl start clickhouse-server 411 | systemctl status clickhouse-server 412 | 413 | # Restart ClickHouse 414 | sleep 5 415 | systemctl stop clickhouse-server 416 | systemctl start clickhouse-server 417 | systemctl status clickhouse-server 418 | sleep 1 -------------------------------------------------------------------------------- /scripts/create-table-demo.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `ontime_replica` 2 | ( 3 | `Year` UInt16, 4 | `Quarter` UInt8, 5 | `Month` UInt8, 6 | `DayofMonth` UInt8, 7 | `DayOfWeek` UInt8, 8 | `FlightDate` Date, 9 | `Reporting_Airline` String, 10 | `DOT_ID_Reporting_Airline` Int32, 11 | `IATA_CODE_Reporting_Airline` String, 12 | `Tail_Number` Int32, 13 | `Flight_Number_Reporting_Airline` String, 14 | `OriginAirportID` Int32, 15 | `OriginAirportSeqID` Int32, 16 | `OriginCityMarketID` Int32, 17 | `Origin` FixedString(5), 18 | `OriginCityName` String, 19 | `OriginState` FixedString(2), 20 | `OriginStateFips` String, 21 | `OriginStateName` String, 22 | `OriginWac` Int32, 23 | `DestAirportID` Int32, 24 | `DestAirportSeqID` Int32, 25 | `DestCityMarketID` Int32, 26 | `Dest` FixedString(5), 27 | `DestCityName` String, 28 | `DestState` FixedString(2), 29 | `DestStateFips` String, 30 | `DestStateName` String, 31 | `DestWac` Int32, 32 | `CRSDepTime` Int32, 33 | `DepTime` Int32, 34 | `DepDelay` Int32, 35 | `DepDelayMinutes` Int32, 36 | `DepDel15` Int32, 37 | `DepartureDelayGroups` String, 38 | `DepTimeBlk` String, 39 | `TaxiOut` Int32, 40 | `WheelsOff` Int32, 41 | `WheelsOn` Int32, 42 | `TaxiIn` Int32, 43 | `CRSArrTime` Int32, 44 | `ArrTime` Int32, 45 | `ArrDelay` Int32, 46 | `ArrDelayMinutes` Int32, 47 | `ArrDel15` Int32, 48 | `ArrivalDelayGroups` Int32, 49 | `ArrTimeBlk` String, 50 | `Cancelled` UInt8, 51 | `CancellationCode` FixedString(1), 52 | `Diverted` UInt8, 53 | `CRSElapsedTime` Int32, 54 | `ActualElapsedTime` Int32, 55 | `AirTime` Nullable(Int32), 56 | `Flights` Int32, 57 | `Distance` Int32, 58 | `DistanceGroup` UInt8, 59 | `CarrierDelay` Int32, 60 | `WeatherDelay` Int32, 61 | `NASDelay` Int32, 62 | `SecurityDelay` Int32, 63 | `LateAircraftDelay` Int32, 64 | `FirstDepTime` String, 65 | `TotalAddGTime` String, 66 | `LongestAddGTime` String, 67 | `DivAirportLandings` String, 68 | `DivReachedDest` String, 69 | `DivActualElapsedTime` String, 70 | `DivArrDelay` String, 71 | `DivDistance` String, 72 | `Div1Airport` String, 73 | `Div1AirportID` Int32, 74 | `Div1AirportSeqID` Int32, 75 | `Div1WheelsOn` String, 76 | `Div1TotalGTime` String, 77 | `Div1LongestGTime` String, 78 | `Div1WheelsOff` String, 79 | `Div1TailNum` String, 80 | `Div2Airport` String, 81 | `Div2AirportID` Int32, 82 | `Div2AirportSeqID` Int32, 83 | `Div2WheelsOn` String, 84 | `Div2TotalGTime` String, 85 | `Div2LongestGTime` String, 86 | `Div2WheelsOff` String, 87 | `Div2TailNum` String, 88 | `Div3Airport` String, 89 | `Div3AirportID` Int32, 90 | `Div3AirportSeqID` Int32, 91 | `Div3WheelsOn` String, 92 | `Div3TotalGTime` String, 93 | `Div3LongestGTime` String, 94 | `Div3WheelsOff` String, 95 | `Div3TailNum` String, 96 | `Div4Airport` String, 97 | `Div4AirportID` Int32, 98 | `Div4AirportSeqID` Int32, 99 | `Div4WheelsOn` String, 100 | `Div4TotalGTime` String, 101 | `Div4LongestGTime` String, 102 | `Div4WheelsOff` String, 103 | `Div4TailNum` String, 104 | `Div5Airport` String, 105 | `Div5AirportID` Int32, 106 | `Div5AirportSeqID` Int32, 107 | `Div5WheelsOn` String, 108 | `Div5TotalGTime` String, 109 | `Div5LongestGTime` String, 110 | `Div5WheelsOff` String, 111 | `Div5TailNum` String 112 | ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/ontime', '{replica}') 113 | PARTITION BY Year 114 | ORDER BY (IATA_CODE_Reporting_Airline, FlightDate) 115 | SETTINGS storage_policy = 'tiered', index_granularity = 8192; 116 | 117 | CREATE TABLE IF NOT EXISTS ontime as ontime_replica 118 | ENGINE = Distributed(quickstart_clickhouse_cluster, default, ontime_replica, rand()); 119 | -------------------------------------------------------------------------------- /scripts/downloaddata.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | rm -f list_urls.txt 3 | 4 | for s in `seq ontimefrom ontimeto` 5 | do 6 | for m in `seq 1 12` 7 | do 8 | echo "https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_${s}_${m}.zip" >> list_urls.txt 9 | done 10 | done 11 | 12 | mywget() 13 | { 14 | wget -t 3 -c -S "$1" --no-check-certificate 15 | } 16 | 17 | export -f mywget 18 | 19 | # run wget in parallel using 5 thread/connection 20 | xargs -P 5 -n 1 -I {} bash -c "mywget '{}'" < list_urls.txt -------------------------------------------------------------------------------- /scripts/find-clickhouse-node.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | jsonfile = sys.argv[1] 4 | instancefile = sys.argv[2] 5 | 6 | with open(jsonfile,'r') as f: 7 | s1 = json.load(f) 8 | with open(instancefile, 'w') as f: 9 | for item in s1["Tags"][0:]: 10 | f.write(item["Value"]+"\n") -------------------------------------------------------------------------------- /scripts/find-secret.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | jsonfile = sys.argv[1] 4 | 5 | with open(jsonfile,'r') as f: 6 | s1 = json.load(f) 7 | s2 = s1["SecretString"] 8 | s3 = eval(s2) 9 | print(s3["password"]) -------------------------------------------------------------------------------- /scripts/find-zookeeper-node.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | jsonfile = sys.argv[1] 4 | instancefile = sys.argv[2] 5 | 6 | with open(jsonfile,'r') as f: 7 | s1 = json.load(f) 8 | with open(instancefile, 'w') as f: 9 | for item in s1["Tags"][0:]: 10 | f.write(item["Value"]+"\n") -------------------------------------------------------------------------------- /scripts/zookeeper-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ${ZookeeperVersion} 1 4 | 5 | #wget -P ./ -T 60 https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/8/jdk/x64/linux/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz 6 | wget -P ./ -T 60 https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz 7 | tar -xvf /home/ec2-user/jdk-8u202-linux-x64.tar.gz 8 | sudo ln -s /home/ec2-user/jdk1.8.0_202/bin/java /usr/local/bin/java 9 | sudo ln -s /home/ec2-user/jdk1.8.0_202/bin/java /usr/bin/java 10 | if [ ! -d "/home/ec2-user/jdk1.8.0_202" ]; then 11 | rm -rf /usr/local/bin/java 12 | rm -rf /usr/bin/java 13 | wget -P ./ -T 60 https://download.java.net/openjdk/jdk8u41/ri/openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz 14 | tar -xvf /home/ec2-user/openjdk-8u41-b04-linux-x64-14_jan_2020.tar.gz 15 | sudo ln -s /home/ec2-user/java-se-8u41-ri/bin/java /usr/local/bin/java 16 | sudo ln -s /home/ec2-user/java-se-8u41-ri/bin/java /usr/bin/java 17 | fi 18 | 19 | # Avoid deployment issues caused by the version of Zookeeper's frequent changes. 20 | wget -P ./ -T 60 http://archive.apache.org/dist/zookeeper/zookeeper-${1}/apache-zookeeper-${1}-bin.tar.gz 21 | tar -xvf /home/ec2-user/apache-zookeeper-${1}-bin.tar.gz -C /usr/local/ 22 | if [ ! -d "/usr/local/apache-zookeeper-${1}-bin" ]; then 23 | wget -P ./ -T 60 http://archive.apache.org/dist/zookeeper/zookeeper-${1}/apache-zookeeper-${1}-bin.tar.gz 24 | tar -xvf /home/ec2-user/apache-zookeeper-${1}-bin.tar.gz -C /usr/local/ 25 | fi 26 | 27 | echo "export JAVA_HOME=/usr/local/java" >> ~/.bashrc 28 | echo "export JRE_HOME=${JAVA_HOME}/jre" >> ~/.bashrc 29 | echo "export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib" >> ~/.bashrc 30 | echo "export PATH=${JAVA_HOME}/bin:$PATH" >> ~/.bashrc 31 | echo "export ZOOKEEPER_HOME=/usr/local/apache-zookeeper-${1}-bin" >> ~/.bashrc 32 | echo "export PATH=$PATH:$ZOOKEEPER_HOME/bin" >> ~/.bashrc 33 | echo "source /etc/profile" >> ~/.bashrc 34 | 35 | echo "tickTime=2000" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 36 | echo "initLimit=30000" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 37 | echo "syncLimit=10" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 38 | echo "maxClientCnxns=2000" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 39 | echo "maxSessionTimeout=60000000" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 40 | echo "dataDir=/data/zookeeper/data" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 41 | echo "dataLogDir=/data/zookeeper/logs" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 42 | echo "autopurge.snapRetainCount=10" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 43 | echo "autopurge.purgeInterval=1" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 44 | echo "preAllocSize=131072" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 45 | echo "snapCount=3000000" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 46 | echo "clientPort=2181" >> /usr/local/apache-zookeeper-${1}-bin/conf/zoo.cfg 47 | 48 | echo "* soft nofile 65536" >> /etc/security/limits.conf 49 | echo "* hard nofile 65536" >> /etc/security/limits.conf 50 | echo "* soft nproc 131072" >> /etc/security/limits.conf 51 | echo "* hard nproc 131072" >> /etc/security/limits.conf -------------------------------------------------------------------------------- /templates/nlb.template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | Description: This stack deploys NLB for ClickHouse cluster. (qs-1s4ldl6sl) 3 | 4 | Metadata: 5 | LICENSE: Apache License Version 2.0 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - Label: 9 | default: Network configuration 10 | Parameters: 11 | - VPCID 12 | - Subnets 13 | - NodeCount 14 | - Port 15 | - EC2Instance1 16 | - EC2Instance2 17 | - EC2Instance3 18 | - EC2Instance4 19 | ParameterLabels: 20 | VPCID: 21 | default: VPC ID 22 | Subnets: 23 | default: Subnets 24 | NodeCount: 25 | default: Node count 26 | Port: 27 | default: Service port 28 | EC2Instance1: 29 | default: EC2 instance id 1 30 | EC2Instance2: 31 | default: EC2 instance id 2 32 | EC2Instance3: 33 | default: EC2 instance id 3 34 | EC2Instance4: 35 | default: EC2 instance id 4 36 | Parameters: 37 | VPCID: 38 | Description: VPC in which ELB will be placed. 39 | Type: AWS::EC2::VPC::Id 40 | Subnets: 41 | Type: List 42 | Description: Subnets in which ELB will be created. Select all AZs/Subnet. 43 | NodeCount: 44 | Type: String 45 | Description: Node count. 46 | Default: 2 47 | Port: 48 | Type: String 49 | Description: Service port. 50 | Default: 8123 51 | EC2Instance1: 52 | Type: String 53 | Description: Choose EC2 instance. 54 | Default: 1 55 | EC2Instance2: 56 | Type: String 57 | Description: Choose EC2 instance. 58 | Default: 2 59 | EC2Instance3: 60 | Type: String 61 | Description: Choose EC2 instance. 62 | Default: 3 63 | EC2Instance4: 64 | Type: String 65 | Description: Choose EC2 instance. 66 | Default: 4 67 | Conditions: 68 | 2NodesCondition: !Equals [!Ref 'NodeCount', '2'] 69 | 4NodesCondition: !Equals [!Ref 'NodeCount', '4'] 70 | 6NodesCondition: !Equals [!Ref 'NodeCount', '6'] 71 | 8NodesCondition: !Equals [!Ref 'NodeCount', '8'] 72 | Resources: 73 | ServiceLoadBalancerPrivate: 74 | Type: AWS::ElasticLoadBalancingV2::LoadBalancer 75 | Properties: 76 | Name: !Sub ${VPCID}-Nlb 77 | Scheme: internal 78 | Subnets: !Ref Subnets 79 | Type: network 80 | IpAddressType: ipv4 81 | LoadBalancerAttributes: 82 | - Key: load_balancing.cross_zone.enabled 83 | Value: "true" 84 | Tags: 85 | - Key: Name 86 | Value: !Sub ${VPCID}-Nlb 87 | # A default target group is used to setup the Nlb to just drop traffic 88 | # initially, before any real service target groups have been added. 89 | NetworkLoadBalancerTargetGroup2Nodes: 90 | Condition: 2NodesCondition 91 | Type: AWS::ElasticLoadBalancingV2::TargetGroup 92 | Properties: 93 | Name: !Sub ${VPCID}-Nlb-target 94 | Port: !Ref Port 95 | Protocol: TCP 96 | VpcId: !Ref VPCID 97 | Targets: 98 | - Id: !Ref EC2Instance1 99 | Port: !Ref Port 100 | ServiceLoadBalancerListener2Nodes: 101 | Condition: 2NodesCondition 102 | Type: AWS::ElasticLoadBalancingV2::Listener 103 | Properties: 104 | LoadBalancerArn: !Ref ServiceLoadBalancerPrivate 105 | Port: !Ref Port 106 | Protocol: TCP 107 | DefaultActions: 108 | - Type: forward 109 | TargetGroupArn: !Ref NetworkLoadBalancerTargetGroup2Nodes 110 | NetworkLoadBalancerTargetGroup4Nodes: 111 | Condition: 4NodesCondition 112 | Type: AWS::ElasticLoadBalancingV2::TargetGroup 113 | Properties: 114 | Name: !Sub ${VPCID}-Nlb-target 115 | Port: !Ref Port 116 | Protocol: TCP 117 | VpcId: !Ref VPCID 118 | Targets: 119 | - Id: !Ref EC2Instance1 120 | Port: !Ref Port 121 | - Id: !Ref EC2Instance2 122 | Port: !Ref Port 123 | ServiceLoadBalancerListener4Nodes: 124 | Condition: 4NodesCondition 125 | Type: AWS::ElasticLoadBalancingV2::Listener 126 | Properties: 127 | LoadBalancerArn: !Ref ServiceLoadBalancerPrivate 128 | Port: !Ref Port 129 | Protocol: TCP 130 | DefaultActions: 131 | - Type: forward 132 | TargetGroupArn: !Ref NetworkLoadBalancerTargetGroup4Nodes 133 | NetworkLoadBalancerTargetGroup6Nodes: 134 | Condition: 6NodesCondition 135 | Type: AWS::ElasticLoadBalancingV2::TargetGroup 136 | Properties: 137 | Name: !Sub ${VPCID}-Nlb-target 138 | Port: !Ref Port 139 | Protocol: TCP 140 | VpcId: !Ref VPCID 141 | Targets: 142 | - Id: !Ref EC2Instance1 143 | Port: !Ref Port 144 | - Id: !Ref EC2Instance2 145 | Port: !Ref Port 146 | - Id: !Ref EC2Instance3 147 | Port: !Ref Port 148 | ServiceLoadBalancerListener6Nodes: 149 | Condition: 6NodesCondition 150 | Type: AWS::ElasticLoadBalancingV2::Listener 151 | Properties: 152 | LoadBalancerArn: !Ref ServiceLoadBalancerPrivate 153 | Port: !Ref Port 154 | Protocol: TCP 155 | DefaultActions: 156 | - Type: forward 157 | TargetGroupArn: !Ref NetworkLoadBalancerTargetGroup6Nodes 158 | NetworkLoadBalancerTargetGroup8Nodes: 159 | Condition: 8NodesCondition 160 | Type: AWS::ElasticLoadBalancingV2::TargetGroup 161 | Properties: 162 | Name: !Sub ${VPCID}-Nlb-target 163 | Port: !Ref Port 164 | Protocol: TCP 165 | VpcId: !Ref VPCID 166 | Targets: 167 | - Id: !Ref EC2Instance1 168 | Port: !Ref Port 169 | - Id: !Ref EC2Instance2 170 | Port: !Ref Port 171 | - Id: !Ref EC2Instance3 172 | Port: !Ref Port 173 | - Id: !Ref EC2Instance4 174 | Port: !Ref Port 175 | ServiceLoadBalancerListener8Nodes: 176 | Condition: 8NodesCondition 177 | Type: AWS::ElasticLoadBalancingV2::Listener 178 | Properties: 179 | LoadBalancerArn: !Ref ServiceLoadBalancerPrivate 180 | Port: !Ref Port 181 | Protocol: TCP 182 | DefaultActions: 183 | - Type: forward 184 | TargetGroupArn: !Ref NetworkLoadBalancerTargetGroup8Nodes 185 | Outputs: 186 | ElbDNSName: 187 | Value: !GetAtt ServiceLoadBalancerPrivate.DNSName -------------------------------------------------------------------------------- /templates/securitygroups.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: 2010-09-09 3 | Description: This template is used for setting up Security Groups. (qs-1s4ldl6ta) 4 | 5 | Metadata: 6 | LICENSE: Apache License Version 2.0 7 | AWS::CloudFormation::Interface: 8 | ParameterGroups: 9 | - Label: 10 | default: Network configuration 11 | Parameters: 12 | - AccessCIDR 13 | - VPCID 14 | - VPCCIDR 15 | - BastionSecurityGroupID 16 | ParameterLabels: 17 | AccessCIDR: 18 | default: Access CIDR 19 | VPCID: 20 | default: VPC ID 21 | VPCCIDR: 22 | default: VPC CIDR 23 | BastionSecurityGroupID: 24 | default: Bastion security group ID 25 | Parameters: 26 | AccessCIDR: 27 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$ 28 | ConstraintDescription: Must be a valid IP range in the form x.x.x.x/x. 29 | Description: 'CIDR IP range permitted for access. A value of 30 | 0.0.0.0/0 allows access from any IP address.' 31 | Type: String 32 | VPCID: 33 | Description: VPC ID of your existing Virtual Private Cloud (VPC) where you want. 34 | to depoy RDS. 35 | Type: AWS::EC2::VPC::Id 36 | VPCCIDR: 37 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$ 38 | ConstraintDescription: Must be a valid IP range in the form x.x.x.x/x. 39 | Description: The CIDR block for VPC. 40 | Type: String 41 | BastionSecurityGroupID: 42 | Description: The BastionSecurityGroupID range that is permitted to access. 43 | Type: String 44 | Conditions: 45 | IsChinaRegion: !Or 46 | - !Equals 47 | - !Ref 'AWS::Region' 48 | - cn-north-1 49 | - !Equals 50 | - !Ref 'AWS::Region' 51 | - cn-northwest-1 52 | IsNotChinaRegion: !Not 53 | - !Or 54 | - !Equals 55 | - !Ref 'AWS::Region' 56 | - cn-north-1 57 | - !Equals 58 | - !Ref 'AWS::Region' 59 | - cn-northwest-1 60 | Resources: 61 | ClickHouseServerSecurityGroup: 62 | Type: AWS::EC2::SecurityGroup 63 | Condition: IsNotChinaRegion 64 | Properties: 65 | GroupDescription: Allow access to ClickHouse port. 66 | VpcId: !Ref VPCID 67 | SecurityGroupIngress: 68 | - IpProtocol: tcp 69 | FromPort: 2181 70 | ToPort: 2181 71 | CidrIp: !Ref VPCCIDR 72 | - IpProtocol: tcp 73 | FromPort: 2888 74 | ToPort: 2888 75 | CidrIp: !Ref VPCCIDR 76 | - IpProtocol: tcp 77 | FromPort: 3888 78 | ToPort: 3888 79 | CidrIp: !Ref VPCCIDR 80 | - IpProtocol: tcp 81 | FromPort: 9000 82 | ToPort: 9000 83 | CidrIp: !Ref VPCCIDR 84 | - IpProtocol: tcp 85 | FromPort: 9009 86 | ToPort: 9009 87 | CidrIp: !Ref VPCCIDR 88 | - IpProtocol: tcp 89 | FromPort: 8123 90 | ToPort: 8123 91 | CidrIp: !Ref VPCCIDR 92 | - IpProtocol: tcp 93 | FromPort: 9116 94 | ToPort: 9116 95 | CidrIp: !Ref VPCCIDR 96 | - IpProtocol: tcp 97 | FromPort: 9100 98 | ToPort: 9100 99 | CidrIp: !Ref VPCCIDR 100 | - IpProtocol: tcp 101 | FromPort: 22 102 | ToPort: 22 103 | SourceSecurityGroupId: !Ref BastionSecurityGroupID 104 | SecurityGroupEgress: 105 | - IpProtocol: tcp 106 | FromPort: 0 107 | ToPort: 65535 108 | CidrIp: 0.0.0.0/0 109 | AdminServerSecurityGroup: 110 | Type: AWS::EC2::SecurityGroup 111 | Condition: IsNotChinaRegion 112 | Properties: 113 | GroupDescription: App server security group. 114 | VpcId: !Ref VPCID 115 | SecurityGroupIngress: 116 | - IpProtocol: tcp 117 | FromPort: 22 118 | ToPort: 22 119 | SourceSecurityGroupId: !Ref BastionSecurityGroupID 120 | - IpProtocol: tcp 121 | FromPort: 9090 122 | ToPort: 9090 123 | CidrIp: !Ref AccessCIDR 124 | - IpProtocol: tcp 125 | FromPort: 3000 126 | ToPort: 3000 127 | CidrIp: !Ref AccessCIDR 128 | SecurityGroupEgress: 129 | - IpProtocol: tcp 130 | FromPort: 0 131 | ToPort: 65535 132 | CidrIp: 0.0.0.0/0 133 | ClickHouseServerSecurityGroupCN: 134 | Type: AWS::EC2::SecurityGroup 135 | Condition: IsChinaRegion 136 | Properties: 137 | GroupDescription: Allow access to ClickHouse port. 138 | VpcId: !Ref VPCID 139 | SecurityGroupIngress: 140 | - IpProtocol: tcp 141 | FromPort: 2181 142 | ToPort: 2181 143 | CidrIp: !Ref VPCCIDR 144 | - IpProtocol: tcp 145 | FromPort: 2888 146 | ToPort: 2888 147 | CidrIp: !Ref VPCCIDR 148 | - IpProtocol: tcp 149 | FromPort: 3888 150 | ToPort: 3888 151 | CidrIp: !Ref VPCCIDR 152 | - IpProtocol: tcp 153 | FromPort: 9000 154 | ToPort: 9000 155 | CidrIp: !Ref VPCCIDR 156 | - IpProtocol: tcp 157 | FromPort: 9009 158 | ToPort: 9009 159 | CidrIp: !Ref VPCCIDR 160 | - IpProtocol: tcp 161 | FromPort: 8123 162 | ToPort: 8123 163 | CidrIp: !Ref VPCCIDR 164 | - IpProtocol: tcp 165 | FromPort: 9116 166 | ToPort: 9116 167 | CidrIp: !Ref VPCCIDR 168 | - IpProtocol: tcp 169 | FromPort: 9100 170 | ToPort: 9100 171 | CidrIp: !Ref VPCCIDR 172 | - IpProtocol: tcp 173 | FromPort: 22 174 | ToPort: 22 175 | SecurityGroupEgress: 176 | - IpProtocol: tcp 177 | FromPort: 0 178 | ToPort: 65535 179 | CidrIp: 0.0.0.0/0 180 | AdminServerSecurityGroupCN: 181 | Type: AWS::EC2::SecurityGroup 182 | Condition: IsChinaRegion 183 | Properties: 184 | GroupDescription: App server security group. 185 | VpcId: !Ref VPCID 186 | SecurityGroupIngress: 187 | - IpProtocol: tcp 188 | FromPort: 22 189 | ToPort: 22 190 | - IpProtocol: tcp 191 | FromPort: 9090 192 | ToPort: 9090 193 | CidrIp: !Ref AccessCIDR 194 | - IpProtocol: tcp 195 | FromPort: 3000 196 | ToPort: 3000 197 | CidrIp: !Ref AccessCIDR 198 | SecurityGroupEgress: 199 | - IpProtocol: tcp 200 | FromPort: 0 201 | ToPort: 65535 202 | CidrIp: 0.0.0.0/0 203 | Outputs: 204 | ClickHouseServerSecurityGroup: 205 | Description: ClickHouse Security Group 206 | Value: !If [IsNotChinaRegion, !Ref ClickHouseServerSecurityGroup, !Ref ClickHouseServerSecurityGroupCN] 207 | AdminServerSecurityGroup: 208 | Description: Admin Server Security Group 209 | Value: !If [IsNotChinaRegion, !Ref AdminServerSecurityGroup, !Ref AdminServerSecurityGroupCN] 210 | --------------------------------------------------------------------------------