goim安装

goim安装

安装 go

https://docs.studygolang.com/doc/install

安装 java

1
2
3
mkdir -p /usr/local/java
wget https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
tar -zxvf jdk-8u202-linux-x64.tar.gz -C /usr/local/java/

环境变量

1
2
3
4
5
6
7
8
vim ~/.profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_202
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=$PATH:/usr/local/go/bin:${JAVA_HOME}/bin

source ~/.profile

安装 kafka

https://kafka.apache.org/quickstart

问题1

UnknownHostException
https://stackoverflow.com/questions/27381802/kafka-shutting-down-kafka-server-kafkaserver-problems-with-starting-kafka-s

测试

1
2
3
4
5
# 创建一个topic
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

#查看已创建的topic
bin/kafka-topics.sh --list --bootstrap-server localhost:9092

goim需要的配置

1
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic goim-push-topic

安装 redis

1
2
apt install redis-server -y
systemctl status redis

安装 Discovery

1
2
3
4
git clone https://github.com/bilibili/discovery.git
cd discovery/cmd/discovery
go build
./discovery -conf discovery.toml -log.dir="/tmp"

安装 goim

1
2
3
git clone https://github.com/Terry-Mao/goim.git
make build
make run

测试 goim

postman

http://api.goim.io:3111/goim/push/mids?operation=1000&mids=123

1
2
3
{
"msg": "hello"
}

备注

ZooKeeper 安装配置

http://www.corejavaguru.com/bigdata/zookeeper/getting-started-with-zookeeper