Linux安装FastDHT

  1. 作者QQ:67065435 QQ群:821635552

  2. 本站内容全部为作者原创,转载请注明出处!

  3. 安装前的准备

    yum install \
    vim \
    git \
    gcc \
    gcc-c++ \
    wget \
    make \
    automake \
    autoconf \
    libtool \
    libdb \
    libdb-devel \
    libevent \
    libevent-devel \
    -y
    
  4. 安装libfastcommon

    cd /root
    git clone https://github.com/happyfish100/libfastcommon.git
    cd libfastcommon/
    ./make.sh
    ./make.sh install
    
  5. 安装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
    
  6. 安装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
    
  7. 配置文件

    # 如没有/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
    
  8. 配置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
    
  9. 配置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
    
  10. 配置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
    
  11. 引入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
    
  12. 开启11411端口

    yum install firewalld
    systemctl enable firewalld
    systemctl start firewalld
    
    firewall-cmd --zone=public --add-port=11411/tcp --permanent
    firewall-cmd --reload
    
  13. 启动FastDHT

    /usr/local/bin/fdhtd /etc/fdht/fdhtd.conf
    
  14. 开机启动

    vim /etc/rc.local
    
    /usr/local/bin/fdhtd /etc/fdht/fdhtd.conf
    
    ESC
    :wq
    
    chmod +x /etc/rc.local
    
Copyright © 豆包嘿嘿~ 2012-∞ 冀ICP备17033181号 all right reserved,powered by Gitbook修订: 2020-08-19 14:05:41

results matching ""

    No results matching ""