CentOS7.X安装FastDHT

  1. 云栖社区>
  2. 博客>
  3. 正文

CentOS7.X安装FastDHT

qq2233466866 2018-06-11 15:46:10 浏览1143
展开阅读全文

FastDHT

  1. 先安装FastDFS
  2. 安装前的准备

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

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

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

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

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

    vim /etc/rc.local
    
    /usr/local/bin/fdhtd /etc/fdht/fdhtd.conf
    
    ESC
    :wq
    
    chmod +x /etc/rc.local
  14. 领支付宝红包支持作者

    扫码领支付宝红包

网友评论

登录后评论
0/500
评论
qq2233466866
+ 关注