-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a243581
commit d468b63
Showing
6 changed files
with
87 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters