zzw原创_非root安装fastDFS
zzw原创_非root安装fastDFS
fastDFS 想要非root安装,没找到资料,分析了一下安装脚本,原来作者是留了安装路径的,但没有放出来。
1、解包
[bdc@svr001 setup]$ tar -xvf libfastcommon-1.0.36.tar.gz
[bdc@svr001 setup]$ cd libfastcommon-1.0.36
2、分析一下libfastcommon的make.sh脚本,发现其实前面的大段都是在判断是什么操作系统、32位还是64位、库路径等相关参数,真正的自身操作:
cd src
cp Makefile.in Makefile
sed_replace
"s/\\\$(CFLAGS)/$CFLAGS/g" Makefile
sed_replace "s/\\\$(LIBS)/$LIBS/g"
Makefile
sed_replace "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile
make $1
$2 $3
只是简单的将Makefile.in文件替换几个参数后复制成 Makefile
文件,然后就make了,竟然没有涉及编译路径。
我们再分析一下它的Makefile文件:
install:
mkdir -p
$(DESTDIR)/usr/$(LIB_VERSION)
mkdir -p $(DESTDIR)/usr/lib
install -m 755
$(SHARED_LIBS) $(DESTDIR)/usr/$(LIB_VERSION)
install -m 755 $(SHARED_LIBS)
$(DESTDIR)/usr/lib
mkdir -p $(DESTDIR)/usr/include/fastcommon
install -m
644 $(HEADER_FILES) $(DESTDIR)/usr/include/fastcommon
make 带install参数时才传入路径,其中 $(DESTDIR)就是可以自定义路径了。
3、 安装 lib
[bdc@svr001 zzw_temp]$ pwd
/opt/aspire/product/bdc/zzw_temp
[bdc@svr001
zzw_temp]$ ll
总用量 4
drwxrwxr-x 3 bdc bdc 4096 11月 7 17:45 setup
[bdc@svr001 zzw_temp]$ export
DESTDIR=/opt/aspire/product/bdc/zzw_temp/libfastcommon
[bdc@svr001 zzw_temp]$
echo $DESTDIR
/opt/aspire/product/bdc/zzw_temp/libfastcommon
[bdc@svr001 setup]$ cd setup/libfastcommon-1.0.36
[bdc@svr001 libfastcommon-1.0.36]$ ./make.sh # 注意是make.sh ,不是make, 这与一般编译不同 !!
[bdc@svr001 libfastcommon-1.0.36]$ ./make.sh install
[bdc@svr001 libfastcommon-1.0.36]$ cd
/opt/aspire/product/bdc/zzw_temp/libfastcommon
[bdc@svr001 libfastcommon]$ ll
总用量 4
drwxrwxr-x 5 bdc bdc 4096 11月 7
18:09 usr
安装成功!
4、 环境变量中加上库路径
export LD_LIBRARY_PATH=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/libfastcommon/usr/lib64:$LD_LIBRARY_PATH
注意使环境变量生效。
也可以将libfastcommon.so复制到/usr/lib下: cp /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/libfastcommon/usr/lib64/libfastcommon.so /usr/lib
5、安装fastdfs-5.11.tar.gz 同样的道理
分析一下fastdfs的make.sh文件
ENABLE_STATIC_LIB=0
ENABLE_SHARED_LIB=1
TARGET_PREFIX=$DESTDIR/usr
TARGET_CONF_PATH=$DESTDIR/etc/fdfs
TARGET_INIT_PATH=$DESTDIR/etc/init.d
所以安装时
[bdc@svr001 zzw_temp]$ export DESTDIR=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa # /opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa 为安装目录
[bdc@svr001 ]$ ./make.sh # 注意是make.sh ,不是make !!
[bdc@svr001 ]$ ./make.sh install
二、安装后后目录结构
安装后的目录只用etc与usr两个文件夹。
[dicmp_zzw@linux245 fastdfsaaa]$ tree .
.
|-- etc
| |-- fdfs
| | |--
client.conf.sample
| | |-- storage.conf.sample
| | |--
storage_ids.conf.sample
| | `-- tracker.conf.sample
| `--
init.d
| |-- fdfs_storaged
| `--
fdfs_trackerd
`-- usr
|--
bin
| |-- fdfs_appender_test
| |-- fdfs_appender_test1
| |-- fdfs_append_file
| |-- fdfs_crc32
| |--
fdfs_delete_file
| |-- fdfs_download_file
| |--
fdfs_file_info
| |-- fdfs_monitor
| |-- fdfs_storaged
| |-- fdfs_test
| |-- fdfs_test1
| |-- fdfs_trackerd
| |-- fdfs_upload_appender
| |-- fdfs_upload_file
| |--
restart.sh
| `-- stop.sh
|-- include
| `--
fastdfs
| |-- client_func.h
| |--
client_global.h
| |-- fdfs_client.h
| |--
fdfs_define.h
| |-- fdfs_global.h
| |--
fdfs_http_shared.h
| |-- fdfs_shared_func.h
| |--
mime_file_parser.h
| |-- storage_client1.h
| |--
storage_client.h
| |-- tracker_client.h
| |--
tracker_proto.h
| |-- tracker_types.h
| `--
trunk_shared.h
|-- lib
| `-- libfdfsclient.so
`--
lib64
`-- libfdfsclient.so
三、配置
1、修改/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa/etc/init.d/fdfs_storaged
和 fdfs_trackerd 两个文件
# Source function library.
if [ -f
/etc/init.d/functions ]; then
. /etc/init.d/functions
fi
DESTDIR=/opt/aspire/product/dicmp_zzw/zzw_temp/fastddd/fastdfsaaa
#配置为安装路径
PRG=$DESTDIR/usr/bin/fdfs_storaged #加上变量
CONF=$DESTDIR/etc/fdfs/storage.conf
#加上变量
还没有空研究行不行
zzw原创_非root安装fastDFS的更多相关文章
- zzw原创_非root用户下安装nginx
想自己安装nginx,又不相用到root用户. 非root用户下(本文为用户bdctool)来ngnix安装,要依赖pcre库.zlib库等, 1. 下载依赖包:下载地址 pcre(www.pcre. ...
- zzw原创_非root用户启动apache的问题解决(非root用户启动apache的1024以下端口)
场景:普通用户编译的apache,要在该用户下启动1024端口以下的apache端口 1.假设普通用户为sims20,用该用户编译 安装了一个apache,安装路径为/opt/aspire/produ ...
- 非root安装fastDFS及启动
引用https://www.cnblogs.com/zzw-zyba/p/10155781.html 非root安装部分 1.解包 [bdc@svr001 setup]$ tar -xvf lib ...
- nginx非root安装
nginx非root安装 唯一需要解决的就是指定安装目录 这里使用nginx相关包如下 nginx-1.14.0.tar.gz 安装需要依赖如下2个包 pcre-8.42.tar.gz zlib-1. ...
- Linux非root安装Python3以及解决SSL问题
说明 接上一篇. [Linux]非root安装Python3及其包管理 上一篇虽然成功安装了Python3及一些常用的模块,但因为一直装不上SSL模块,导致一些包无法安装,尝试了不少方法都失败了(网上 ...
- 【Linux】非root安装Python3及其包管理
1. Python 3.8.1安装 源码安装常规操作: wget -c https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz tar -xv ...
- [Linux] 非root安装GCC9.1.0
说明 一般Linux系统自带或公共的GCC版本都很低,如目前我们的服务器版本的GCC还停留在gcc-4.9.3,而官网已到达9.2版本(下载http://ftp.gnu.org/gnu/gcc/) , ...
- [linux] 非root安装Python2及其模块
需求 系统自带的python2版本太低,且没有想要的模块,非root用户无法安装.有些模块是python2写的,无法用python3,所以自己下载一个高版本的python2,可以自由下载模块. 实现 ...
- 非root安装rpm时,mockbuild does not exist - using root
1.现象 [fedora@k8s-cluster--ycmwlao4q5wz-minion- ~]$ [fedora@k8s-cluster--ycmwlao4q5wz-minion- ~]$ sud ...
随机推荐
- 基于PLC1850平台的UDP报文接收与发送
一.UDP报文格式 源端口(2个字节):发送报文的进程的16位端口号. 目的端口(2个字节):目的设备上的接收进程的16位端口号. 长度(2个字节):整个UDP数据报的长度,包括首都和数据字段. 校验 ...
- redis使用总结(一)(redis客户端使用)
NoSQL 摘自百度百科 NoSQL,泛指非关系型的数据库.随着互联网web2.0网站的兴起,传统的关系数据库在应付web2.0网站,特别是超大规模和高并发的SNS类型的web2.0纯动态网站已经显得 ...
- 用java实现操作两个数据库的数据
1.首先需要在jdbc的配置文件里面配置两个数据库的连接 数据库1的配置 driverClassName=com.mysql.jdbc.Driverurl=jdbc:mysql://地址:3306/数 ...
- SpringBoot 项目打包分开lib,配置和资源文件
原文地址:https://blog.csdn.net/u012811805/article/details/80878848 1 jar启动分离依赖lib和配置 先前发布boot项目的时候,改动一点东 ...
- Leetcode 存在重复元素 (219,220)
219. 存在重复元素 II 给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j],并且 i 和 j 的差的绝对值最大为 k. / ...
- varnish 测试
安装 通过epel 源 yum 安装 [root@localhost varnish]# rpm -ql varnish /etc/logrotate.d/varnish /etc/varnish / ...
- 初涉wheel 组
入门 在一次处理su切换的问的时候出现一个问题, [cheng1@localhost ~]$ su cheng2 密码: su: 鉴定故障 [cheng1@localhost ~]$ 试过很多次, 也 ...
- SQL表的自身关联
SQL表的自身关联 有如下两个数据表: tprt表,组合基本信息表,每个组合有对应的投管人和托管人: tmanager表,管理人信息表,管理人类别由o_type区分: 具体表信息如下所示: tprt表 ...
- ajax错误类型大全
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html ajax错误类型大全
- asp.net 根据连接地址保存文件,图片
第一种方式 下载图片,文件 WebClient my = new WebClient(); string url = "http://localhost:1015/resource/loa ...