1 Star 0 Fork 0

lulusayhi01 / cachecloud

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

##目录  (具体细节wiki文档page、QQ群:534429768)

## 一、CacheCloud是做什么的        CacheCloud提供一个Redis云管理平台:实现多种类型(**Redis Standalone**、**Redis Sentinel**、**Redis Cluster**)自动部署、解决Redis实例碎片化现象、提供完善统计、监控、运维功能、减少运维成本和误操作,提高机器的利用率,提供灵活的伸缩性,提供方便的接入客户端。 ## 二、CacheCloud提供哪些功能 + **监控统计:** 提供了机器、应用、实例下各个维度数据的监控和统计界面。 + **一键开启:** Redis Standalone、Redis Sentinel、Redis Cluster三种类型的应用,无需手动配置初始化。 + **Failover:** 支持哨兵,集群的高可用模式。 + **伸缩:** 提供完善的垂直和水平在线伸缩功能。 + **完善运维:** 提供自动运维和简化运维操作功能,避免纯手工运维出错。 + **方便的客户端:**方便快捷的客户端接入。 + **元数据管理:** 提供机器、应用、实例、用户信息管理。 + **流程化:** 提供申请,运维,伸缩,修改等完善的处理流程 + **一键导入:** [一键导入已经存在Redis](http://cachecloud.github.io/2016/04/17/%E5%B7%B2%E5%AD%98%E5%9C%A8Redis%E6%8E%A5%E5%85%A5CacheCloud/) ## 三、CacheCloud解决什么问题 ### ####1.部署成本        Redis多机(Redis-Sentinel, Redis-Cluster)部署和配置相对比较复杂,较容易出错。
例如:100个redis数据节点组成的redis-cluster集群,如果单纯手工安装,既耗时又容易出错。

####2.实例碎片化        作为一个Redis管理员(可以看做redis DBA)需要帮助开发者管理上百个Redis-Cluster集群,分布在数百台机器上,人工维护成本很高,需要自动化运维工具。 ####3. 监控、统计和管理不完善        一些开源的Redis监控和管理工具,例如:RedisLive(Python)、Redis Commander(Node.js),Redmon(Ruby)无论从功能的全面性(例如配置管理,支持Redis-Cluster等等)、扩展性很难满足需求。 ####4. 运维成本        Redis的使用者需要维护各自的Redis,但是用户可能更加善于使用Redis实现各种功能,但是没有足够的精力和经验维护Redis。 Redis的开发人员如同使用Mysql一样,不需要运维Mysql服务器,同样使用Redis服务,不要自己运维Redis,Redis由一些在Redis运维方面更有经验的人来维护(保证高可用,高扩展性),使得开发者更加关注于Redis使用本身。 ####5. 伸缩性        本产品支持Redis最新的Redis-Sentinel、Redis-Cluster集群机构,既满足Redis高可用性、又能满足Redis的可扩展性,具有较强的容量和性能伸缩能力。 ####6. 经济成本        机器利用率低,各个项目组的Redis较为分散的部署在各自服务器上,造成了大量闲置资源没有有效利用。 ####7. 版本不统一        各个项目的Redis使用各种不同的版本,不便于管理和交互。

## 四、CacheCloud提供的价值 ### + 规模化自动运维: 降低运维成本,降低人为操作出错率。 + 自由伸缩: 提供灵活的伸缩性,应用扩容/收缩成本降低,机器资源得到重复利用。 + 团队提升,开源贡献:提升云产品开发设计经验,自己作为开发者和使用者,Eating your own dog food。 ## 五、CacheCloud在搜狐的规模 ### + 每天100+亿次命令调用 + 2T+的内存空间 + 800+个Redis实例 + 100+台机器 ## 六、CacheCloud环境需求 ### + Java 7 + Maven 3 + MySQL + Redis 3 ## 七、CacheCloud快速开始 ### ####1、初始化数据库        导入项目中cachecloud.sql初始化库表结构。默认插入admin超级管理员 ####2、CacheCloud项目配置        使用了maven作为项目构建的工具,提供了 local.properties和online.properties两套配置作为测试、线上的隔离。 属性配置说明:
属性名 说明 示例
cachecloud.db.url mysql驱动url jdbc:mysql://127.0.0.1:3306/cache-cloud
cachecloud.db.user mysql用户名 admin
cachecloud.db.password mysql密码 admin
web.port spring-boot内嵌tomcat启动端口 8080

更加详细的配置,请参考: 系统配置 请在系统第一次启动后,进入后台管理中对配置进行详细配置,有些配置是比较重要的,例如cachecloud管理机器用到了ssh,配置中涉及到了ssh用户名、密码、端口等等。

