Skip to content

Commit 0417ccb

Browse files
authored
Merge pull request #1545 from swordqiu/hotfix/qj-parallel-limit-nproc
fix: parallel limit jobs by nproc
2 parents 2895aa6 + 58419aa commit 0417ccb

File tree

13 files changed

+32
-9
lines changed

13 files changed

+32
-9
lines changed

lib/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,16 @@ def inject_options(self, parser):
385385
metavar='OFFLINE_DATA_PATH',
386386
help="offline ISO mount point, e.g., /mnt")
387387
parser.add_argument("--ch-password", dest="ch_password",
388-
default="your-clickhouse-password",
389388
help=help_d("clickhouse password"))
390389
parser.add_argument("--ch-port", dest="ch_port",
391390
default=9000, type=int,
392391
help=help_d("clickhouse port"))
393392

394393
def do_action(self, args):
395394
# config =
395+
if args.ch_password is None:
396+
args.ch_password = utils.generage_random_string(12)
397+
print(f'generated clickhouse password: {args.ch_password}')
396398
cluster = construct_cluster(
397399
args.primary_master_host,
398400
args.ssh_user,

lib/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,11 @@ def is_valid_dns(dns):
107107
return True
108108
except socket.gaierror:
109109
return False
110+
111+
def generage_random_string(N=12):
112+
import random
113+
import string
114+
return ''.join(
115+
random.choice(string.ascii_uppercase + string.digits)
116+
for _ in range(N))
117+

onecloud/roles/clickhouse/deploy/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@
3939
when:
4040
- offline_data_path is defined
4141
- offline_data_path | length > 0
42-
- (is_centos_x86 | default(false) | bool == true) or (is_openeuler_x86 | default(false) | bool == true)
4342
- ch_password | default('') | length > 0

onecloud/roles/clickhouse/install/tasks/main.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@
44

55
- block:
66
- name: Import OS Specific tasks
7-
include_tasks: "{{ ansible_distribution | lower |replace(' ', '_')}}.yml"
7+
include_tasks: "{{ item }}"
8+
with_first_found:
9+
- files:
10+
- "{{ ansible_distribution | lower |replace(' ', '_')}}.yml"
11+
- defaults.yml
12+
paths:
13+
- os
14+
15+
- name: Ensure clickhouse-server installed
16+
package:
17+
name: clickhouse-server
18+
state: present
19+
20+
- name: Ensure clickhouse-client installed
21+
package:
22+
name: clickhouse-client
23+
state: present
824

925
- name: Ensure group "clickhouse" exists
1026
ansible.builtin.group:
@@ -50,7 +66,7 @@
5066
- name: Allow remote hosts connect to clickhouse (config.xml)
5167
lineinfile:
5268
path: /etc/clickhouse-server/config.xml
53-
insertafter: '<!-- Default values - try listen localhost on IPv4 and IPv6. -->'
69+
insertafter: '<!-- <listen_host>::</listen_host> -->'
5470
line: ' <listen_host>::</listen_host>'
5571
state: present
5672
backup: yes
@@ -157,4 +173,3 @@
157173
when:
158174
- offline_data_path is defined
159175
- offline_data_path | length > 0
160-
- (is_centos_x86 | default(false) | bool == true) or (is_openeuler_x86 | default(false) | bool == true)
File renamed without changes.
File renamed without changes.
File renamed without changes.

onecloud/roles/clickhouse/install/tasks/os/defaults.yml

Whitespace-only changes.

onecloud/roles/clickhouse/install/tasks/kylin_linux_advanced_server.yml renamed to onecloud/roles/clickhouse/install/tasks/os/kylin_linux_advanced_server.yml

File renamed without changes.

onecloud/roles/clickhouse/install/tasks/openeuler.yml renamed to onecloud/roles/clickhouse/install/tasks/os/openeuler.yml

File renamed without changes.

0 commit comments

Comments
 (0)