From 014f52fe2bb5129e20ce2470282da24680dade40 Mon Sep 17 00:00:00 2001 From: charisu Date: Mon, 20 Jul 2020 21:28:16 +0800 Subject: [PATCH] fix: curvefsTool and curve-ansible for centos Change-Id: I93ca609b4c192bf739e19061f1d5bc1fd989f0c5 --- curve-ansible/client.ini | 7 ++- .../roles/generate_config/defaults/main.yml | 32 -------------- .../templates/etcd.conf.yml.j2 | 4 -- .../roles/install_package/defaults/main.yml | 26 ++++------- .../include/determine_if_lib_installed.yml | 26 +++++++++++ .../tasks/include/install_aws-sdk.yml | 4 +- .../include/install_curve-chunkserver.yml | 7 +-- .../tasks/include/install_curve-mds.yml | 7 ++- .../tasks/include/install_curve-nbd.yml | 2 +- .../tasks/include/install_curve-sdk.yml | 8 ++-- .../install_curve-snapshotcloneserver.yml | 7 ++- .../tasks/include/install_curve-tools.yml | 2 +- .../tasks/include/install_daemon.yml | 32 ++++++++++++++ .../tasks/include/install_etcd.yml | 3 ++ .../include/install_lib_with_source_code.yml | 35 +++------------ .../tasks/include/install_nebd.yml | 25 +++++++---- .../include/install_with_source_code.yml | 43 +++++++++++++++++++ .../templates/chunkserver_ctl.sh.j2 | 2 +- .../templates/mds-daemon.sh.j2 | 2 +- .../install_package/templates/nebd-daemon.j2 | 4 +- .../roles/install_package/vars/main.yml | 2 + curve-ansible/server.ini | 4 ++ tools/curvefsTool.cpp | 6 ++- 23 files changed, 178 insertions(+), 112 deletions(-) create mode 100644 curve-ansible/roles/install_package/tasks/include/determine_if_lib_installed.yml create mode 100644 curve-ansible/roles/install_package/tasks/include/install_daemon.yml create mode 100644 curve-ansible/roles/install_package/tasks/include/install_with_source_code.yml diff --git a/curve-ansible/client.ini b/curve-ansible/client.ini index 7b2d0c7458..e49b309d6c 100644 --- a/curve-ansible/client.ini +++ b/curve-ansible/client.ini @@ -6,7 +6,6 @@ localhost ansible_ssh_host=127.0.0.1 localhost ansible_ssh_host=127.0.0.1 [client:vars] -ansible_ssh_port=1046 nebd_package_version="1.0.2+e3fa47f" nbd_package_version="" sdk_package_version="0.0.6.1+160be351" @@ -27,3 +26,9 @@ mds_port=6666 [all:vars] need_confirm=true need_update_config=true +curve_bin_dir=/usr/bin +curve_lib_dir=/usr/lib +curve_include_dir=/usr/include +curvefs_dir=/usr/curvefs +ansible_ssh_port=22 +lib_install_prefix=/usr/local diff --git a/curve-ansible/roles/generate_config/defaults/main.yml b/curve-ansible/roles/generate_config/defaults/main.yml index 7d8d5eb10e..c4d703d447 100644 --- a/curve-ansible/roles/generate_config/defaults/main.yml +++ b/curve-ansible/roles/generate_config/defaults/main.yml @@ -241,38 +241,6 @@ etcd_proxy_dial_timeout: 1000 etcd_proxy_write_timeout: 5000 etcd_proxy_read_timeout: 0 -etcd_client_transport_security: - # Path to the client server TLS cert file. - cert-file: - - # Path to the client server TLS key file. - key-file: - - # Enable client cert authentication. - client-cert-auth: false - - # Path to the client server TLS trusted CA cert file. - trusted-ca-file: - - # Client TLS using generated certificates - auto-tls: false - -etcd_peer_transport_security: - # Path to the peer server TLS cert file. - cert-file: - - # Path to the peer server TLS key file. - key-file: - - # Enable peer client cert authentication. - client-cert-auth: false - - # Path to the peer server TLS trusted CA cert file. - trusted-ca-file: - - # Peer TLS using generated certificates. - auto-tls: false - etcd_debug: false etcd_logger: zap diff --git a/curve-ansible/roles/generate_config/templates/etcd.conf.yml.j2 b/curve-ansible/roles/generate_config/templates/etcd.conf.yml.j2 index e6b2290072..b6c5755a69 100644 --- a/curve-ansible/roles/generate_config/templates/etcd.conf.yml.j2 +++ b/curve-ansible/roles/generate_config/templates/etcd.conf.yml.j2 @@ -97,10 +97,6 @@ proxy-write-timeout: {{ etcd_proxy_write_timeout }} # Time (in milliseconds) for a read to timeout. proxy-read-timeout: {{ etcd_proxy_read_timeout }} -client-transport-security: {{ etcd_client_transport_security }} - -peer-transport-security: {{ etcd_peer_transport_security }} - # Enable debug-level logging for etcd. debug: {{ etcd_debug }} diff --git a/curve-ansible/roles/install_package/defaults/main.yml b/curve-ansible/roles/install_package/defaults/main.yml index e3d8942f58..035aabcab7 100644 --- a/curve-ansible/roles/install_package/defaults/main.yml +++ b/curve-ansible/roles/install_package/defaults/main.yml @@ -17,37 +17,25 @@ install_with_deb: false tmp_dir: /tmp/curve-ansible-tmp-files +curve_bin_dir: /usr/bin +curve_lib_dir: /usr/lib +curve_include_dir: /usr/include +curvefs_dir: /usr/curvefs local_mds_package_path: ../curve-mds mds_remote_tmp_dir: /tmp/mds -mds_bin_dir: /usr/bin -mds_lib_dir: /usr/lib mds_log_dir: /data/log/curve/mds local_chunkserver_package_path: ../curve-chunkserver -chunkserver_bin_dir: /usr/bin local_aws_sdk_package_path: ../aws-sdk -aws_sdk_lib_dir: /usr/lib -aws_sdk_include_dir: /usr/include local_curve_sdk_package_path: ../curve-sdk -curve_sdk_bin_dir: /usr/bin -curve_sdk_lib_dir: /usr/lib -curve_sdk_include_dir: /usr/include -curve_sdk_curvefs_dir: /usr/curvefs local_nebd_package_path: ../../nebd-package -nebd_bin_dir: /usr/bin -nebd_lib_dir: /usr/lib local_nbd_package_path: ../../nbd-package -nbd_bin_dir: /usr/bin -snapshot_bin_dir: /usr/bin snapshot_clone_server_log_dir: /data/log/curve/snapshotclone -snapshotcloneserver_bin_dir: /usr/bin local_snapshotcloneserver_package_path: ../curve-snapshotcloneserver -snapshotcloneserver_lib_dir: /usr/lib local_snapshotcloneserver_nginx_package_path: ../curve-nginx snapshotcloneserver_nginx_dir: /etc/curve/nginx local_tool_package_path: ../curve-tools -tool_bin_dir: /usr/bin etcd_download_url: https://github.com/etcd-io/etcd/releases/download @@ -55,7 +43,9 @@ etcd_version: v3.4.0 etcd_download_dir: /tmp install_etcd_dir: /usr/bin -lib_download_dir: /tmp +download_dir: /tmp libunwind_download_url: http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz -jemalloc_download_url: https://github.com/jemalloc/jemalloc/releases/download/jemalloc-3.6.0.tar.bz2 +jemalloc_download_url: https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2 +lib_install_prefix: /usr/local libnl_download_url: http://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz +daemon_download_url: http://libslack.org/daemon/download/daemon-0.6.4.tar.gz diff --git a/curve-ansible/roles/install_package/tasks/include/determine_if_lib_installed.yml b/curve-ansible/roles/install_package/tasks/include/determine_if_lib_installed.yml new file mode 100644 index 0000000000..dbfbc52e49 --- /dev/null +++ b/curve-ansible/roles/install_package/tasks/include/determine_if_lib_installed.yml @@ -0,0 +1,26 @@ +--- +# +# Copyright (c) 2020 NetEase Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +- name: determine if lib installed + ignore_errors: true + shell: /sbin/ldconfig -p | grep {{ lib_name }} + register: ldconfig_res + +- name: set lib_installed + set_fact: + lib_installed: true + when: ldconfig_res.stdout != "" diff --git a/curve-ansible/roles/install_package/tasks/include/install_aws-sdk.yml b/curve-ansible/roles/install_package/tasks/include/install_aws-sdk.yml index db9bc5fbab..80362a6f62 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_aws-sdk.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_aws-sdk.yml @@ -17,14 +17,14 @@ - name: install aws-sdk lib vars: - remote_dir_name: "{{ aws_sdk_lib_dir }}" + remote_dir_name: "{{ curve_lib_dir }}" local_file_path: "{{ local_aws_sdk_package_path }}/lib/" file_mode: 0644 include_tasks: copy_file_to_remote.yml - name: install aws-sdk include vars: - remote_dir_name: "{{ aws_sdk_include_dir }}" + remote_dir_name: "{{ curve_include_dir }}" local_file_path: "{{ local_aws_sdk_package_path }}/include/" file_mode: 0644 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-chunkserver.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-chunkserver.yml index 7c6bfc14c5..37fd30aaa1 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-chunkserver.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-chunkserver.yml @@ -18,18 +18,18 @@ - name: install libunwind vars: lib_name: libunwind - lib_download_url: "{{ libunwind_download_url }}" + download_url: "{{ libunwind_download_url }}" include_tasks: install_lib_with_source_code.yml - name: install jemalloc vars: lib_name: jemalloc - lib_download_url: "{{ jemalloc_download_url }}" + download_url: "{{ jemalloc_download_url }}" include_tasks: install_lib_with_source_code.yml - name: install chunkserver bin vars: - remote_dir_name: "{{ chunkserver_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_chunkserver_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml @@ -37,6 +37,7 @@ - name: generate chunkserver_ctl.sh vars: enable_chunkfilepool: "{{ chunkserver_format_disk }}" + jemalloc_path: "{{ lib_install_prefix }}/lib/libjemalloc.so.1" template: src=chunkserver_ctl.sh.j2 dest={{ deploy_dir }}/chunkserver_ctl.sh mode=0755 - name: generate chunkserver_deploy.sh diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-mds.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-mds.yml index 00bdb87383..560b9ae164 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-mds.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-mds.yml @@ -24,16 +24,19 @@ - name: install libuuid include_tasks: install_libuuid.yml +- name: install daemon + include_tasks: install_daemon.yml + - name: install mds bin vars: - remote_dir_name: "{{ mds_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_mds_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml - name: install mds lib vars: - remote_dir_name: "{{ mds_lib_dir }}" + remote_dir_name: "{{ curve_lib_dir }}" local_file_path: "{{ local_mds_package_path }}/lib/" file_mode: 0644 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml index c524dd0031..325eda6f43 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml @@ -29,7 +29,7 @@ - name: install nbd bin vars: - remote_dir_name: "{{ nbd_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_nbd_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-sdk.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-sdk.yml index bcc2f89c6f..80353c5322 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-sdk.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-sdk.yml @@ -23,28 +23,28 @@ - name: install curve-sdk bin vars: - remote_dir_name: "{{ curve_sdk_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_curve_sdk_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml - name: install curve-sdk lib vars: - remote_dir_name: "{{ curve_sdk_lib_dir }}" + remote_dir_name: "{{ curve_lib_dir }}" local_file_path: "{{ local_curve_sdk_package_path }}/lib/" file_mode: 0644 include_tasks: copy_file_to_remote.yml - name: install curve-sdk include vars: - remote_dir_name: "{{ curve_sdk_include_dir }}" + remote_dir_name: "{{ curve_include_dir }}" local_file_path: "{{ local_curve_sdk_package_path }}/include/" file_mode: 0644 include_tasks: copy_file_to_remote.yml - name: install curve-sdk curvefs vars: - remote_dir_name: "{{ curve_sdk_curvefs_dir }}" + remote_dir_name: "{{ curvefs_dir }}" local_file_path: "{{ local_curve_sdk_package_path }}/curvefs/" file_mode: 0644 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-snapshotcloneserver.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-snapshotcloneserver.yml index 406c0340f7..545126db05 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-snapshotcloneserver.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-snapshotcloneserver.yml @@ -24,16 +24,19 @@ - name: install libuuid include_tasks: install_libuuid.yml +- name: install daemon + include_tasks: install_daemon.yml + - name: install snapshotcloneserver bin vars: - remote_dir_name: "{{ snapshotcloneserver_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_snapshotcloneserver_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml - name: install snapshotcloneserver lib vars: - remote_dir_name: "{{ snapshotcloneserver_lib_dir}}" + remote_dir_name: "{{ curve_lib_dir}}" local_file_path: "{{ local_snapshotcloneserver_package_path }}/lib/" file_mode: 0644 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-tools.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-tools.yml index b972f24316..afc1139d6d 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-tools.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-tools.yml @@ -17,7 +17,7 @@ - name: install tool bin vars: - remote_dir_name: "{{ tool_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_tool_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml diff --git a/curve-ansible/roles/install_package/tasks/include/install_daemon.yml b/curve-ansible/roles/install_package/tasks/include/install_daemon.yml new file mode 100644 index 0000000000..cf85fa8119 --- /dev/null +++ b/curve-ansible/roles/install_package/tasks/include/install_daemon.yml @@ -0,0 +1,32 @@ +--- +# +# Copyright (c) 2020 NetEase Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +- name: determine if daemon installed + ignore_errors: true + shell: daemon --version + register: daemon_res + +- name: set daemon_installed + set_fact: + daemon_installed: true + when: daemon_res.rc == 0 + +- name: install lib if not installed + vars: + download_url: "{{ daemon_download_url }}" + include_tasks: install_with_source_code.yml + when: not daemon_installed diff --git a/curve-ansible/roles/install_package/tasks/include/install_etcd.yml b/curve-ansible/roles/install_package/tasks/include/install_etcd.yml index 7f7e101068..0d1cca0ac7 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_etcd.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_etcd.yml @@ -24,6 +24,9 @@ register: etcd_version_res when: stat_etcd_res.stat.exists +- name: install daemon + include_tasks: install_daemon.yml + - name: install etcd if etcd not installed or version not match block: - name: download etcd diff --git a/curve-ansible/roles/install_package/tasks/include/install_lib_with_source_code.yml b/curve-ansible/roles/install_package/tasks/include/install_lib_with_source_code.yml index 884bb12d3d..4e38a0b070 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_lib_with_source_code.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_lib_with_source_code.yml @@ -20,37 +20,16 @@ shell: /sbin/ldconfig -p | grep {{ lib_name }} register: ldconfig_res -- name: set lib_installed +- name: set lib_installed true set_fact: lib_installed: true when: ldconfig_res.stdout != "" -- name: install lib when not installed - block: - - name: download lib - get_url: - url: "{{ download_url }}" - dest: "{{ lib_download_dir }}" - validate_certs: no - timeout: 60 - register: get_url_result - until: not get_url_result.failed - retries: 5 - delay: 3 - - - name: unarchive lib - unarchive: - remote_src: true - list_files: true - src: "{{ get_url_result.dest }}" - dest: "{{ lib_download_dir }}" - register: unarchive_result - - - name: get unarcive dir - shell: echo "{{ get_url_result.dest }}" | awk -F "." '{print $1}' +- name: set lib_installed false + set_fact: + lib_installed: false + when: ldconfig_res.stdout == "" - - name: install lib - shell: > - chdir="{{ lib_download_dir }}/{{ unarchive_result.files[0] }}" - ./configure && make && sudo make install +- name: install lib if not installed + include_tasks: install_with_source_code.yml when: not lib_installed diff --git a/curve-ansible/roles/install_package/tasks/include/install_nebd.yml b/curve-ansible/roles/install_package/tasks/include/install_nebd.yml index 028e0ea400..a5c7a21fa7 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_nebd.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_nebd.yml @@ -24,9 +24,12 @@ - name: install jemalloc vars: lib_name: jemalloc - lib_download_url: "{{ jemalloc_download_url }}" + download_url: "{{ jemalloc_download_url }}" include_tasks: install_lib_with_source_code.yml +- name: install daemon + include_tasks: install_daemon.yml + - name: prepare date dir vars: dir_name: "{{ nebd_data_dir }}" @@ -34,24 +37,34 @@ - name: prepare log dir vars: - dir_name: "{{ nebd_log_dir }}" + dir_name: "{{ nebd_log_dir }}/{{ item }}" + include_tasks: common_tasks/create_dir.yml + with_items: + - client + - server + +- name: prepare lock dir + vars: + dir_name: "{{ nebd_data_dir }}/lock" include_tasks: common_tasks/create_dir.yml - name: install nebd bin vars: - remote_dir_name: "{{ nebd_bin_dir }}" + remote_dir_name: "{{ curve_bin_dir }}" local_file_path: "{{ local_nebd_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml - name: install nebd lib vars: - remote_dir_name: "{{ nebd_lib_dir }}" + remote_dir_name: "{{ curve_lib_dir }}/nebd" local_file_path: "{{ local_nebd_package_path }}/lib/" file_mode: 0644 include_tasks: copy_file_to_remote.yml - name: generate nebd-daemon + vars: + jemalloc_path: "{{ lib_install_prefix }}/lib/libjemalloc.so.1" local_action: template src=nebd-daemon.j2 dest=/tmp/nebd-daemon mode=0755 - name: copy nebd-daemon @@ -60,7 +73,3 @@ local_file_path: "/tmp/nebd-daemon" file_mode: 0755 include_tasks: copy_file_to_remote.yml - -- name: register nebd to init - shell: sudo cp /usr/bin/nebd-daemon /etc/init.d && sudo update-rc.d nebd-daemon defaults - diff --git a/curve-ansible/roles/install_package/tasks/include/install_with_source_code.yml b/curve-ansible/roles/install_package/tasks/include/install_with_source_code.yml new file mode 100644 index 0000000000..17141302c9 --- /dev/null +++ b/curve-ansible/roles/install_package/tasks/include/install_with_source_code.yml @@ -0,0 +1,43 @@ +--- +# +# Copyright (c) 2020 NetEase Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +- name: download + get_url: + url: "{{ download_url }}" + dest: "{{ download_dir }}" + validate_certs: no + timeout: 60 + register: get_url_result + until: not get_url_result.failed + retries: 5 + delay: 3 + +- name: unarchive + unarchive: + remote_src: true + list_files: true + src: "{{ get_url_result.dest }}" + dest: "{{ download_dir }}" + register: unarchive_result + +- name: get unarcive dir + shell: echo "{{ get_url_result.dest }}" | awk -F "." '{print $1}' + +- name: install lib + shell: > + chdir="{{ download_dir }}/{{ unarchive_result.files[0] }}" + sudo ./configure --prefix={{ lib_install_prefix }} && sudo make && sudo make install diff --git a/curve-ansible/roles/install_package/templates/chunkserver_ctl.sh.j2 b/curve-ansible/roles/install_package/templates/chunkserver_ctl.sh.j2 index e29e027bd9..f930d564cb 100644 --- a/curve-ansible/roles/install_package/templates/chunkserver_ctl.sh.j2 +++ b/curve-ansible/roles/install_package/templates/chunkserver_ctl.sh.j2 @@ -115,7 +115,7 @@ function start_one() { return 1 fi - jemallocpath=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 + jemallocpath={{ jemalloc_path }} # 检查jemalloc库文件 if [ ! -f ${jemallocpath} ] then diff --git a/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 b/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 index 70cf5bcfcc..4a02cc3eee 100644 --- a/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 +++ b/curve-ansible/roles/install_package/templates/mds-daemon.sh.j2 @@ -1,7 +1,7 @@ #!/bin/bash # curve-mds路径 -curveBin={{ mds_bin_dir }}/curve-mds +curveBin={{ curve_bin_dir }}/curve-mds # 默认配置文件 confPath={{ mds_config_path }} diff --git a/curve-ansible/roles/install_package/templates/nebd-daemon.j2 b/curve-ansible/roles/install_package/templates/nebd-daemon.j2 index cca6b7064d..77960c1916 100644 --- a/curve-ansible/roles/install_package/templates/nebd-daemon.j2 +++ b/curve-ansible/roles/install_package/templates/nebd-daemon.j2 @@ -18,7 +18,7 @@ then fi # nebd-server路径 -bin={{ nebd_bin_dir }}/nebd-server +bin={{ curve_bin_dir }}/nebd-server # 默认配置文件 confPath={{ nebd_server_config_path }} @@ -103,7 +103,7 @@ function start() { exit 1 fi - jemallocpath=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 + jemallocpath={{ jemalloc_path }} # 检查jemalloc库文件 if [ ! -f ${jemallocpath} ] then diff --git a/curve-ansible/roles/install_package/vars/main.yml b/curve-ansible/roles/install_package/vars/main.yml index b9cf87817e..42e523d9ce 100644 --- a/curve-ansible/roles/install_package/vars/main.yml +++ b/curve-ansible/roles/install_package/vars/main.yml @@ -18,3 +18,5 @@ # 包的名称 package_name: package_version: +lib_installed: false +daemon_installed: false diff --git a/curve-ansible/server.ini b/curve-ansible/server.ini index ce0aac6dcb..d175a8bbac 100644 --- a/curve-ansible/server.ini +++ b/curve-ansible/server.ini @@ -106,3 +106,7 @@ s3_sk="" ansible_ssh_port=22 curve_root_username=root curve_root_password=root_password +curve_bin_dir=/usr/bin +curve_lib_dir=/usr/lib +curve_include_dir=/usr/include +lib_install_prefix=/usr/local diff --git a/tools/curvefsTool.cpp b/tools/curvefsTool.cpp index 9b992afa6f..4dbbd81dfd 100644 --- a/tools/curvefsTool.cpp +++ b/tools/curvefsTool.cpp @@ -200,8 +200,8 @@ int CurvefsTools::Init() { return kRetCodeCommonErr; } } - mdsAddressIndex_ = -1; - return 0; + mdsAddressIndex_ = -1; + return 0; } int CurvefsTools::TryAnotherMdsAddress() { @@ -307,6 +307,7 @@ int CurvefsTools::ScanLogicalPool() { } } } + return 0; } int CurvefsTools::ListLogicalPool(const std::string& phyPoolName, @@ -399,6 +400,7 @@ int CurvefsTools::ReadClusterMap() { << FLAGS_cluster_map << " fail."; return -1; } + return 0; } int CurvefsTools::InitServerData() {