Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nxttl-ucas committed Aug 5, 2021
1 parent a243581 commit d468b63
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 41 deletions.
24 changes: 24 additions & 0 deletions docs/redis-proxy/quick-start-fat-jar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

## 快速开始(基于fatJar和sample-code)

下载源码,切到最新稳定分支(v1.0.34)
```
git clone https://github.com/netease-im/camellia.git
cd camellia
git checkout v1.0.34
```
按需修改[sample-code](/camellia-samples/camellia-redis-proxy-samples) 中的配置文件:
* application.yml
* logback.xml
* camellia-redis-proxy.properties
* resource-table.json

使用maven编译
```
mvn clean install
```
找到可执行jar包,使用java -jar命令运行即可(注意设置内存和GC,并确保已经安装了jdk8或以上,并添加到path):
```
cd camellia-samples/camellia-redis-proxy-samples/target
java -XX:+UseG1GC -Xms2048m -Xmx2048m -server -jar camellia-redis-proxy-samples-1.0.34.jar
```
33 changes: 33 additions & 0 deletions docs/redis-proxy/quick-start-no-spring-boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

## 快速开始(不基于spring-boot-starter)

首先,引入依赖:
```
<dependency>
<groupId>com.netease.nim</groupId>
<artifactId>camellia-redis-proxy</artifactId>
<version>1.0.34</version>
</dependency>
```

其次,如下:
```java
/**
* 不使用spring-boot-starter,手工启动一个proxy的方法
* Created by caojiajun on 2021/8/3
*/
public class SimpleTest {

public static void main(String[] args) {
//设置相关参数
CamelliaRedisProxyStarter.updatePort(6380);//设置proxy的端口
CamelliaRedisProxyStarter.updatePassword("pass123");//设置proxy的密码
CamelliaRedisProxyStarter.updateRouteConf("redis://@127.0.0.1:6379");//可以设置单个地址,也可以设置一个json去配置双写/分片等
CamelliaRedisProxyStarter.getServerProperties().setCommandInterceptorClassName(TroubleTrickKeysCommandInterceptor.class.getName());//设置拦截器
//其他参数设置....

//启动
CamelliaRedisProxyStarter.start();
}
}
```
23 changes: 23 additions & 0 deletions docs/redis-proxy/quick-start-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

## 快速开始(基于安装包)

下载最新版安装包并解压(v1.0.34):
```
wget https://github.com/netease-im/camellia/releases/download/v1.0.34/camellia-redis-proxy-1.0.34.tar.gz
tar zxvf camellia-redis-proxy-1.0.34.tar.gz
cd camellia-redis-proxy-1.0.34/
```
按需修改BOOT-INF/classes/下的配置文件:
* application.yml
* logback.xml
* camellia-redis-proxy.properties
* resource-table.json

按需调整start.sh的启动参数(主要是JVM参数),默认参数如下(确保已经安装了jdk8或以上,并添加到path):
```
java -XX:+UseG1GC -Xms2048m -Xmx2048m -server org.springframework.boot.loader.JarLauncher
```
直接启动即可:
```
./start.sh
```
46 changes: 5 additions & 41 deletions docs/redis-proxy/redis-proxy-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,50 +157,14 @@ OK
3) (nil)
```

## 快速开始二
下载最新版安装包并解压(v1.0.34):
```
wget https://github.com/netease-im/camellia/releases/download/v1.0.34/camellia-redis-proxy-1.0.34.tar.gz
tar zxvf camellia-redis-proxy-1.0.34.tar.gz
cd camellia-redis-proxy-1.0.34/
```
按需修改BOOT-INF/classes/下的配置文件:
* application.yml
* logback.xml
* camellia-redis-proxy.properties
* resource-table.json

按需调整start.sh的启动参数(主要是JVM参数),默认参数如下(确保已经安装了jdk8或以上,并添加到path):
```
java -XX:+UseG1GC -Xms2048m -Xmx2048m -server org.springframework.boot.loader.JarLauncher
```
直接启动即可:
```
./start.sh
```
## 快速开始二(基于安装包)
参见:[quick-start-package](quick-start-package.md)

## 快速开始三(基于fatJar和sample-code)
下载源码,切到最新稳定分支(v1.0.34)
```
git clone https://github.com/netease-im/camellia.git
cd camellia
git checkout v1.0.34
```
按需修改[sample-code](/camellia-samples/camellia-redis-proxy-samples) 中的配置文件:
* application.yml
* logback.xml
* camellia-redis-proxy.properties
* resource-table.json
参见:[quick-start-fat-jar](quick-start-fat-jar.md)

使用maven编译
```
mvn clean install
```
找到可执行jar包,使用java -jar命令运行即可(注意设置内存和GC,并确保已经安装了jdk8或以上,并添加到path):
```
cd camellia-samples/camellia-redis-proxy-samples/target
java -XX:+UseG1GC -Xms2048m -Xmx2048m -server -jar camellia-redis-proxy-samples-1.0.34.jar
```
## 快速开始四(不使用spring-boot-stater)
参见:[quick-start-no-spring-boot](quick-start-no-spring-boot.md)

## 路由配置
路由配置表示了camellia-redis-proxy在收到客户端的redis命令之后的转发规则,包括:
Expand Down
1 change: 1 addition & 0 deletions update-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* camellia-redis-proxy-hbase refactor string commands implements
* CamelliaRedisTemplate provide Jedis Adaptor to migrate from Jedis
* CamelliaRedisTemplate provide SpringRedisTemplate Adaptor
* camellia-redis-proxy provide util class CamelliaRedisProxyStarter to start proxy without spring-boot-starter

### update
* camellia-redis-proxy remove jedis dependency
Expand Down
1 change: 1 addition & 0 deletions update-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* camellia-redis-proxy-hbase重构了string相关命令的冷热分离存储设计,具体见:[文档](/docs/redis-proxy-hbase/redis-proxy-hbase.md)
* CamelliaRedisTemplate提供Jedis适配器,修改一行代码从Jedis迁移到CamelliaRedisTemplate,具体见:[文档](/docs/redis-template/redis-template.md)
* CamelliaRedisTemplate提供SpringRedisTemplate适配器,具体见:[文档](/docs/redis-template/redis-template.md)
* camellia-redis-proxy提供一个不使用spring-boot-starter启动proxy的简单封装工具类CamelliaRedisProxyStarter,具体见:[文档](/docs/redis-proxy/redis-proxy-zh.md)

### 更新
* camellia-redis-proxy移除jedis的依赖
Expand Down

0 comments on commit d468b63

Please sign in to comment.