airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [6/9] airavata git commit: successfully started mesos-master with zookeeper ring
Date Sat, 24 Sep 2016 01:49:40 GMT
successfully started mesos-master with zookeeper ring


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/1ae82630
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/1ae82630
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/1ae82630

Branch: refs/heads/develop
Commit: 1ae8263079fc45fbff6be88706675ed239c973f3
Parents: 223ea3a
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Sun Sep 11 01:23:50 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Sun Sep 11 01:23:50 2016 -0400

----------------------------------------------------------------------
 group_vars/all.yml                      |  2 +-
 hosts                                   | 10 ++-
 roles/java/tasks/main.yml               | 21 ++++++
 roles/java/vars/main.yml                | 15 +++++
 roles/mesos-master/tasks/main.yml       | 38 ++++-------
 roles/mesos-master/templates/myid.j2    |  1 -
 roles/mesos-master/templates/zk.j2      |  2 +-
 roles/mesos-master/templates/zoo.cfg.j2 | 32 ---------
 roles/mesos-slave/templates/zk.j2       |  2 +-
 roles/zookeeper/handlers/main.yml       | 15 +++++
 roles/zookeeper/tasks/main.yml          | 98 ++++++++++++++++++++++++++++
 roles/zookeeper/templates/myid.j2       |  1 +
 roles/zookeeper/templates/zoo.cfg.j2    | 32 +++++++++
 roles/zookeeper/vars/main.yml           | 15 +++++
 site.yml                                | 16 +++--
 15 files changed, 229 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/group_vars/all.yml
----------------------------------------------------------------------
diff --git a/group_vars/all.yml b/group_vars/all.yml
index b0a6cf2..f7d7ae5 100644
--- a/group_vars/all.yml
+++ b/group_vars/all.yml
@@ -19,7 +19,7 @@ user_home: "/home/{{user}}"
 
 
 #Zookeeper related properties
-zk_client_port: 2181
+zookeeper_client_port: 2181
 # zookeeper_servers:
 #   - { index: 1, ip: "", ports: "2888:3888"}
 #   - { index: 2, ip: "", ports: "2888:3888"}

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/hosts
----------------------------------------------------------------------
diff --git a/hosts b/hosts
index 7ceb1f7..cc90239 100644
--- a/hosts
+++ b/hosts
@@ -1,9 +1,13 @@
 ---
 # inventory fie: production
 #[localhost]
-#127.0.0.1
+127.0.0.1
 
 [mesos-master]
-52.91.222.138
+52.87.208.230 my_id=1
+54.172.21.138 my_id=2
+54.196.170.54 my_id=3
 
-#[mesos-agent]
+
+[mesos-slave]
+54.175.143.203

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/java/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/java/tasks/main.yml b/roles/java/tasks/main.yml
new file mode 100644
index 0000000..92f2039
--- /dev/null
+++ b/roles/java/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+# Install Orcal Java
+- name: download oracle java 8 rpm
+  get_url: url="{{ java_rpm_url }}" dest="{{ java_dir_source }}" headers='Cookie:oraclelicense=accept-securebackup-cookie'
+  become: yes
+
+- name: Install oracle java 8
+  yum: name="{{ java_dir_source }}/{{ java_rpm_filename }}" state=present
+  become: yes
+
+- name: set Oracle Java {{ java_version_string }} as default
+  alternatives:
+    name="{{ item.exe }}"
+    link="/usr/bin/{{ item.exe }}"
+    path="{{ item.path }}/{{ item.exe }}"
+  with_items:
+    - { path: "{{ java_home }}/jre/bin", exe: 'java' }
+    - { path: "{{ java_home }}/jre/bin", exe: 'keytool' }
+    - { path: "{{ java_home }}/bin", exe: 'javac' }
+    - { path: "{{ java_home }}/bin", exe: 'javadoc' }
+  become: yes

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/java/vars/main.yml
----------------------------------------------------------------------
diff --git a/roles/java/vars/main.yml b/roles/java/vars/main.yml
new file mode 100644
index 0000000..a995684
--- /dev/null
+++ b/roles/java/vars/main.yml
@@ -0,0 +1,15 @@
+---
+#Variables associated with this role
+# Oracle Java 8
+java_dir_source: "/usr/local/src"
+
+java_version: 8
+java_version_update: 91
+java_version_build: '14'
+java_version_string: "1.{{ java_version }}.0_{{ java_version_update }}"
+java_home: "/usr/java/jdk1.{{ java_version }}.0_{{ java_version_update }}"
+
+java_rpm_filename: "jdk-{{ java_version }}u{{ java_version_update }}-linux-x64.rpm"
+java_rpm_url: "http://download.oracle.com/otn-pub/java/jdk/{{ java_version }}u{{ java_version_update
}}-b{{ java_version_build }}/{{ java_rpm_filename }}"
+
+...

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/mesos-master/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/mesos-master/tasks/main.yml b/roles/mesos-master/tasks/main.yml
index e132915..6afefe1 100644
--- a/roles/mesos-master/tasks/main.yml
+++ b/roles/mesos-master/tasks/main.yml
@@ -21,13 +21,21 @@
     state: enabled
     immediate: yes
   with_items:
