Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【C-Plan】编译与部署 #245

Closed
xin321 opened this issue Jan 31, 2021 · 1 comment
Closed

【C-Plan】编译与部署 #245

xin321 opened this issue Jan 31, 2021 · 1 comment

Comments

@xin321
Copy link

xin321 commented Jan 31, 2021

测试环境:

  • 硬件配置:云服务器ECS 2C4G
  • 操作系统:Centos8(非Docker环境编译/部署)
  • 内核版本:4.18.0

部署
按官网教程逐步进行,遇以下情况

  • 提示未安装GCC 解决方案:yum install gcc。
  • 下载etcd-client时多次连接超时 解决方案:其他机器下载etcd-client,上传至本机/tmp下,注释脚本/home/curve/curve/curve-ansible/roles/install_package/tasks/include/install_etcd.yml的32-41行下载etcd-client步骤。
  • 启动./chunkserver_ctl.sh start all失败 解决方案:修改chunkserver_ctl.sh脚本 在164行打印curve-chunkserver的执行结果即$LD_PRELOAD,发现缺少libcurl-gnutls.so.4,则在/usr/lib64下创建软连接,ln -s libcurl.so.4 libcurl-gnutls.so.4。

结果验证
image
写入测试
image

编译

  1. wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-installer-linux-x86_64.sh 下载bazel并安装
  2. yum install git gcc-c++ make zlib zlib-devel openssl openssl-devel 安装相应依赖 git clone https://github.com/albertito/libfiu.git && make && make install (该依赖不可使用yum install)
  3. 执行 ./replace-curve-repo.sh && ./build.sh

Client Python Api测试

  1. 在root下创建目录 mkdir curve_test && cd curve_test,拷贝 /usr/curvefs 到该目录 cp -r /usr/curvefs/ .
  2. 编写测试用例 vim main.py
    image
    3.执行
    image

Client Cpp Api测试

  1. 在curve目录下创建目录 mkdir curvefs_cpp && cd curvefs_cpp,拷贝 curve/nebd/src/part2/BUILD 到该目录
  2. 修改BUILD文件
    image
  3. 编写测试用例(模仿curvefs_python)
    image
  4. 编译并执行
    bazel build //curvefs_cpp:curvefs --copt -DHAVE_ZLIB=1 --compilation_mode=dbg -s --define=with_glog=true --define=libunwind=true --copt -DGFLAGS_NS=google --copt -Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX
    bazel-bin/curvefs_cpp/curvefs
    image
@aspirer
Copy link
Contributor

aspirer commented Feb 2, 2021

启动./chunkserver_ctl.sh start all失败 解决方案:修改chunkserver_ctl.sh脚本 在164行打印curve-chunkserver的执行结果即$LD_PRELOAD,发现缺少libcurl-gnutls.so.4,则在/usr/lib64下创建软连接,ln -s libcurl.so.4 libcurl-gnutls.so.4。

这个问题解决的非常棒,我们之前在用户群里也有人问到过这个问题,我们也是告知的类似方案。建议可以提一个pr来修复掉这个问题。例如可以在start启动脚本里面增加这个库的检查流程,如果不满足条件,则打印提示信息或给出建议的解决方案。

总体来说这个部署流程非常赞,尤其是用的裸机部署而不是我们推荐的docker方式。另外还调用了Python api进行测试也很棒。接下来可以继续尝试提交修复小问题或者补充测试用例之类的pr。

@aspirer aspirer closed this as completed Apr 28, 2021
ilixiaocui pushed a commit to ilixiaocui/curve that referenced this issue Feb 6, 2023
add OpenEBS to CB Q2 selected projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants