C++ Match Engine撮合引擎 安装搭建(ubuntu)
1.迁出代码:https://github.com/klpeng/viabtc_exchange_server.git
2.安装mysql :apt -y install mysql-server
3.安装redis : apt -y install redis
4.安装java1.8:apt -y install openjdk-8-jdk
5.安装zookeeper : wget https://downloads.apache.org/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz
tar zxf zookeeper-3.4.13.tar.gz
cd zookeepr/conf
mv zoo_simple.cfg zoo.cfg
启动:bin/zkServer.sh start
连接:bin/zkCli.sh
6.安装 kafka : wget https://archive.apache.org/dist/kafka/1.0.0/kafka_2.12-1.0.0.tgz
tar zxf kafka_2.12-1.0.0.tgz
cd kafka
vim config/server.properties
修改配置文件中21、31、36和60行
broker.id=1
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://host_ip:9092
log.dirs=/home/wzj/kafka/logs-1
启动: bin/kafka-server-start.sh config/server.properties
或者: nohup bin/kafka-server-start.sh config/server.properties &
重点:安装redis集群一主二从三哨兵
7. 安装依赖库:
sudo apt install -y libev-dev libjansson-dev libmpdec-dev libmysqlclient-dev libcurl4-gnutls-dev libldap2-dev libgss-dev librtmp-dev libsasl2-dev libssl-dev
librdkafka :wget https://github.com/edenhill/librdkafka/archive/v0.11.3.tar.gz -O librdkafka-0.11.3.tar.gz
tar zxf librdkafka-0.11.3.tar.gz
cd librdkafka-0.11.3
./configure
make
sudo make install
libev : apt install libev-dev -y
libmpdec : apt install libmpdec-dev -y
jansson : wget http://www.digip.org/jansson/releases/jansson-2.12.tar.gz .configure && make && make install
libmysqlclient-dev : apt install libmysqlclient-dev -y
http_parser : apt install libhttp-parser-dev -y
libcurl : apt install libcurl4-openssl-dev -y
8. apt -y install python-dev
$ git clone https://github.com/viabtc/viabtc_exchange_server.git
$ cd viabtc_exchange_server
$ make -C depends/hiredis
$ make -C network
$ vi utils/makefile #modify INCS
# INCS = -I ../network -I ../depends
$ make -C utils
$ vi accesshttp/makefile #modify INCS & LIBS
# INCS = -I ../network -I ../utils -I ../depends
# LIBS = -L ../utils -lutils -L ../network -lnetwork -L ../depends/hiredis -Wl,-Bstatic -lev -ljansson -lmpdec -lrdkafka -lz -lssl -lcrypto -lhiredis -lcurl -Wl,-Bdynamic -lm -lpthread -ldl -lssl -lldap -llber -lgss -lgnutls -lidn -lnettle -lrtmp -lsasl2 -lmysqlclient
$ make -C accesshttp
$ vi accessws/makefile
{modify INCS and LIBS like accesshttp/makefile}
$ make -C accessws
vi alertcenter/makefile
{modify INCS and LIBS like accesshttp/makefile}
$ make -C alertcenter
$ vi marketprice/makefile
{modify INCS and LIBS like accesshttp/makefile}
$ make -C marketprice
$ vi matchengine/makefile
{modify INCS and LIBS like accesshttp/makefile}
$ make -C matchengine
$ vi readhistory/makefile
{modify INCS and LIBS like accesshttp/makefile}
$ make -C readhistory
文章版权声明:除非注明,否则均为彭超的博客原创文章,转载或复制请以超链接形式并注明出处。
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。