leo-project / leofs_ansible

LeoFS' Ansible for deployment and operation of LeoFS
https://github.com/leo-project/leofs
3 stars 4 forks source link

/erlang/18.3/activate: No such file or directory #4

Open patsevanton opened 5 years ago

patsevanton commented 5 years ago

Hello!

TASK [builder : Build LeoFS (Selected Branch)] ***************************************************************************************************************************************************************
fatal: [172.26.9.28]: FAILED! => {
    "changed": true, 
    "rc": 2
}

STDOUT:

/home/centos/.ansible/tmp/ansible-tmp-1571310720.6-245725389908377/build_custom.sh: line 12: /erlang/18.3/activate: No such file or directory
/home/centos/.ansible/tmp/ansible-tmp-1571310720.6-245725389908377/build_custom.sh: line 15: git: command not found
/home/centos/.ansible/tmp/ansible-tmp-1571310720.6-245725389908377/build_custom.sh: line 16: cd: /tmp/leofs_builder: No such file or directory
/home/centos/.ansible/tmp/ansible-tmp-1571310720.6-245725389908377/build_custom.sh: line 19: git: command not found
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `release'.  Stop.

cat hosts

# Please check roles/common/vars/leofs_releases for available versions
[all:vars]
leofs_version=1.2.22
build_temp_path="/tmp/leofs_builder"
build_install_path="/tmp/"
build_branch="master"
source="package"

[builder]
172.26.9.28

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_0]
172.26.9.29

# nodename of leo_manager_0 and leo_manager_1 are set at group_vars/all
[leo_manager_1]
172.26.9.30

[leo_storage]
172.26.9.31 leofs_module_nodename=S0@172.26.9.31
172.26.9.32 leofs_module_nodename=S1@172.26.9.32
172.26.9.33 leofs_module_nodename=S2@172.26.9.33

[leo_gateway]
172.26.9.34 leofs_module_nodename=G0@172.26.9.34

[leofs_nodes:children]
leo_manager_0
leo_manager_1
leo_gateway
leo_storage
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.28 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.31 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.30 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.34 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.32 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
172.26.9.33 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}
alexfrolov commented 4 years ago

Hi, you should install git on the builder host.

patsevanton commented 4 years ago

1) Disable selinux 2) Install on all nodes gcc glibc-devel make ncurses-devel openssl-devel autoconf curl git cmake check check-devel automake systemd-devel patch gcc-c++ redhat-lsb-core nmap-ncat rpm-build lzo-devel sysstat wget sudo nc

3) Run ansible-playbook -i hosts build_leofs.yml

Output:

TASK [builder : Build LeoFS (Selected Branch)] ***************************************************************************************************************************************************************
fatal: [172.26.9.157]: FAILED! => {
    "changed": true, 
    "rc": 2
}

STDOUT:

Cloning into '/tmp/leofs_builder'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 12118 (delta 26), reused 21 (delta 4), pack-reused 12059
Receiving objects: 100% (12118/12118), 30.73 MiB | 17.05 MiB/s, done.
Resolving deltas: 100% (7188/7188), done.
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'
/usr/bin/env: escript: No such file or directory
make: *** [deps] Error 127
for reltool_config in rel/leo_*/reltool.config.in; do \
    ./make_reltool.sh no $reltool_config > $(echo $reltool_config | sed s/.in$//); \
done
/usr/bin/env: escript: No such file or directory
make: *** [release] Error 127

STDERR:

Shared connection to 172.26.9.157 closed.

MSG:

non-zero return code
alexfrolov commented 4 years ago

Hi!

You should install erlang/otp into your building node. The Erlang rpm packages can be found here: https://github.com/rabbitmq/erlang-rpm/releases

I am using erlang 20.3.8.23. The latest ones do not work with LeoFS.

Best, Alex

patsevanton commented 4 years ago

1) Disable selinux 2) Install on all nodes gcc glibc-devel make ncurses-devel openssl-devel autoconf curl git cmake check check-devel automake systemd-devel patch gcc-c++ redhat-lsb-core nmap-ncat rpm-build lzo-devel sysstat wget sudo nc

3) install with yum erlang-20.3.8.23-1.el7.x86_64.rpm

---
- hosts: all
  gather_facts: False
  become: yes
  tasks:
    - name: Remote erlang-20.3.8.23-1.el7.x86_64.rpm install with yum
      yum: name=https://github.com/rabbitmq/erlang-rpm/releases/download/v20.3.8.23/erlang-20.3.8.23-1.el7.x86_64.rpm

4) ansible-playbook -i hosts build_leofs.yml 5) ansible-playbook -i hosts install_leofs.yml 6) ansible-playbook -i hosts config_leofs.yml Output:

TASK [common : Creates directory /usr/local/leofs/1.2.22//leo_manager_0//work/ord_reda/] *********************************************************************************************************************
failed: [172.26.9.166] (item=/usr/local/leofs/1.2.22//leo_manager_0//work/ord_reda/) => {
    "changed": false, 
    "gid": 0, 
    "group": "root", 
    "item": "/usr/local/leofs/1.2.22//leo_manager_0//work/ord_reda/", 
    "mode": "0755", 
    "owner": "root", 
    "path": "/usr/local/leofs/1.2.22//leo_manager_0//work/ord_reda/", 
    "secontext": "unconfined_u:object_r:usr_t:s0", 
    "size": 6, 
    "state": "directory", 
    "uid": 0
}
MSG:
chown failed: failed to look up user leofs

7) Create user group leofs:

---
- hosts: all
  gather_facts: False
  become: yes
  tasks:
    - group:
        name: leofs
        state: present
    - name: Add the user 'leofs', appending the group 'leofs' to the user's groups
      user:
        name: leofs
        groups: leofs
        append: yes

8) ansible-playbook -i hosts config_leofs.yml 9) ansible-playbook -i hosts start_leofs.yml Output:

TASK [leo_manager_0 : Run LeoManager (Primary)] **************************************************************************************************************************************************************
fatal: [172.26.9.166]: FAILED! => {
    "changed": true, 
    "cmd": [
        "bin/leo_manager", 
        "start"
    ], 
    "delta": "0:00:00.337194", 
    "end": "2019-11-27 05:14:25.311043", 
    "rc": 1, 
    "start": "2019-11-27 05:14:24.973849"
}

STDOUT:

vm.args needs to have either -name or -sname parameter.

STDERR:

mv: missing destination file operand after ‘/usr/local/leofs/1.2.22/leo_manager_0/etc/app.config’
Try 'mv --help' for more information.
mv: missing destination file operand after ‘/usr/local/leofs/1.2.22/leo_manager_0/etc/vm.args’
Try 'mv --help' for more information.
grep: /usr/local/leofs/1.2.22/leo_manager_0/etc/vm.args: No such file or directory

MSG:

non-zero return code
alexfrolov commented 4 years ago

I had the same problems with leofs. Try to use root.

patsevanton commented 4 years ago

I had the same problems with leofs. Try to use root.

What is root? Write become: yes to ansible-playbook?

patsevanton commented 4 years ago

New Create user group leofs:

---
- hosts: all
  gather_facts: False
  become: yes
  tasks:
    - group:
        name: leofs
        state: present

    - name: Allow 'wheel' group to have passwordless sudo
      lineinfile:
        dest: /etc/sudoers
        state: present
        regexp: '^%wheel'
        line: '%wheel ALL=(ALL) NOPASSWD: ALL'
        validate: 'visudo -cf %s'

    - name: Add the user 'leofs', appending the group 'leofs' to the user's groups
      user:
        name: leofs
        groups: wheel
        append: yes
patsevanton commented 4 years ago

Install netcat on localhost where run aplybook

yum install -y nc
patsevanton commented 4 years ago

Add become_user: root to every task in control.yml. For examle:

- name: Run LeoGateway
  command: bin/leo_gateway start
  become: true
  become_user: root
  when: control_leofs is defined and control_leofs == "start"
  args:
    chdir: "{{ leofs_module_path }}"
  tags:
      - run