Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdb1931

Browse files
committed
Fix postgres script. [ci skip]
1 parent c3acfd1 commit bdb1931

File tree

9 files changed

+82
-70
lines changed

9 files changed

+82
-70
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# file: roles/cdh_hive_mysql_metastore/tasks/main.yml
3+
4+
- name: create MySQL db 'metastore'
5+
mysql_db: name=metastore state=present
6+
login_user=root login_password=hive_{{ site_name }}
7+
tags:
8+
- mysql
9+
- hive
10+
11+
- name: init Hive metastore schema
12+
shell: mysql -uroot -phive_{{ site_name }} metastore < /usr/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-0.10.0.mysql.sql
13+
tags:
14+
- mysql
15+
- hive
16+
17+
- name: add and grant MySQL user 'hiveuser'
18+
mysql_user: name=hiveuser host=localhost password=hive_{{ site_name }} priv=metastore.*:ALL state=present
19+
login_user=root login_password=hive_{{ site_name }}
20+
tags:
21+
- mysql
22+
- hive
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
dependencies:
3+
- cdh_hive_common
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# file: roles/postgresql_metastore/tasks/main.yml
3+
4+
- name: create PostgreSQL db 'metastore'
5+
sudo: true
6+
sudo_user: postgres
7+
postgresql_db: name=metastore
8+
tags:
9+
- postgres
10+
- hive
11+
12+
- name: add PostgreSQL user 'hiveuser'
13+
sudo: true
14+
sudo_user: postgres
15+
postgresql_user: db=metastore name=hiveuser password=hive_{{ site_name }} priv=CONNECT
16+
tags:
17+
- postgres
18+
- hive
19+
20+
- name: init Hive metastore schema
21+
sudo: true
22+
sudo_user: postgres
23+
shell: psql --dbname=metastore --file=/usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
24+
tags:
25+
- postgres
26+
- hive
27+
28+
- name: grant PostgreSQL user 'hiveuser'
29+
sudo: true
30+
sudo_user: postgres
31+
shell: psql --dbname=metastore --command="GRANT ALL ON ALL TABLES IN SCHEMA public TO hiveuser;"
32+
tags:
33+
- postgres
34+
- hive

roles/mysql_server/tasks/main.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,4 @@
1414
- libmysql-java
1515
- python-mysqldb
1616
tags:
17-
- mysql
18-
19-
- name: create MySQL db 'metastore'
20-
mysql_db: name=metastore state=present
21-
login_user=root login_password=hive_{{ site_name }}
22-
tags:
23-
- mysql
24-
- hive
25-
26-
- name: init Hive metastore schema
27-
shell: mysql -uroot -phive_{{ site_name }} metastore < /usr/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-0.10.0.mysql.sql
28-
tags:
29-
- mysql
30-
- hive
31-
32-
- name: add and grant MySQL user 'hiveuser'
33-
mysql_user: name=hiveuser host=localhost password=hive_{{ site_name }} priv=metastore.*:ALL state=present
34-
login_user=root login_password=hive_{{ site_name }}
35-
tags:
36-
- mysql
37-
- hive
17+
- mysql

roles/postgresql_server/tasks/main.yml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,4 @@
1919

2020
- name: install PostgreSQL contrib via apt
2121
apt: name=postgresql-contrib-9.1 force=yes
22-
tags: postgres
23-
24-
- name: create PostgreSQL db 'metastore'
25-
sudo: true
26-
sudo_user: postgres
27-
postgresql_db: name=metastore
28-
tags:
29-
- postgres
30-
- hive
31-
32-
- name: add PostgreSQL user 'hiveuser'
33-
sudo: true
34-
sudo_user: postgres
35-
postgresql_user: db=metastore name=hiveuser password=hive_{{ site_name }} priv=CONNECT
36-
tags:
37-
- postgres
38-
- hive
39-
40-
- name: init Hive metastore schema
41-
sudo: true
42-
sudo_user: postgres
43-
shell: psql --dbname=metastore --file=/usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
44-
tags:
45-
- postgres
46-
- hive
47-
48-
- name: grant PostgreSQL user 'hiveuser'
49-
sudo: true
50-
sudo_user: postgres
51-
shell: psql --dbname=metastore --command="GRANT ALL ON ALL TABLES IN SCHEMA public TO hiveuser;"
52-
tags:
53-
- postgres
54-
- hive
22+
tags: postgres

roles/smokeping/templates/Probes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*** Probes ***
2+
3+
+ FPing
4+
binary = /usr/bin/fping
5+
6+
+ Curl
7+
binary = /usr/bin/curl
8+
step = 60
9+
10+
# a default for this target-specific variable
11+
urlformat = http://%host%/

roles/smokeping/templates/Targets

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
*** Targets ***
44

5+
# default probe
56
probe = FPing
67

78
menu = Top
@@ -12,26 +13,17 @@ remark = SmokePing for {{ site_name|capitalize }}.
1213
menu = {{ site_name|capitalize }}
1314
title = {{ site_name|capitalize }}
1415

15-
++ Namenodes
16-
menu = Hadoop Namenodes
17-
title = Hadoop Namenodes
16+
{% for group in groups|sort if group != 'all' and not 'aggreg' in group and group != 'ungrouped' %}
17+
++ {{ group }}
18+
menu = {{ group|replace("_", " ")|title }}
19+
title = {{ group|replace("_", " ")|title }}
1820

19-
{% for host in groups['namenodes'] %}
21+
{% for host in groups[group] %}
2022
+++ {{ hostvars[host]['ansible_hostname'] }}
2123
menu = {{ hostvars[host]['ansible_hostname'] }}
22-
title = Namenode {{ hostvars[host]['ansible_hostname'] }} at {{ hostvars[host]['ansible_default_ipv4']['address'] }}
24+
title = {{ group|replace("_", " ")|title }} {{ hostvars[host]['ansible_hostname'] }} at {{ hostvars[host]['ansible_default_ipv4']['address'] }}
2325
host = {{ hostvars[host]['ansible_fqdn'] }}
2426
alerts = bigloss,someloss,startloss,rttdetect,hostdown
2527
{% endfor %}
2628

27-
++ Datanodes
28-
menu = Hadoop Datanodes
29-
title = Hadoop Datanodes
30-
31-
{% for host in groups['datanodes'] %}
32-
+++ {{ hostvars[host]['ansible_hostname'] }}
33-
menu = {{ hostvars[host]['ansible_hostname'] }}
34-
title = Datanode {{ hostvars[host]['ansible_hostname'] }} at {{ hostvars[host]['ansible_default_ipv4']['address'] }}
35-
host = {{ hostvars[host]['ansible_fqdn'] }}
36-
alerts = bigloss,someloss,startloss,rttdetect,hostdown
37-
{% endfor %}
29+
{% endfor %}

site.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@
240240
sudo: true
241241
roles:
242242
- { role: postgresql_server, when: hive_metastore == "postgresql" }
243+
- { role: cdh_hive_postgresql_metastore, when: hive_metastore == "postgresql" }
243244
- { role: mysql_server, when: hive_metastore == "mysql" }
245+
- { role: cdh_hive_mysql_metastore, when: hive_metastore == "mysql" }
244246
- cdh_hive_config
245247

246248
- hosts: hive_metastore

0 commit comments

Comments
 (0)