####3、启动cachecloud系统

#####(1). 本地启动:

  • 在cachecloud根目录下运行
mvn clean compile install -Plocal
  • 在cachecloud-web模块下运行
mvn spring-boot:run

#####(2). 生产环境

  • 在cachecloud根目录下运行
mvn clean compile install -Ponline
  • 拷贝war包(cachecloud-open-web/target/cachecloud-open-web-1.0-SNAPSHOT.war)到/opt/cachecloud-web下
  • 拷贝配置文件(cachecloud-open-web/src/main/resources/cachecloud-web.conf)到/opt/cachecloud-web下,并改名为cachecloud-open-web-1.0-SNAPSHOT.conf(spring-boot要求,否则配置不生效)
  • 启动方法1(作为系统服务启动,可能存在系统兼容性问题,目前redhat6.5,centos7正常)
sudo ln -s /opt/cachecloud-web/cachecloud-open-web-1.0-SNAPSHOT.war /etc/init.d/cachecloud-web
/etc/init.d/cachecloud-web start 
  • 启动方法2(使用脚本启动,大部分操作系统都正常) 拷贝启动脚本(cachecloud根目录下script目录下的start.sh和stop.sh)到/opt/cachecloud-web下
sh start.sh #如果机器内存不足可以适当调小:-Xmx和-Xms(默认是4g)
sh stop.sh

#####(3). 登录确认

#####(a) 访问:http://127.0.0.1:9999 (9999是tomcat的端口号,具体要参考第2节中的online.properties和local.properties中的web.port) #####(b) 如果访问正常,请使用用户名:admin、密码:admin访问系统,跳转到应用列表下:

####4、添加机器 #####(1). 运行脚本: cachecloud项目中的cachecloud-init.sh脚本是用来初始化服务器的cachecloud环境,主要工作如下:
  • (a). 创建cachecloud项目用户:因为cachecloud项目的部分功能(redis启动、服务器监控)是通过ssh完成的,所以这里的用户和密码要和项目中的相对应,具体详见第2节的系统配置。

  • (b). 创建cachecloud项目的工作目录、数据目录、配置目录、日志目录、redis安装目录、临时目录等等。(/opt/cachecloud/data、/opt/cachecloud/conf、/opt/cachecloud/logs、/opt/cachecloud/redis、/tmp/cachecloud)

  • (c). 安装最新的release版本的Redis

#####(2). 脚本执行

  • (a). 使用root登录目标服务器。
  • (b). 将cachecloud-init.sh脚本拷贝到目标服务器当前用户目录下。
  • (c). 执行 sh cachecloud-init.sh ${yourusername}
  • (d). 两次确认密码
  • (e). 一路安装直到成功。

#####(3). 建议和警告

  • (a). 请在root用户下执行初始化脚本,因为初始化脚本涉及到了用户的创建等较高的权限。
  • (b). 出于安全的考虑,所选的机器最好不要有外网IP地址。
  • (c). 用户名和密码最好不要用cachecloud, 密码尽可能复杂。
  • (d). 请确保/opt/有足够的硬盘空间,因为/opt/cachecloud/data要存储RDB和AOF的持久化文件,如果硬盘过小,会造成持久化失败。(如果硬盘确实很小,建议建立一个软链接到/opt/cachecloud/data,且保证软链接的目录也是username用户,一定要保证/opt/cachecloud的目录结构)
  • (e). 脚本中目前使用的是redis-3.0.6,如有需要请自行替换,建议使用3.0 release以后的版本。3.2版本公司尚未在线上使用,但是要注意3.2版本中bind的默认是127.0.0.1

#####(4). 添加机器        进入管理员界面(http://ip:port/manage/total/list),进入机器管理,点击添加机器,添加机器信息是开通应用的基础。

更多内容参考:wiki文档cachecloud官方博客

## 八、开发计划-TODO LIST ### [后期开发计划](http://cachecloud.github.io/2016/04/17/v2%E8%AE%A1%E5%88%92/) ## 九、已知用户 ###

除此之外,还有天津联怡科技有限公司、瑞友科技、厦门美好出行物联网技术有限公司、北京九瑞网络科技有限公司、深圳市深软信息技术有限公司、欧乐在线科技有限公司、慧科教育、上海仁画信息股份有限公司等。

新用户可以从这里登记,我们有特殊“服务”。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

搜狐视频(sohu tv)Redis私有云平台 http://sohutv.github.io/cachecloud 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/lulusayhi01/cachecloud.git
git@gitee.com:lulusayhi01/cachecloud.git
lulusayhi01
cachecloud
cachecloud
master

搜索帮助