├── LICENSE.md ├── README.md ├── images ├── deploy-to-cloud.png ├── minio-cluster-installation.png ├── minio-logo-70x70.png ├── minio-nfs-topology.png ├── minio-s3-cluster.png └── virtuozzo-minio-s3-storage-container.png ├── manifest.jps ├── nfs-volume-based ├── README.md ├── manifest.jps └── mount-volumes.js ├── scripts ├── build-cluster.js └── deployHook.js └── text └── success.md /LICENSE.md: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MinIO Cluster 2 | 3 | The **MinIO Cluster** solution by Virtuozzo Application Platform automates creation of a scalable and cost-efficient object storage, which is fully compatible with the Amazon S3 (_Simple Storage Service_). The package utilizes [MinIO](https://www.minio.io/) microstorage architecture to interconnect a number of separate Docker containers to create a reliable cluster. 4 | 5 |  6 | 7 | Refer to the appropriate [MinIO Cluster article](https://www.virtuozzo.com/company/blog/s3-minio-cloud-storage-cluster-in-containers/) to get a detailed overview of this solution. 8 | 9 | ## MinIO Cluster Installation 10 | 11 | Log into your Virtuozzo Application Platform account and [import](https://www.virtuozzo.com/application-platform-docs/environment-import/) link to the _**manifest.jps**_ file from above. 12 | 13 |  14 | 15 | > **Note:** Alternatively, you can find this solution within platform [Marketplace](https://www.virtuozzo.com/application-platform-docs/marketplace/) or use the following button to automatically register on one of the [public Platforms](https://www.virtuozzo.com/application-platform-partners/) and immediately initiate MinIO Cluster installation: 16 | > 17 | > [](https://www.virtuozzo.com/install/?manifest=https://raw.githubusercontent.com/jelastic-jps/minio/master/manifest.jps&min-version=4.6) 18 | 19 | Within the appeared form, you need to fetch the next data: 20 | * **Number of nodes** - specify the required cluster size by choosing among the predefined options to create 1 (for development), 4, 8 or 16 MinIO nodes - each of them will be handled in a separate container, which are distributed across available hardware servers to gain [high availability](https://www.virtuozzo.com/application-platform-docs/isolated-containers/#high-availability-for-applications) 21 | * **Environment** - type in the preferred name for your MinIO storage cluster (which, together with your platform domain, will constitute an internal environment name) 22 | * **Display Name** - optionally, add an [alias name](https://www.virtuozzo.com/application-platform-docs/environment-aliases/) to be displayed for the environment in the dashboard 23 | * **Region** - select a [hardware set](https://www.virtuozzo.com/application-platform-docs/environment-regions/) for your environment to be hosted (this option is active only if several regions are available) 24 | 25 | Click **Install** and in a few minutes your automatically configured storage will be created. 26 | 27 | ## Working with MinIO Cluster 28 | 29 | Immediately after the solution installation, you can start working with your storage cluster: 30 | 31 | * _**user-friendly web interface**_ - to manage your MinIO storage directly in browser; the admin panel access URL and credentials are provided via the appropriate email notification 32 | 33 | * _**minio client**_ - to work over the dedicated [command line interface](https://www.minio.io/downloads.html#download-client); refer to the [official documentation](https://docs.minio.io/docs/minio-client-complete-guide) for more information on the tool 34 | -------------------------------------------------------------------------------- /images/deploy-to-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/deploy-to-cloud.png -------------------------------------------------------------------------------- /images/minio-cluster-installation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/minio-cluster-installation.png -------------------------------------------------------------------------------- /images/minio-logo-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/minio-logo-70x70.png -------------------------------------------------------------------------------- /images/minio-nfs-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/minio-nfs-topology.png -------------------------------------------------------------------------------- /images/minio-s3-cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/minio-s3-cluster.png -------------------------------------------------------------------------------- /images/virtuozzo-minio-s3-storage-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelastic-jps/minio/117ea838835348a737ed8fdef244e57fb6fe93af/images/virtuozzo-minio-s3-storage-container.png -------------------------------------------------------------------------------- /manifest.jps: -------------------------------------------------------------------------------- 1 | type: install 2 | version: 1.5 3 | id: minio 4 | name: MinIO Cluster 5 | homepage: https://github.com/jelastic-jps/minio 6 | baseUrl: https://raw.githubusercontent.com/jelastic-jps/minio/master 7 | logo: images/minio-logo-70x70.png 8 | 9 | categories: [ apps/file-manager ] 10 | description: 11 | text: | 12 | MinIO is an object storage server, compatible with Amazon S3 cloud storage 13 | service, best suited for storing unstructured data such as photos, videos, log 14 | files and backups. 15 | short: | 16 | Automated clusterization for a reliable and cost-effective MinIO storage 17 | to keep your unstructured data in a cloud. 18 | 19 | globals: 20 | accessKey: ${fn.password} 21 | secretKey: ${fn.password} 22 | port: 80 23 | consolePort: 4949 24 | exportPath: /export 25 | DEPLOY_HOOK: /root/deployLE.sh 26 | UNDEPLOY_HOOK: /root/undeployLE.sh 27 | DEPLOY_HOOK_JS: ${baseUrl}/scripts/deployHook.js 28 | BUILD_SCRIPT: ${baseUrl}/scripts/build-cluster.js 29 | 30 | onBeforeInit: | 31 | function compareVersions(a, b) {a = a.split('.'), b = b.split('.'); for (var i = 0, l = Math.max(a.length, b.length); i < l; i++) {x = parseInt(a[i], 10) || 0; y = parseInt(b[i], 10) || 0; if (x != y) return x > y ? 1:-1 }; return 0;} 32 | var settings = jps.settings; 33 | var fields = settings.fields; 34 | version = jelastic.system.service.GetVersion().version.split('-').shift() 35 | if (compareVersions(version, '8.3') == -1) { 36 | settings.fields.push({type:'string', caption:'Image', hidden:true, name:'image', value:'jelastic/minio:RELEASE.2023-02-27T18-10-45Z'}) 37 | } else { 38 | if ("${quota.environment.externalip.enabled}" == 0) { 39 | settings.fields = fields.filter(function(item) { return item.name != "le-addon" }); 40 | } 41 | settings.fields.push({type:'string', caption:'Image', hidden:true, name:'image', value:'jelastic/minio:RELEASE.2024-08-29T01-40-52Z-almalinux-9'}); 42 | settings.fields.push({type:'checkbox', caption:'Install Let\'s Encrypt Certificates and Custom Domains Addon. Public IP is required.', name:'le-addon', value:true}); 43 | } 44 | return { result: 0, settings: settings }; 45 | 46 | settings: 47 | fields: 48 | - name: nodes 49 | caption: Number of nodes 50 | type: list 51 | inputType: string 52 | values: 53 | 1: 1 node 54 | 4: 4 nodes 55 | 8: 8 nodes 56 | 16: 16 nodes 57 | default: 4 58 | required: true 59 | 60 | nodes: 61 | count: ${settings.nodes} 62 | cloudlets: 16 63 | nodeGroup: cp 64 | image: ${settings.image} 65 | password: ${globals.secretKey} 66 | skipNodeEmails: true 67 | validation: 68 | maxCount: ${settings.nodes} 69 | minCount: ${settings.nodes} 70 | 71 | onBeforeChangeTopology: 72 | - script: |- 73 | var state = ${event.params.env}.sslstate; 74 | return {result: 0, state: state} 75 | - if (${response.state}): 76 | - stopEvent: 77 | type: warning 78 | message: Built-in SSL is not allowed for this environment. 79 | 80 | onAfterChangeTopology: 81 | - if (${event.response.response.env.sslstate}): 82 | cmd[cp]: nft insert rule ip nat PREROUTING ip saddr 0.0.0.0/0 ip daddr 0.0.0.0/0 tcp dport 80 counter redirect to 4949 83 | - else: 84 | cmd[cp]: |- 85 | for REDIRECT_HANDLE in $(/usr/sbin/nft -a list table ip nat 2>&1 | grep 'redirect to 4949'| grep 'dport 80' | sed -r 's/.*#\s+handle\s+([0-9]+)/\1/g' 2>/dev/null); do 86 | /usr/sbin/nft delete rule $ip_table nat PREROUTING handle $REDIRECT_HANDLE >>$JEM_CALLS_LOG 2>&1; 87 | done 88 | 89 | onBeforeResetNodePassword[cp]: 90 | - setGlobals: 91 | accessKey: ${fn.password} 92 | secretKey: ${fn.password} 93 | - cmd[cp]: |- 94 | jem passwd set -p ${globals.secretKey} -u ${globals.accessKey} 95 | jem service restart 96 | user: root 97 | - api: 98 | method: message.email.Send 99 | to: "${user.email}" 100 | subject: "MinIO pasword was successfully reset for ${env.name}" 101 | body: "
MinIO password was successfully reset for your ${env.name} environment.
Username: ${globals.accessKey}
Password: ${globals.secretKey}
" 102 | 103 | onInstall: 104 | - cmd[cp]: |- 105 | jem passwd set -p ${globals.secretKey} -u ${globals.accessKey} 106 | jem service stop 107 | rm -rf /${globals.exportPath}/.minio.sys 108 | user: root 109 | - cmd[cp]: |- 110 | echo "MINIO_SERVER_URL=${env.protocol}://${env.domain}" >> /etc/default/minio 111 | echo "MINIO_BROWSER_REDIRECT_URL=${env.protocol}://${env.domain}:4949" >> /etc/default/minio 112 | - if (${settings.le-addon:false}): 113 | - install-LE: 114 | skipEnvs: true 115 | - else: 116 | - build-cluster 117 | - restartContainers [cp] 118 | 119 | actions: 120 | build-cluster: 121 | script: ${globals.BUILD_SCRIPT} 122 | params: 123 | nodeGroup: cp 124 | volumePath: ${globals.exportPath} 125 | port: ${globals.port} 126 | consolePort: ${globals.consolePort} 127 | 128 | install-LE: 129 | - setGlobals: 130 | PROTOCOL: https 131 | - cmd[cp]: |- 132 | mkdir -p /home/jelastic/.minio/certs/host/ 133 | printf '#!/bin/bash 134 | chown -R minio-user:minio-user /home/jelastic/.minio/ 135 | sed -i "/MINIO_VOLUMES/s|http:|https:|g" /etc/default/minio 136 | sed -i "/MINIO_SERVER_URL/s|http:|https:|g" /etc/default/minio 137 | sed -i "/MINIO_BROWSER_REDIRECT_URL/s|http:|https:|g" /etc/default/minio 138 | sed -i "s|MINIO_OPTS=.*|MINIO_OPTS=\\" --address :443 --console-address :4949 --certs-dir /home/jelastic/.minio/certs\\"|g" /etc/default/minio 139 | ' > ${globals.DEPLOY_HOOK} 140 | 141 | printf '#!/bin/bash 142 | sed -i "/MINIO_VOLUMES/s|https:|http:|g" /etc/default/minio 143 | sed -i "/MINIO_SERVER_URL/s|https:|http:|g" /etc/default/minio 144 | sed -i "/MINIO_BROWSER_REDIRECT_URL/s|https:|http:|g" /etc/default/minio 145 | sed -i "s|MINIO_OPTS=.*|MINIO_OPTS=\\" --address :80 --console-address :4949\\"|g" /etc/default/minio 146 | ' > ${globals.UNDEPLOY_HOOK} 147 | - install: 148 | jps: https://raw.githubusercontent.com/jelastic-jps/lets-encrypt/master/manifest.jps?_r=${fn.random} 149 | nodeGroup: cp 150 | settings: 151 | deployHook: ${globals.DEPLOY_HOOK_JS} 152 | deployHookType: js 153 | undeployHook: ${globals.DEPLOY_HOOK_JS} 154 | undeployHookType: js 155 | customDomains: ${env.domain} 156 | - build-cluster 157 | - restartContainers [cp] 158 | 159 | success: 160 | text: /text/success.md 161 | email: /text/success.md 162 | -------------------------------------------------------------------------------- /nfs-volume-based/README.md: -------------------------------------------------------------------------------- 1 | # Minio Cluster based on NFS 2 | 3 | Minio is a high-performance, distributed object storage system that is compatible with the Amazon S3 API. By leveraging NFS (Network File System), you can set up a Minio cluster to provide scalable and resilient storage solutions. This guide will walk you through the process of configuring a Minio cluster using NFS, ensuring high availability and data redundancy for your storage needs. 4 | 5 | ### Topology 6 | 7 |  8 | 9 | ### Deploy 10 | 11 | Log into your Virtuozzo Application Platform account and [import](https://www.virtuozzo.com/application-platform-docs/environment-import/) link to the _**manifest.jps**_ file from above. 12 | 13 |  14 | 15 | Within the appeared form, you need to provide the following data: 16 | 17 | * **Volumes** - specify the required cluster size by choosing among the predefined options to create 1 (for development), 6, or 16 Minio nodes 18 | * **Access / Secret Key** - leave as is; keys are automatically generated for you 19 | * **Environment** - type in the preferred name for your Minio storage cluster (which, together with your platform domain, will constitute an internal environment name) 20 | * **Display Name** - optionally, add an [alias name](https://www.virtuozzo.com/application-platform-docs/environment-aliases/) to be displayed for the environment in the dashboard 21 | * **Region** - select a [hardware set](https://www.virtuozzo.com/application-platform-docs/environment-regions/) for your environment to be hosted (this option is active only if several regions are available) 22 | 23 | Alternatively, you can use the following button to automatically register on one of the [public Platforms](https://www.virtuozzo.com/application-platform-partners/) and immediately initiate Minio Cluster based on NFS installation: 24 | 25 | [](https://www.virtuozzo.com/install/?manifest=https://raw.githubusercontent.com/jelastic-jps/minio/master/nfs-volume-based/manifest.jps) 26 | 27 | ### Logs and Troubleshooting 28 | 29 | - Logs https://www.virtuozzo.com/application-platform-docs/view-log-files/ 30 | - SSH Access https://www.virtuozzo.com/application-platform-docs/ssh-access/ 31 | -------------------------------------------------------------------------------- /nfs-volume-based/manifest.jps: -------------------------------------------------------------------------------- 1 | { 2 | "jpsType": "install", 3 | "jpsVersion": "0.6", 4 | "application": { 5 | "name": "Minio", 6 | "homepage": "https://github.com/minio/minio", 7 | "description": "Minio is an object storage server, compatible with Amazon S3 cloud storage service, best suited for storing unstructured data such as photos, videos, log files and backups.", 8 | "logo": "https://github.com/jelastic-jps/minio/raw/master/images/minio-logo-70x70.png", 9 | "settings": { 10 | "fields": [ 11 | { 12 | "name": "volumes", 13 | "caption": "Volumes", 14 | "type": "list", 15 | "inputType": "string", 16 | "values": { 17 | "0": "1 local volume", 18 | "6": "6 nfs volumes", 19 | "16": "16 nfs volumes" 20 | }, 21 | "default": "0", 22 | "required": "true" 23 | }, 24 | { 25 | "name": "accessKey", 26 | "caption": "Access Key", 27 | "type": "string", 28 | "inputType": "string", 29 | "default": "AKIAIOSFODNN7EXAMPLE", 30 | "required": "true" 31 | }, 32 | { 33 | "name": "secretKey", 34 | "caption": "Secret Key", 35 | "type": "string", 36 | "inputType": "string", 37 | "default": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", 38 | "required": "true" 39 | } 40 | ] 41 | }, 42 | "env": { 43 | "topology": { 44 | "nodes": [ 45 | { 46 | "count": 1, 47 | "cloudlets": 16, 48 | "nodeGroup": "cp", 49 | "docker": { 50 | "image": "minio/minio", 51 | "env": { 52 | "MINIO_ACCESS_KEY": "${settings.accessKey}", 53 | "MINIO_SECRET_KEY": "${settings.secretKey}" 54 | }, 55 | "cmd": "--address :80 /export" 56 | } 57 | }, 58 | { 59 | "count": "${settings.volumes}", 60 | "cloudlets": 16, 61 | "nodeGroup": "extra", 62 | "docker": { 63 | "image": "jelastic/storage" 64 | } 65 | } 66 | ] 67 | } 68 | }, 69 | "onInstall": [ 70 | { 71 | "call": [ 72 | "mount-volumes", 73 | "update-nfs-mount" 74 | ] 75 | }, 76 | { 77 | "restartContainers": { 78 | "nodeGroup": "cp" 79 | } 80 | } 81 | ], 82 | "procedures": [ 83 | { 84 | "id": "mount-volumes", 85 | "onCall": { 86 | "execScript": { 87 | "type": "js", 88 | "script": "https://github.com/jelastic-jps/minio/raw/master/nfs-volume-based/mount-volumes.js" 89 | } 90 | } 91 | }, 92 | { 93 | "id": "update-nfs-mount", 94 | "onCall": { 95 | "execCmd": { 96 | "commands": "sed -i 's/nolock/nolock,retrans=1,bg/g' /etc/fstab", 97 | "nodeGroup": "cp" 98 | } 99 | } 100 | } 101 | ] 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /nfs-volume-based/mount-volumes.js: -------------------------------------------------------------------------------- 1 | //@auth 2 | 3 | if (${settings.volumes} == 0) return {result:0}; 4 | 5 | var resp = jelastic.env.control.GetEnvInfo('${env.envName}', session); 6 | var nodes = resp.nodes, volumes = '', n = 0; 7 | 8 | for (var i = 0; i < nodes.length; i++) { 9 | if (nodes[i].nodeGroup != 'extra') continue; 10 | var volume = '/export/volume' + n++; 11 | volumes += ' ' + volume; 12 | resp = jelastic.env.control.AddDockerVolumeByGroup('${env.envName}', session, 'cp', volume); 13 | resp = jelastic.env.file.AddMountPointByGroup('${env.envName}', session, 'cp', volume, 'nfs', null, '/data', nodes[i].id, '', false); 14 | } 15 | 16 | resp = jelastic.env.control.SetDockerRunCmd('${env.envName}', session, ${nodes.cp.first.id}, '--address :80' + volumes); 17 | return resp; 18 | -------------------------------------------------------------------------------- /scripts/build-cluster.js: -------------------------------------------------------------------------------- 1 | //@auth 2 | //@req(nodeGroup, volumePath, port) 3 | 4 | var envName = '${env.envName}', 5 | envDomain = '${env.domain}', 6 | nodes = jelastic.env.control.GetEnvInfo(envName, session).nodes, 7 | servers = [], resp = [], 8 | protocol = '${globals.PROTOCOL:http}' + '://', 9 | hostPort = protocol == 'https://' ? 443 : port; 10 | api.marketplace.console.WriteLog(protocol + hostPort); 11 | 12 | for (var i = 0; i < nodes.length; i++) { 13 | if (nodes[i].nodeGroup != nodeGroup) continue; 14 | var ttmp = nodes[i].extIPs ? nodes[i].extIPs[0] : nodes[i].address; 15 | servers.push(protocol + ttmp + volumePath); 16 | } 17 | 18 | //if there is only one server then we should specify only volumePath w/o IP 19 | if (servers.length == 1) servers[0] = volumePath; 20 | 21 | for (var i = 0; i < nodes.length; i++) { 22 | if (nodes[i].nodeGroup != nodeGroup) continue; 23 | resp.push(jelastic.env.file.ReplaceInBody(envName, session, '/etc/default/minio', '^MINIO_VOLUMES=.*', "MINIO_VOLUMES=\"" + servers.join(' ') + "\"", 1, null, null, false, nodes[i].id )); 24 | resp.push(jelastic.env.file.ReplaceInBody(envName, session, '/etc/default/minio', '^MINIO_OPTS=.*', "MINIO_OPTS=\" --address :" + hostPort + " --console-address :" + consolePort + "\"", 1, null, null, false, nodes[i].id )); 25 | } 26 | 27 | return { 28 | result: 0, 29 | responses: resp 30 | } 31 | -------------------------------------------------------------------------------- /scripts/deployHook.js: -------------------------------------------------------------------------------- 1 | // 2 | var envName = getParam('envName'), 3 | envDomain = getParam('envDomain'), 4 | scriptAction = getParam('action'), 5 | scriptName = scriptAction == 'uninstall' ? 'undeployLE.sh' : 'deployLE.sh', 6 | respEnvInfo = jelastic.env.control.GetEnvInfo(envName, session), 7 | masterNode = respEnvInfo.nodes.filter(node => (node.nodeGroup == 'cp' && node.ismaster))[0], 8 | resp = "", 9 | domains = []; 10 | 11 | function copyFileToNodes( scrFile, dstFile ){ 12 | var key = ""; 13 | resp = api.environment.file.Read({ 14 | envName: envName, 15 | session: session, 16 | path: scrFile, 17 | nodeid: masterNode.id 18 | }); 19 | if (resp.result != 0) return resp; 20 | key = resp.body; 21 | resp = api.environment.file.Write({ 22 | envName: envName, 23 | session: session, 24 | path: dstFile, 25 | nodeGroup: nodeGroup, 26 | nodeid: "-1", 27 | body: key 28 | }); 29 | return resp; 30 | } 31 | 32 | if (scriptAction != 'uninstall'){ 33 | // copy LE cert 34 | copyFileToNodes("/var/lib/jelastic/keys/privkey.pem", "/home/jelastic/.minio/certs/host/private.key"); 35 | copyFileToNodes("/var/lib/jelastic/keys/fullchain.pem", "/home/jelastic/.minio/certs/host/public.crt"); 36 | // copy minio cert 37 | respEnvInfo.nodes.forEach((element) => domains.push(element.extIPs ? element.extIPs[0] : element.address)); 38 | resp = api.env.control.ExecCmdById(envName, session, masterNode.id, toJSON([{ command:'/usr/local/bin/certgen -duration 87600h -host ' + domains.join(",") + '>/dev/null'}]), true); 39 | copyFileToNodes("/root/private.key", "/home/jelastic/.minio/certs/private.key"); 40 | copyFileToNodes("/root/public.crt", "/home/jelastic/.minio/certs/public.crt"); 41 | } 42 | 43 | //executing custom deployment hook script on cp nodes 44 | resp = api.env.control.ExecCmdByGroup(envName, session, "cp", toJSON([{ command:'/bin/bash /root/' + scriptName}]), true); 45 | if (resp.result != 0) return resp; 46 | 47 | if (scriptAction == 'install'){ 48 | return resp; 49 | } else { 50 | return api.env.control.RestartServices({ 51 | envName: envName, 52 | session: session, 53 | nodeGroup: "cp", 54 | isSequential: false 55 | }); 56 | } 57 | -------------------------------------------------------------------------------- /text/success.md: -------------------------------------------------------------------------------- 1 | Admin Panel: [${globals.PROTOCOL:http}://${env.domain}/](${globals.PROTOCOL:http}://${env.domain}/) 2 | Username: ${globals.accessKey} 3 | Password: ${globals.secretKey} 4 | 5 | To use a custom domain instead of the default environment hostname, please follow [this](https://www.virtuozzo.com/application-platform-docs/custom-domains/) guide. 6 | --------------------------------------------------------------------------------