FastDHT
- 先安装FastDFS
安装前的准备
yum install \ vim \ git \ gcc \ gcc-c++ \ wget \ make \ automake \ autoconf \ libtool \ libdb \ libdb-devel \ libevent \ libevent-devel \ -y \
安装libfastcommon
cd /root git clone https://github.com/happyfish100/libfastcommon.git cd libfastcommon/ ./make.sh ./make.sh install
安装Berkley db-6.2.23
cd /root wget http://download.oracle.com/berkeley-db/db-6.2.23.tar.gz tar -zxvf db-6.2.23.tar.gz cd db-6.2.23 ./dist/configure --prefix=/usr/local/db make make install
安装FastDHT
cd /root git clone https://github.com/happyfish100/fastdht.git cd fastdht #修改make.sh vim make.sh CFLAGS='-Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE' #改为: CFLAGS='-Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/usr/local/db/include/ -L/usr/local/db/lib/' ESC :wq ./make.sh ./make.sh install
配置文件
# 如没有/etc/fdht目录及目录下文件 mkdir /etc/fdht mkdir /data/fdht cp /root/fastdht/conf/fdht_client.conf /etc/fdht cp /root/fastdht/conf/fdhtd.conf /etc/fdht cp /root/fastdht/conf/fdht_servers.conf /etc/fdht
配置fdht_client.conf
vim /etc/fdht/fdht_client.conf #本选项关联 storaged.conf文件 keep_alive=1 base_path=/data/fdht #include /etc/fdht/fdht_servers.conf ESC :wq
配置fdht_servers.conf(11411)
vim /etc/fdht/fdht_servers.conf group_count=2 group0 = 192.168.1.201:11411 group0 = 192.168.1.202:11411 group1 = 192.168.1.203:11411 group1 = 192.168.1.204:11411 ESC :wq
配置fdhtd.conf
vim /etc/fdht/fdhtd.conf bind_addr=192.168.1.101 port=11411 base_path=/data/fdht cache_size=64MB #include /etc/fdht/fdht_servers.conf ESC :wq
引入libdb.so
ln -s /usr/local/db/lib/libdb-6.2.so /usr/lib/libdb-6.2.so ln -s /usr/local/db/lib/libdb-6.2.so /usr/lib64/libdb-6.2.so
开启11411端口
yum install firewalld systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=public --add-port=11411/tcp --permanent firewall-cmd --reload
启动FastDHT
/usr/local/bin/fdhtd /etc/fdht/fdhtd.conf
开机启动
vim /etc/rc.local /usr/local/bin/fdhtd /etc/fdht/fdhtd.conf ESC :wq chmod +x /etc/rc.local
- 领支付宝红包支持作者