-    - "{{ zk_client_port }}/tcp"
-    - "2888/tcp"
-    - "3888/tcp"
+    # - "{{ zk_client_port }}/tcp"
+    # - "2888/tcp"
+    # - "3888/tcp"
     - "5050/tcp"
     # - "marathon/tcp"
   become: yes
 
+- name: install utility - TODO delete this
+  yum:
+    name: "{{ item }}"
+    state: latest
+  with_items:
+    - vim
+  become: yes
+
 # Setup repository
 - name: add mesosphere rpm
   yum:
@@ -35,37 +43,17 @@
     state: present
   become: yes
 
-- name: install mesos , marathon and mesosphere-zookeeper
+- name: install mesos and marathon
   yum:
     name: "{{ item }}"
     state: latest
   with_items:
     - mesos
     - marathon
-    - mesosphere-zookeeper
+    # - mesosphere-zookeeper
   become: yes
 
 # configurations
-#setting ID
-- name: copy myid file
-  template:
-    src: myid.j2
-    dest: /var/lib/zookeeper/myid
-    force: yes
-  become: yes
-
-- name: append zookeeper ring ips
-  template:
-    src: zoo.cfg.j2
-    dest: /etc/zookeeper/conf/zoo.cfg
-    force: yes
-  become: yes
-
-- name: start Zookeeper
-  service:
-    name: zookeeper
-    state: started
-  become: yes
 
 - name: set zk file for mesos master and marathon
   template:

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/mesos-master/templates/myid.j2
----------------------------------------------------------------------
diff --git a/roles/mesos-master/templates/myid.j2 b/roles/mesos-master/templates/myid.j2
deleted file mode 100644
index 78a0bd7..0000000
--- a/roles/mesos-master/templates/myid.j2
+++ /dev/null
@@ -1 +0,0 @@
-{{ my_id }}

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/mesos-master/templates/zk.j2
----------------------------------------------------------------------
diff --git a/roles/mesos-master/templates/zk.j2 b/roles/mesos-master/templates/zk.j2
index 9c7747b..e82fe65 100644
--- a/roles/mesos-master/templates/zk.j2
+++ b/roles/mesos-master/templates/zk.j2
@@ -1 +1 @@
-zk://{{zk_1}}:{{zk_client_port}},{{zk_2}}:{{zk_client_port}},{{zk_3}}:{{zk_client_port}}/mesos
+zk://{{zk_1}}:{{zookeeper_client_port}},{{zk_2}}:{{zookeeper_client_port}},{{zk_3}}:{{zookeeper_client_port}}/mesos

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/mesos-master/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/roles/mesos-master/templates/zoo.cfg.j2 b/roles/mesos-master/templates/zoo.cfg.j2
deleted file mode 100644
index 922d0b2..0000000
--- a/roles/mesos-master/templates/zoo.cfg.j2
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-
-maxClientCnxns=50
-# The number of milliseconds of each tick
-tickTime=2000
-# The number of ticks that the initial
-# synchronization phase can take
-initLimit=10
-# The number of ticks that can pass between
-# sending a request and getting an acknowledgement
-syncLimit=5
-# the directory where the snapshot is stored.
-dataDir=/var/lib/zookeeper
-# the port at which the clients will connect
-clientPort={{ zk_client_port }}
-
-server.1={{zk_1}}:2888:3888
-server.2={{zk_2}}:2888:3888
-server.3={{zk_3}}:2888:3888

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/mesos-slave/templates/zk.j2
----------------------------------------------------------------------
diff --git a/roles/mesos-slave/templates/zk.j2 b/roles/mesos-slave/templates/zk.j2
index 9c7747b..e82fe65 100644
--- a/roles/mesos-slave/templates/zk.j2
+++ b/roles/mesos-slave/templates/zk.j2
@@ -1 +1 @@
-zk://{{zk_1}}:{{zk_client_port}},{{zk_2}}:{{zk_client_port}},{{zk_3}}:{{zk_client_port}}/mesos
+zk://{{zk_1}}:{{zookeeper_client_port}},{{zk_2}}:{{zookeeper_client_port}},{{zk_3}}:{{zookeeper_client_port}}/mesos

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/zookeeper/handlers/main.yml
----------------------------------------------------------------------
diff --git a/roles/zookeeper/handlers/main.yml b/roles/zookeeper/handlers/main.yml
new file mode 100644
index 0000000..f1ea4be
--- /dev/null
+++ b/roles/zookeeper/handlers/main.yml
@@ -0,0 +1,15 @@
+---
+- name: start zookeeper
+  command: bin/zkServer.sh start
+  args:
+    chdir: "{{zookeeper_dir}}"
+
+- name: restart zookeeper
+  command: bin/zkServer.sh restart
+  args:
+    chdir: "{{zookeeper_dir}}"
+
+- name: stop zookeeper
+  command: bin/zkServer.sh stop
+  args:
+    chdir: "{{zookeeper_dir}}"

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/zookeeper/tasks/main.yml
----------------------------------------------------------------------
diff --git a/roles/zookeeper/tasks/main.yml b/roles/zookeeper/tasks/main.yml
new file mode 100644
index 0000000..02c246f
--- /dev/null
+++ b/roles/zookeeper/tasks/main.yml
@@ -0,0 +1,98 @@
+---
+- name: install pre-requities
+  yum:
+    name: "{{item}}"
+    state: latest
+  with_items:
+    - firewalld
+    - vim
+  become: yes
+
+- name: start firewalld
+  service:
+    name: firewalld
+    state: started
+  become: yes
+
+- name: open zookeeper port
+  firewalld:
+    port: "{{item}}"
+    zone: public
+    permanent: true
+    state: enabled
+    immediate: yes
+  with_items:
+    - "{{zookeeper_client_port}}/tcp"
+    - 2888/tcp
+    - 3888/tcp
+  become: yes
+
+# - name: get ip4 address
+#   command: hostname -i
+#   register: _ip4
+#   tags: ttt
+
+# - debug:
+#     msg: "{{_ip4.stdout}}"
+#   tags: ttt
+
+######################
+- name: Download and unarchive zookeeper
+  unarchive:
+    src: "{{ zookeeper_url }}"
+    dest: /opt
+    copy: no
+    creates: /opt/zookeeper-{{ zookeeper_version }}
+    owner: "{{ user }}"
+    group: "{{ group }}"
+  become: yes
+
+- name: Link to Zookeeper Directory
+  file:
+    src: "/opt/zookeeper-{{ zookeeper_version }}"
+    dest: "{{zookeeper_dir}}"
+    state: link
+    force: yes
+  become: yes
+
+- name: Create Zookeeper Log Dir
+  file:
+    path: "{{zookeeper_log_dir}}"
+    owner: "{{ user }}"
+    group: "{{ group }}"
+    recurse: yes
+    state: directory
+    mode: 0644
+  become: yes
+
+- name: Create Zookeeper DataStore Dir
+  file:
+    path: "{{zookeeper_datastore_dir}}"
+    owner: "{{ user }}"
+    group: "{{ group }}"
+    recurse: yes
+    state: directory
+    mode: 0755
+  become: yes
+
+- name: Copy zoo.cfg file
+  template:
+    src: zoo.cfg.j2
+    # dest: "{{zookeeper_conf_dir}}/zoo.cfg"
+    dest: "{{zookeeper_dir}}/conf/zoo.cfg"
+    owner: "{{ user }}"
+    group: "{{ group }}"
+    mode: "u=rw,g=r,o=r"
+  notify:
+    - restart zookeeper
+
+
+- name: Copy myid file
+  template:
+    src: myid.j2
+    dest: "{{zookeeper_datastore_dir}}/myid"
+    owner: "{{ user }}"
+    group: "{{ group }}"
+    mode: "u=rw,g=r,o=r"
+  notify:
+    - restart zookeeper

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/zookeeper/templates/myid.j2
----------------------------------------------------------------------
diff --git a/roles/zookeeper/templates/myid.j2 b/roles/zookeeper/templates/myid.j2
new file mode 100644
index 0000000..78a0bd7
--- /dev/null
+++ b/roles/zookeeper/templates/myid.j2
@@ -0,0 +1 @@
+{{ my_id }}

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/zookeeper/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/roles/zookeeper/templates/zoo.cfg.j2 b/roles/zookeeper/templates/zoo.cfg.j2
new file mode 100644
index 0000000..4845a71
--- /dev/null
+++ b/roles/zookeeper/templates/zoo.cfg.j2
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+maxClientCnxns=50
+# The number of milliseconds of each tick
+tickTime=2000
+# The number of ticks that the initial
+# synchronization phase can take
+initLimit=10
+# The number of ticks that can pass between
+# sending a request and getting an acknowledgement
+syncLimit=5
+# the directory where the snapshot is stored.
+dataDir={{zookeeper_datastore_dir}}
+# the port at which the clients will connect
+clientPort={{zookeeper_client_port}}
+
+{% for server in zookeeper_servers %}
+server.{{ server.id }}={{ server.ip }}:2888:3888
+{% endfor %}

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/roles/zookeeper/vars/main.yml
----------------------------------------------------------------------
diff --git a/roles/zookeeper/vars/main.yml b/roles/zookeeper/vars/main.yml
new file mode 100644
index 0000000..07f9ca1
--- /dev/null
+++ b/roles/zookeeper/vars/main.yml
@@ -0,0 +1,15 @@
+---
+zookeeper_version: 3.4.8
+#zookeeper_conf_dir: /etc/zookeeper/conf
+zookeeper_log_dir: /var/log/zookeeper
+zookeeper_datastore_dir: /var/lib/zookeeper
+zookeeper_url: http://www.us.apache.org/dist/zookeeper/zookeeper-{{zookeeper_version}}/zookeeper-{{zookeeper_version}}.tar.gz
+zookeeper_dir: /opt/zookeeper
+#zookeeper_client_port: 2181
+
+zookeeper_servers:
+  - {id: "1", ip: "172.31.24.149"}
+  - {id: "2", ip: "172.31.19.49"}
+  - {id: "3", ip: "172.31.25.80"}
+#exhibitor_version: 1.5.5
+#exhibitor_install_dir: /opt/exhibitor

http://git-wip-us.apache.org/repos/asf/airavata/blob/1ae82630/site.yml
----------------------------------------------------------------------
diff --git a/site.yml b/site.yml
index 4020f15..17258bd 100644
--- a/site.yml
+++ b/site.yml
@@ -1,17 +1,19 @@
 ---
 - hosts: localhost
-  tags: test
+  tags: ec2
   roles:
-    - test
+    - ec2
 
 - hosts: mesos-master
-  tags: mesos
+  tags: mesos, mesos-master
   roles:
-    - mesos
+    - java
+    - zookeeper
+    - mesos-master
 
-- hosts: mesos-master
-  tags: mesosyum
+- hosts: mesos-slave
+  tags: mesos, mesos-slave
   roles:
-    - mesos-yum
+    - mesos-slave
 
 ...


Mime
View raw message