cloudbox-server 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. data/.yardopts +3 -0
  2. data/README.md +17 -0
  3. data/bin/cb-cluster-allocate +5 -0
  4. data/bin/cb-cluster-create +5 -0
  5. data/bin/cb-cluster-delete +5 -0
  6. data/bin/cb-cluster-desallocate +5 -0
  7. data/bin/cb-cluster-info +5 -0
  8. data/bin/cb-cluster-ls +5 -0
  9. data/bin/cb-node-destroy +5 -0
  10. data/bin/cb-node-detach +6 -0
  11. data/bin/cb-node-info +5 -0
  12. data/bin/cb-node-install +5 -0
  13. data/bin/cb-node-ls +5 -0
  14. data/bin/cb-service-add +5 -0
  15. data/bin/cb-service-component-add +5 -0
  16. data/bin/cb-service-component-delete +5 -0
  17. data/bin/cb-service-component-detach +5 -0
  18. data/bin/cb-service-conf-apply +5 -0
  19. data/bin/cb-service-conf-create +5 -0
  20. data/bin/cb-service-conf-get +5 -0
  21. data/bin/cb-service-conf-ls +5 -0
  22. data/bin/cb-service-follow-request +5 -0
  23. data/bin/cb-service-info +5 -0
  24. data/bin/cb-service-install +5 -0
  25. data/bin/cb-service-ls +5 -0
  26. data/bin/cb-service-start +5 -0
  27. data/bin/cb-service-stop +5 -0
  28. data/lib/command.rb +61 -0
  29. data/lib/command/ambari_add_host.rb +19 -0
  30. data/lib/command/ambari_cluster_command.rb +26 -0
  31. data/lib/command/ambari_cluster_component_command.rb +26 -0
  32. data/lib/command/ambari_cluster_component_host_command.rb +26 -0
  33. data/lib/command/ambari_cluster_create.rb +19 -0
  34. data/lib/command/ambari_cluster_host_command.rb +27 -0
  35. data/lib/command/ambari_cluster_list.rb +20 -0
  36. data/lib/command/ambari_cluster_service_command.rb +26 -0
  37. data/lib/command/ambari_cluster_service_host_command.rb +26 -0
  38. data/lib/command/ambari_command.rb +21 -0
  39. data/lib/command/ambari_create_cluster_configuration.rb +39 -0
  40. data/lib/command/ambari_get_cluster_configuration.rb +29 -0
  41. data/lib/command/ambari_host_list.rb +19 -0
  42. data/lib/command/ambari_install_cluster.rb +19 -0
  43. data/lib/command/ambari_install_component.rb +19 -0
  44. data/lib/command/ambari_install_host.rb +19 -0
  45. data/lib/command/ambari_install_host_component.rb +19 -0
  46. data/lib/command/ambari_install_host_components.rb +19 -0
  47. data/lib/command/ambari_install_service_components.rb +19 -0
  48. data/lib/command/ambari_service_add.rb +27 -0
  49. data/lib/command/ambari_service_component_add.rb +21 -0
  50. data/lib/command/ambari_service_component_delete.rb +21 -0
  51. data/lib/command/ambari_service_component_detach.rb +21 -0
  52. data/lib/command/ambari_service_component_info.rb +29 -0
  53. data/lib/command/ambari_service_conf_apply.rb +31 -0
  54. data/lib/command/ambari_service_conf_ls.rb +30 -0
  55. data/lib/command/ambari_service_delete.rb +21 -0
  56. data/lib/command/ambari_service_info.rb +20 -0
  57. data/lib/command/ambari_service_list.rb +21 -0
  58. data/lib/command/ambari_start_cluster.rb +19 -0
  59. data/lib/command/ambari_start_component.rb +19 -0
  60. data/lib/command/ambari_start_host.rb +19 -0
  61. data/lib/command/ambari_start_host_component.rb +19 -0
  62. data/lib/command/ambari_start_host_components.rb +19 -0
  63. data/lib/command/ambari_start_service_components.rb +19 -0
  64. data/lib/command/ambari_stop_cluster.rb +19 -0
  65. data/lib/command/ambari_stop_component.rb +19 -0
  66. data/lib/command/ambari_stop_host.rb +19 -0
  67. data/lib/command/ambari_stop_host_component.rb +19 -0
  68. data/lib/command/ambari_stop_host_components.rb +19 -0
  69. data/lib/command/ambari_stop_service_components.rb +19 -0
  70. data/lib/command/basic_command.rb +44 -0
  71. data/lib/command/cluster_create.rb +50 -0
  72. data/lib/command/cluster_delete.rb +30 -0
  73. data/lib/command/cluster_info.rb +30 -0
  74. data/lib/command/cluster_ls.rb +30 -0
  75. data/lib/command/crowbar_cluster_allocate.rb +42 -0
  76. data/lib/command/crowbar_command.rb +30 -0
  77. data/lib/command/crowbar_get_barclamps_list.rb +30 -0
  78. data/lib/command/crowbar_node_command.rb +21 -0
  79. data/lib/command/crowbar_node_list.rb +40 -0
  80. data/lib/command/crowbar_vcluster_command.rb +20 -0
  81. data/lib/command/filter.rb +15 -0
  82. data/lib/command/node_destroy.rb +58 -0
  83. data/lib/command/node_detach.rb +44 -0
  84. data/lib/command/node_info.rb +27 -0
  85. data/lib/command/node_install.rb +46 -0
  86. data/lib/command/node_reinstall.rb +44 -0
  87. data/lib/command/state_filter.rb +16 -0
  88. data/lib/common.rb +11 -0
  89. data/lib/common/cb-lib-node-erase-hard-disk.sh +29 -0
  90. data/lib/common/cloudbox_exceptions.rb +631 -0
  91. data/lib/common/cloudbox_logger.rb +81 -0
  92. data/lib/common/cloudbox_logger_mock.rb +43 -0
  93. data/lib/common/color.rb +267 -0
  94. data/lib/common/config_properties.rb +2027 -0
  95. data/lib/common/services_description.rb +192 -0
  96. data/lib/exec.rb +35 -0
  97. data/lib/exec/check_parameter.rb +208 -0
  98. data/lib/exec/cluster_allocate.rb +163 -0
  99. data/lib/exec/cluster_create.rb +99 -0
  100. data/lib/exec/cluster_delete.rb +38 -0
  101. data/lib/exec/cluster_desallocate.rb +37 -0
  102. data/lib/exec/cluster_info.rb +177 -0
  103. data/lib/exec/cluster_ls.rb +150 -0
  104. data/lib/exec/command_option.rb +222 -0
  105. data/lib/exec/executable_command.rb +194 -0
  106. data/lib/exec/node_destroy.rb +101 -0
  107. data/lib/exec/node_detach.rb +98 -0
  108. data/lib/exec/node_info.rb +280 -0
  109. data/lib/exec/node_install.rb +234 -0
  110. data/lib/exec/node_ls.rb +160 -0
  111. data/lib/exec/service_add.rb +224 -0
  112. data/lib/exec/service_component_add.rb +39 -0
  113. data/lib/exec/service_component_delete.rb +37 -0
  114. data/lib/exec/service_component_detach.rb +37 -0
  115. data/lib/exec/service_conf_apply.rb +57 -0
  116. data/lib/exec/service_conf_create.rb +80 -0
  117. data/lib/exec/service_conf_get.rb +165 -0
  118. data/lib/exec/service_conf_ls.rb +103 -0
  119. data/lib/exec/service_follow_request.rb +49 -0
  120. data/lib/exec/service_info.rb +346 -0
  121. data/lib/exec/service_install.rb +87 -0
  122. data/lib/exec/service_ls.rb +124 -0
  123. data/lib/exec/service_start.rb +110 -0
  124. data/lib/exec/service_stop.rb +112 -0
  125. data/lib/receiver.rb +14 -0
  126. data/lib/receiver/ambari_receiver.rb +812 -0
  127. data/lib/receiver/ambari_rest_api_connector.rb +599 -0
  128. data/lib/receiver/basic_receiver.rb +28 -0
  129. data/lib/receiver/connector.rb +28 -0
  130. data/lib/receiver/crowbar_receiver.rb +588 -0
  131. data/lib/receiver/crowbar_rest_api_connector.rb +518 -0
  132. data/lib/receiver/crowbar_shell_api.rb +643 -0
  133. data/lib/receiver/rest_api_connector.rb +275 -0
  134. data/resources/ambari-configurations/HBASE/default_hbase-site +33 -0
  135. data/resources/ambari-configurations/HDFS/default_hdfs-site +49 -0
  136. data/resources/ambari-configurations/HIVE/default_hive-site +33 -0
  137. data/resources/ambari-configurations/MAPREDUCE/default_mapred-site +72 -0
  138. data/resources/ambari-configurations/OOZIE/default_oozie-site +28 -0
  139. data/resources/ambari-configurations/WEBHCAT/default_webhcat-site +18 -0
  140. data/resources/ambari-configurations/ZOOKEEPER/default_zookeeper-site +8 -0
  141. data/resources/ambari-configurations/default_core-site +22 -0
  142. data/resources/ambari-configurations/default_global +141 -0
  143. data/resources/cloudbox-server.conf +10 -0
  144. data/spec/common/services_description.rb +130 -0
  145. data/spec/exec/check_parameter.rb +152 -0
  146. data/spec/exec/command_option_spec.rb +97 -0
  147. metadata +328 -0
@@ -0,0 +1,28 @@
1
+ {
2
+ "oozie.service.AuthorizationService.authorization.enabled": "true",
3
+ "oozie.service.PurgeService.purge.interval": "3600",
4
+ "oozie.service.PurgeService.older.than": "30",
5
+ "oozie.system.id": "oozie-${user.name}",
6
+ "oozie.service.coord.normal.default.timeout": "120",
7
+ "oozie.service.JPAService.pool.max.active.conn": "10",
8
+ "oozie.authentication.type": "simple",
9
+ "use.system.libpath.for.mapreduce.and.pig.jobs": "false",
10
+ "oozie.service.CallableQueueService.callable.concurrency": "3",
11
+ "oozie.service.CallableQueueService.threads": "10",
12
+ "oozie.base.url": "http://__MASTERNODE__:11000/oozie",
13
+ "oozie.service.CallableQueueService.queue.size": "1000",
14
+ "oozie.service.JPAService.jdbc.username": "oozie",
15
+ "oozie.authentication.kerberos.name.rules": "\n RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n DEFAULT\n ",
16
+ "oozie.service.SchemaService.wf.ext.schemas": "shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd",
17
+ "oozie.service.HadoopAccessorService.nameNode.whitelist": " ",
18
+ "oozie.service.WorkflowAppService.system.libpath": "/user/${user.name}/share/lib",
19
+ "oozie.systemmode": "NORMAL",
20
+ "oozie.service.JPAService.create.db.schema": "false",
21
+ "oozie.service.JPAService.jdbc.password": "admin",
22
+ "oozie.service.HadoopAccessorService.jobTracker.whitelist": " ",
23
+ "oozie.db.schema.name": "oozie",
24
+ "oozie.service.JPAService.jdbc.url": "jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true",
25
+ "oozie.service.JPAService.jdbc.driver": "org.apache.derby.jdbc.EmbeddedDriver",
26
+ "oozie.service.HadoopAccessorService.hadoop.configurations": "*=/etc/hadoop/conf",
27
+ "oozie.service.ActionService.executor.ext.classes": "\n org.apache.oozie.action.email.EmailActionExecutor,\n org.apache.oozie.action.hadoop.HiveActionExecutor,\n org.apache.oozie.action.hadoop.ShellActionExecutor,\n org.apache.oozie.action.hadoop.SqoopActionExecutor,\n org.apache.oozie.action.hadoop.DistcpActionExecutor\n "
28
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "templeton.hcat": "/usr/bin/hcat",
3
+ "templeton.storage.class": "org.apache.hcatalog.templeton.tool.ZooKeeperStorage",
4
+ "templeton.jar": "/usr/lib/hcatalog/share/webhcat/svr/webhcat.jar",
5
+ "templeton.streaming.jar": "hdfs:///apps/webhcat/hadoop-streaming.jar",
6
+ "templeton.exec.timeout": "60000",
7
+ "templeton.hive.properties": "hive.metastore.local=false,hive.metastore.uris=thrift://__MASTERNODE__:9083,hive.metastore.sasl.enabled=yes,hive.metastore.execute.setugi=true",
8
+ "templeton.override.enabled": "false",
9
+ "templeton.pig.path": "pig.tar.gz/pig/bin/pig",
10
+ "templeton.hive.archive": "hdfs:///apps/webhcat/hive.tar.gz",
11
+ "templeton.port": "50111",
12
+ "templeton.libjars": "/usr/lib/zookeeper/zookeeper.jar",
13
+ "templeton.hadoop": "/usr/bin/hadoop",
14
+ "templeton.pig.archive": "hdfs:///apps/webhcat/pig.tar.gz",
15
+ "templeton.zookeeper.hosts": "__MASTERNODE__:2181",
16
+ "templeton.hive.path": "hive.tar.gz/hive/bin/hive",
17
+ "templeton.hadoop.conf.dir": "/etc/hadoop/conf"
18
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "zookeeper_sessiontimeout": "60000",
3
+ "zk_data_dir": "/hadoop/zookeeper",
4
+ "zk_pid_file": "/var/run/zookeeper/zookeeper_server.pid",
5
+ "zk_user": "zookeeper",
6
+ "zk_pid_dir": "/var/run/zookeeper",
7
+ "zk_log_dir": "/var/log/test/zookeeper"
8
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "io.serializations": "org.apache.hadoop.io.serializer.WritableSerialization",
3
+ "hadoop.proxyuser.hive.hosts": "__MASTERNODE__",
4
+ "fs.checkpoint.size": "0.5",
5
+ "hadoop.proxyuser.hcat.hosts": "__MASTERNODE__",
6
+ "io.file.buffer.size": "131072",
7
+ "fs.checkpoint.period": "21600",
8
+ "io.compression.codec.lzo.class": "com.hadoop.compression.lzo.LzoCodec",
9
+ "ipc.client.connection.maxidletime": "30000",
10
+ "hadoop.proxyuser.hive.groups": "users",
11
+ "io.compression.codecs": "org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,com.hadoop.compression.lzo.LzoCodec,com.hadoop.compression.lzo.LzopCodec,org.apache.hadoop.io.compress.SnappyCodec",
12
+ "webinterface.private.actions": "false",
13
+ "hadoop.proxyuser.oozie.groups": "users",
14
+ "fs.checkpoint.edits.dir": "/hadoop/hdfs/namesecondary",
15
+ "fs.trash.interval": "360",
16
+ "fs.default.name": "hdfs://__MASTERNODE__:8020",
17
+ "hadoop.proxyuser.hcat.groups": "users",
18
+ "ipc.client.idlethreshold": "8000",
19
+ "fs.checkpoint.dir": "/hadoop/hdfs/namesecondary",
20
+ "ipc.client.connect.max.retries": "50",
21
+ "hadoop.proxyuser.oozie.hosts": "__MASTERNODE__"
22
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "hive_lib": "/usr/lib/hive/lib/",
3
+ "hadoop_heapsize": "1024",
4
+ "hive_log_dir": "/var/log/hive",
5
+ "dfs_datanode_http_address": "50075",
6
+ "io_sort_mb": "200",
7
+ "zk_user": "zookeeper",
8
+ "dfs_data_dir": "/hadoop/hdfs/data",
9
+ "clientPort": "2181",
10
+ "hdfs_user": "hdfs",
11
+ "hive_dbroot": "/usr/lib/hive/lib",
12
+ "dfs_name_dir": "/hadoop/hdfs/namenode",
13
+ "hfile_blockcache_size": "0.25",
14
+ "kadmin_pw": "",
15
+ "gmond_user": "nobody",
16
+ "hregion_majorcompaction": "86400000",
17
+ "user_group": "hadoop",
18
+ "dfs_datanode_failed_volume_tolerated": "0",
19
+ "zk_pid_file": "/var/run/zookeeper/zookeeper_server.pid",
20
+ "zookeeper_sessiontimeout": "60000",
21
+ "hcat_user": "hcat",
22
+ "zk_log_dir": "/var/log/zookeeper",
23
+ "oozie_derby_database": "Derby",
24
+ "hbase_conf_dir": "/etc/hbase",
25
+ "mapred_local_dir": "/hadoop/mapred",
26
+ "oozie_data_dir": "/hadoop/oozie/data",
27
+ "dfs_replication": "3",
28
+ "fs_checkpoint_period": "21600",
29
+ "hive_database_type": "mysql",
30
+ "hbase_hdfs_root_dir": "/apps/hbase/data",
31
+ "run_dir": "/var/run/hadoop",
32
+ "oozie_log_dir": "/var/log/oozie",
33
+ "hbase_pid_dir": "/var/run/hbase",
34
+ "hive_user": "hive",
35
+ "security_enabled": "false",
36
+ "mapred_map_tasks_max": "4",
37
+ "mapred_job_red_mem_mb": "-1",
38
+ "mapred_hosts_exclude": "mapred.exclude",
39
+ "dfs_datanode_address": "50010",
40
+ "dfs_block_local_path_access_user": "hbase",
41
+ "dfs_datanode_data_dir_perm": "750",
42
+ "nagios_web_password": "admin",
43
+ "dtnode_heapsize": "1024m",
44
+ "tickTime": "2000",
45
+ "mapred_cluster_max_map_mem_mb": "-1",
46
+ "oozie_database": "New Derby Database",
47
+ "regionserver_memstore_upperlimit": "0.4",
48
+ "datanode_du_reserved": "1",
49
+ "java64_home": "__JDK_HOME__",
50
+ "hbase_tmp_dir": "/var/log/hbase",
51
+ "jtnode_opt_newsize": "200m",
52
+ "oozie_user": "oozie",
53
+ "mapred_jobstatus_dir": "file:////mapred/jobstatus",
54
+ "hive_metastore_port": "9083",
55
+ "namenode_heapsize": "1024m",
56
+ "nagios_contact": "admin@admin.com",
57
+ "mapred_cluster_red_mem_mb": "-1",
58
+ "oozie_JPAService_url": "${oozie.data.dir}/${oozie.db.schema.name}-db;create=true",
59
+ "hive_ambari_database": "MySQL",
60
+ "oozie_jdbc_driver": "org.apache.derby.jdbc.EmbeddedDriver",
61
+ "zk_data_dir": "/hadoop/zookeeper",
62
+ "hive_pid_dir": "/var/run/hive",
63
+ "hregion_blockmultiplier": "2",
64
+ "oozie_pid_dir": "/var/run/oozie",
65
+ "mysql_connector_url": "${download_url}/mysql-connector-java-5.1.18.zip",
66
+ "jtnode_opt_maxnewsize": "200m",
67
+ "task_controller": "org.apache.hadoop.mapred.DefaultTaskController",
68
+ "rca_enabled": "true",
69
+ "gpl_artifacts_download_url": "",
70
+ "gmetad_user": "nobody",
71
+ "oozie_metastore_user_name": "oozie",
72
+ "hive_metastore_user_passwd": "admin",
73
+ "hcat_log_dir": "/var/log/webhcat",
74
+ "jtnode_heapsize": "1024m",
75
+ "hive_hostname": "agent1",
76
+ "syncLimit": "5",
77
+ "io_sort_spill_percent": "0.9",
78
+ "fs_checkpoint_size": "0.5",
79
+ "mapred_user": "mapred",
80
+ "initLimit": "10",
81
+ "hive_database": "New MySQL Database",
82
+ "mapred_system_dir": "/mapred/system",
83
+ "mapred_job_map_mem_mb": "-1",
84
+ "hive_jdbc_driver": "com.mysql.jdbc.Driver",
85
+ "hive_conf_dir": "/etc/hive/conf",
86
+ "hdfs_log_dir_prefix": "/var/log/hadoop",
87
+ "keytab_path": "/etc/security/keytabs",
88
+ "proxyuser_group": "users",
89
+ "lzo_enabled": "true",
90
+ "hive_database_name": "hive",
91
+ "client_scannercaching": "100",
92
+ "hcat_pid_dir": "/var/run/webhcat",
93
+ "hdfs_enable_shortcircuit_read": "true",
94
+ "kerberos_domain": "EXAMPLE.COM",
95
+ "nagios_group": "nagios",
96
+ "hdfs_support_append": "true",
97
+ "nagios_web_login": "nagiosadmin",
98
+ "oozie_database_type": "derby",
99
+ "namenode_formatted_mark_dir": "/var/run/hadoop/hdfs/namenode/formatted/",
100
+ "dfs_exclude": "dfs.exclude",
101
+ "namenode_opt_maxnewsize": "640m",
102
+ "oozie_database_name": "oozie",
103
+ "regionserver_memstore_lab": "true",
104
+ "mapreduce_userlog_retainhours": "24",
105
+ "namenode_opt_newsize": "200m",
106
+ "smokeuser": "ambari-qa",
107
+ "nagios_user": "nagios",
108
+ "hcat_conf_dir": "",
109
+ "mapred_child_java_opts_sz": "768",
110
+ "mapred_red_tasks_max": "2",
111
+ "regionserver_memstore_lowerlimit": "0.35",
112
+ "apache_artifacts_download_url": "",
113
+ "hive_metastore_user_name": "hive",
114
+ "mapred_hosts_include": "mapred.include",
115
+ "hstore_blockingstorefiles": "7",
116
+ "hadoop_conf_dir": "/etc/hadoop",
117
+ "oozie_metastore_user_passwd": "admin",
118
+ "hbase_user": "hbase",
119
+ "snappy_enabled": "true",
120
+ "maxtasks_per_job": "-1",
121
+ "ganglia_runtime_dir": "/var/run/ganglia/hdp",
122
+ "zk_pid_dir": "/var/run/zookeeper",
123
+ "fs_checkpoint_dir": "/hadoop/hdfs/namesecondary",
124
+ "mapred_cluster_map_mem_mb": "-1",
125
+ "hfile_max_keyvalue_size": "10485760",
126
+ "hstore_compactionthreshold": "3",
127
+ "hive_aux_jars_path": "/usr/lib/hcatalog/share/hcatalog/hcatalog-core.jar",
128
+ "hregion_memstoreflushsize": "134217728",
129
+ "hadoop_pid_dir_prefix": "/var/run/hadoop",
130
+ "hbase_log_dir": "/var/log/hbase",
131
+ "mapred_cluster_max_red_mem_mb": "-1",
132
+ "webhcat_user": "hcat",
133
+ "regionserver_handlers": "30",
134
+ "hbase_regionserver_heapsize": "1024m",
135
+ "dfs_include": "dfs.include",
136
+ "dfs_webhdfs_enabled": "false",
137
+ "scheduler_name": "org.apache.hadoop.mapred.CapacityTaskScheduler",
138
+ "rrdcached_base_dir": "/var/lib/ganglia/rrds",
139
+ "hstorefile_maxsize": "1073741824",
140
+ "hbase_master_heapsize": "1024m"
141
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "ambari_server_ip": "192.168.124.10",
3
+ "ambari_server_port": "8080",
4
+ "ambari_user": "admin",
5
+ "ambari_password": "admin",
6
+ "crowbar_server_ip" : "172.31.8.10",
7
+ "crowbar_server_port" : "3000" ,
8
+ "crowbar_user" : "crowbar",
9
+ "crowbar_password" : "crowbar"
10
+ }
@@ -0,0 +1,130 @@
1
+ # This file is part of cloudbox-server project
2
+ # @author tmarmin (INGENSI)
3
+
4
+ require File.dirname(__FILE__) + '/../../lib/common/services_description'
5
+ require "rspec"
6
+
7
+ include Common::ServicesDescription
8
+
9
+ describe Common::ServicesDescription do
10
+
11
+ it "should list all services" do
12
+ Common::ServicesDescription.get_services_list().should include("HDFS", "MAPREDUCE", "HBASE", "OOZIE", "NAGIOS", "GANGLIA", "ZOOKEEPER")
13
+ end
14
+
15
+ it "should list all components" do
16
+ Common::ServicesDescription.get_components_list().should include("NAMENODE", "DATANODE", "JOBTRACKER", "TASKTRACKER", "HIVE_SERVER", "HBASE_MASTER", "HBASE_REGIONSERVER", "ZOOKEEPER_SERVER", "OOZIE_SERVER", "NAGIOS_SERVER", "GANGLIA_SERVER", "GANGLIA_MONITOR")
17
+ end
18
+
19
+ it "should return consistent service name by component name" do
20
+ Common::ServicesDescription.get_service_name_by_comp_name("NAMENODE").should eql("HDFS")
21
+ Common::ServicesDescription.get_service_name_by_comp_name("DATANODE").should eql("HDFS")
22
+ Common::ServicesDescription.get_service_name_by_comp_name("JOBTRACKER").should eql("MAPREDUCE")
23
+ Common::ServicesDescription.get_service_name_by_comp_name("TASKTRACKER").should eql("MAPREDUCE")
24
+ Common::ServicesDescription.get_service_name_by_comp_name("HIVE_SERVER").should eql("HIVE")
25
+ Common::ServicesDescription.get_service_name_by_comp_name("HBASE_MASTER").should eql("HBASE")
26
+ Common::ServicesDescription.get_service_name_by_comp_name("HBASE_REGIONSERVER").should eql("HBASE")
27
+ Common::ServicesDescription.get_service_name_by_comp_name("ZOOKEEPER_SERVER").should eql("ZOOKEEPER")
28
+ Common::ServicesDescription.get_service_name_by_comp_name("OOZIE_SERVER").should eql("OOZIE")
29
+ Common::ServicesDescription.get_service_name_by_comp_name("NAGIOS_SERVER").should eql("NAGIOS")
30
+ Common::ServicesDescription.get_service_name_by_comp_name("GANGLIA_SERVER").should eql("GANGLIA")
31
+ Common::ServicesDescription.get_service_name_by_comp_name("GANGLIA_MONITOR").should eql("GANGLIA")
32
+ end
33
+
34
+ it "should describe HDFS in a consistent way" do
35
+ Common::ServicesDescription.get_components("HDFS").should include("DATANODE", "NAMENODE")
36
+ Common::ServicesDescription.get_config_name_service("HDFS").should eql("hdfs-site")
37
+ Common::ServicesDescription.get_master_nodes("HDFS").should include("NAMENODE")
38
+ Common::ServicesDescription.get_slave_nodes("HDFS").should include("DATANODE")
39
+ Common::ServicesDescription.get_slave_nodes_on_master("HDFS").size.should eql(0)
40
+ Common::ServicesDescription.get_deps("HDFS").size.should eql(0)
41
+ Common::ServicesDescription.get_master_components_deps("HDFS").size.should eql(0)
42
+ Common::ServicesDescription.get_depends_on("HDFS").should include("MAPREDUCE", "HIVE", "HBASE")
43
+ Common::ServicesDescription.get_master_components_depends_on("HDFS").should include("JOBTRACKER", "HIVE_SERVER", "HBASE_MASTER")
44
+ end
45
+
46
+ it "should describe MAPREDUCE in a consistent way" do
47
+ Common::ServicesDescription.get_components("MAPREDUCE").should include("TASKTRACKER", "JOBTRACKER")
48
+ Common::ServicesDescription.get_config_name_service("MAPREDUCE").should eql("mapred-site")
49
+ Common::ServicesDescription.get_master_nodes("MAPREDUCE").should include("JOBTRACKER")
50
+ Common::ServicesDescription.get_slave_nodes("MAPREDUCE").should include("TASKTRACKER")
51
+ Common::ServicesDescription.get_slave_nodes_on_master("MAPREDUCE").size.should eql(0)
52
+ Common::ServicesDescription.get_deps("MAPREDUCE").should include("HDFS")
53
+ Common::ServicesDescription.get_master_components_deps("MAPREDUCE").should include("NAMENODE")
54
+ Common::ServicesDescription.get_depends_on("MAPREDUCE").should include("HIVE")
55
+ Common::ServicesDescription.get_master_components_depends_on("MAPREDUCE").should include("HIVE_SERVER")
56
+ end
57
+
58
+ it "should describe HIVE in a consistent way" do
59
+ Common::ServicesDescription.get_components("HIVE").should include("HIVE_SERVER")
60
+ Common::ServicesDescription.get_config_name_service("HIVE").should eql("hive-site")
61
+ Common::ServicesDescription.get_master_nodes("HIVE").should include("HIVE_SERVER")
62
+ Common::ServicesDescription.get_slave_nodes("HIVE").size.should eql(0)
63
+ Common::ServicesDescription.get_slave_nodes_on_master("HIVE").size.should eql(0)
64
+ Common::ServicesDescription.get_deps("HIVE").should include("MAPREDUCE", "HDFS")
65
+ Common::ServicesDescription.get_master_components_deps("HIVE").should include("NAMENODE", "JOBTRACKER")
66
+ Common::ServicesDescription.get_depends_on("HIVE").size.should eql(0)
67
+ Common::ServicesDescription.get_master_components_depends_on("HIVE").size.should eql(0)
68
+ end
69
+
70
+ it "should describe HBASE in a consistent way" do
71
+ Common::ServicesDescription.get_components("HBASE").should include("HBASE_MASTER", "HBASE_REGIONSERVER")
72
+ Common::ServicesDescription.get_config_name_service("HBASE").should eql("hbase-site")
73
+ Common::ServicesDescription.get_master_nodes("HBASE").should include("HBASE_MASTER")
74
+ Common::ServicesDescription.get_slave_nodes("HBASE").should include("HBASE_REGIONSERVER")
75
+ Common::ServicesDescription.get_slave_nodes_on_master("HBASE").size.should eql(0)
76
+ Common::ServicesDescription.get_deps("HBASE").should include("HDFS", "ZOOKEEPER")
77
+ Common::ServicesDescription.get_master_components_deps("HBASE").should include("NAMENODE", "ZOOKEEPER_SERVER")
78
+ Common::ServicesDescription.get_depends_on("HBASE").size.should eql(0)
79
+ Common::ServicesDescription.get_master_components_depends_on("HBASE").size.should eql(0)
80
+ end
81
+
82
+ it "should describe OOZIE in a consistent way" do
83
+ Common::ServicesDescription.get_components("OOZIE").should include("OOZIE_SERVER")
84
+ Common::ServicesDescription.get_config_name_service("OOZIE").should eql("oozie-site")
85
+ Common::ServicesDescription.get_master_nodes("OOZIE").should include("OOZIE_SERVER")
86
+ Common::ServicesDescription.get_slave_nodes("OOZIE").size.should eql(0)
87
+ Common::ServicesDescription.get_slave_nodes_on_master("OOZIE").size.should eql(0)
88
+ Common::ServicesDescription.get_deps("OOZIE").size.should eql(0)
89
+ Common::ServicesDescription.get_master_components_deps("OOZIE").size.should eql(0)
90
+ Common::ServicesDescription.get_depends_on("OOZIE").size.should eql(0)
91
+ Common::ServicesDescription.get_master_components_depends_on("OOZIE").size.should eql(0)
92
+ end
93
+
94
+ it "should describe ZOOKEEPER in a consistent way" do
95
+ Common::ServicesDescription.get_components("ZOOKEEPER").should include("ZOOKEEPER_SERVER")
96
+ Common::ServicesDescription.get_config_name_service("ZOOKEEPER").should include ("zookeeper-site")
97
+ Common::ServicesDescription.get_master_nodes("ZOOKEEPER").should include("ZOOKEEPER_SERVER")
98
+ Common::ServicesDescription.get_slave_nodes("ZOOKEEPER").size.should eql(0)
99
+ Common::ServicesDescription.get_slave_nodes_on_master("ZOOKEEPER").size.should eql(0)
100
+ Common::ServicesDescription.get_deps("ZOOKEEPER").size.should eql(0)
101
+ Common::ServicesDescription.get_master_components_deps("ZOOKEEPER").size.should eql(0)
102
+ Common::ServicesDescription.get_depends_on("ZOOKEEPER").should include("HBASE")
103
+ Common::ServicesDescription.get_master_components_depends_on("ZOOKEEPER").should include("HBASE_MASTER")
104
+ end
105
+
106
+ it "should describe NAGIOS in a consistent way" do
107
+ Common::ServicesDescription.get_components("NAGIOS").should include("NAGIOS_SERVER")
108
+ Common::ServicesDescription.get_config_name_service("NAGIOS").should be_nil
109
+ Common::ServicesDescription.get_master_nodes("NAGIOS").should include("NAGIOS_SERVER")
110
+ Common::ServicesDescription.get_slave_nodes("NAGIOS").size.should eql(0)
111
+ Common::ServicesDescription.get_slave_nodes_on_master("NAGIOS").size.should eql(0)
112
+ Common::ServicesDescription.get_deps("NAGIOS").size.should eql(0)
113
+ Common::ServicesDescription.get_master_components_deps("NAGIOS").size.should eql(0)
114
+ Common::ServicesDescription.get_depends_on("NAGIOS").size.should eql(0)
115
+ Common::ServicesDescription.get_master_components_depends_on("NAGIOS").size.should eql(0)
116
+ end
117
+
118
+ it "should describe GANGLIA in a consistent way" do
119
+ Common::ServicesDescription.get_components("GANGLIA").should include("GANGLIA_MONITOR", "GANGLIA_SERVER")
120
+ Common::ServicesDescription.get_config_name_service("GANGLIA").should be_nil
121
+ Common::ServicesDescription.get_master_nodes("GANGLIA").should include("GANGLIA_SERVER")
122
+ Common::ServicesDescription.get_slave_nodes("GANGLIA").should include("GANGLIA_MONITOR")
123
+ Common::ServicesDescription.get_slave_nodes_on_master("GANGLIA").should include("GANGLIA_MONITOR")
124
+ Common::ServicesDescription.get_deps("GANGLIA").size.should eql(0)
125
+ Common::ServicesDescription.get_master_components_deps("GANGLIA").size.should eql(0)
126
+ Common::ServicesDescription.get_depends_on("GANGLIA").size.should eql(0)
127
+ Common::ServicesDescription.get_master_components_depends_on("GANGLIA").size.should eql(0)
128
+ end
129
+
130
+ end
@@ -0,0 +1,152 @@
1
+ # This file is part of cloudbox-server project
2
+ # @author tmarmin (INGENSI)
3
+
4
+ require File.dirname(__FILE__) + '/../../lib/exec/check_parameter'
5
+ require "rspec"
6
+
7
+ include Exec::CheckParameter
8
+
9
+ describe Exec::CheckParameter do
10
+
11
+ it "should verify cluster name format" do
12
+ Exec::CheckParameter.check_cluster_name("c1")[0].should be true
13
+ Exec::CheckParameter.check_cluster_name("coucou1")[0].should be true
14
+ Exec::CheckParameter.check_cluster_name("coucou")[0].should be true
15
+ Exec::CheckParameter.check_cluster_name("azertyuiopsdfghjklmwxcvbn")[0].should be true
16
+ Exec::CheckParameter.check_cluster_name("1")[0].should be true
17
+ Exec::CheckParameter.check_cluster_name("12")[0].should be true
18
+ Exec::CheckParameter.check_cluster_name("1234567890")[0].should be true
19
+ Exec::CheckParameter.check_cluster_name("0")[0].should be true
20
+ end
21
+
22
+ it "should NOT verify cluster name format" do
23
+ Exec::CheckParameter.check_cluster_name("")[0].should be false
24
+ Exec::CheckParameter.check_cluster_name("Coucou")[0].should be false
25
+ Exec::CheckParameter.check_cluster_name("couCou")[0].should be false
26
+ Exec::CheckParameter.check_cluster_name("cou-cou")[0].should be false
27
+ Exec::CheckParameter.check_cluster_name("-")[0].should be false
28
+ Exec::CheckParameter.check_cluster_name("COUCOU")[0].should be false
29
+ Exec::CheckParameter.check_cluster_name("")[0].should be false
30
+ end
31
+
32
+ it "should verify config name format" do
33
+ Exec::CheckParameter.check_type_conf("conf")[0].should be true
34
+ Exec::CheckParameter.check_type_conf("conf1")[0].should be true
35
+ Exec::CheckParameter.check_type_conf("config")[0].should be true
36
+ Exec::CheckParameter.check_type_conf("c")[0].should be true
37
+ end
38
+
39
+ it "should NOT verify config name format" do
40
+ Exec::CheckParameter.check_type_conf("conf-iguration")[0].should be false
41
+ Exec::CheckParameter.check_type_conf("")[0].should be false
42
+ end
43
+
44
+ it "should verify crowbar node name" do
45
+ Exec::CheckParameter.check_crowbar_node_name("coucou")[0].should be true
46
+ Exec::CheckParameter.check_crowbar_node_name("kakou-kikou-miaou")[0].should be true
47
+ end
48
+
49
+ it "should NOT verify crowbar node name" do
50
+ Exec::CheckParameter.check_crowbar_node_name("kikou miaou")[0].should be false
51
+ Exec::CheckParameter.check_crowbar_node_name("")[0].should be false
52
+ end
53
+
54
+ it "should verify crowbar param for node" do
55
+ Exec::CheckParameter.check_param_for_bios("Hadoop")[0].should be true
56
+ Exec::CheckParameter.check_param_for_bios("HadoopInfra")[0].should be true
57
+ Exec::CheckParameter.check_param_for_bios("Storage")[0].should be true
58
+ Exec::CheckParameter.check_param_for_bios("Virtualization")[0].should be true
59
+ end
60
+
61
+ it "should NOT verify crowbar param for node" do
62
+ Exec::CheckParameter.check_param_for_bios("kikou")[0].should be false
63
+ Exec::CheckParameter.check_param_for_bios("")[0].should be false
64
+ end
65
+
66
+ it "should verify vlan id" do
67
+ (10..4096).each do |i|
68
+ Exec::CheckParameter.check_vlan_id(i.to_s)[0].should be true
69
+ end
70
+ end
71
+
72
+ it "should NOT verify vlan id" do
73
+ (1..9).each do |i|
74
+ Exec::CheckParameter.check_vlan_id(i.to_s)[0].should be false
75
+ end
76
+
77
+ (4097..5001).each do |i|
78
+ Exec::CheckParameter.check_vlan_id(i.to_s)[0].should be false
79
+ end
80
+ end
81
+
82
+ it "should verify ram format" do
83
+ Exec::CheckParameter.check_ram_size("1g")[0].should be true
84
+ Exec::CheckParameter.check_ram_size("2g")[0].should be true
85
+ Exec::CheckParameter.check_ram_size("10g")[0].should be true
86
+ Exec::CheckParameter.check_ram_size("1100g")[0].should be true
87
+ end
88
+
89
+ it "should NOT verify ram format" do
90
+ Exec::CheckParameter.check_ram_size("1")[0].should be false
91
+ Exec::CheckParameter.check_ram_size("0g")[0].should be false
92
+ Exec::CheckParameter.check_ram_size("10G")[0].should be false
93
+ Exec::CheckParameter.check_ram_size(" 00g")[0].should be false
94
+ end
95
+
96
+ it "should verify cpu weightformat" do
97
+ Exec::CheckParameter.check_cpu_weight("1")[0].should be true
98
+ Exec::CheckParameter.check_cpu_weight("2")[0].should be true
99
+ Exec::CheckParameter.check_cpu_weight("10")[0].should be true
100
+ Exec::CheckParameter.check_cpu_weight("1024")[0].should be true
101
+ end
102
+
103
+ it "should NOT verify cpu ceight format" do
104
+ Exec::CheckParameter.check_cpu_weight("0")[0].should be false
105
+ Exec::CheckParameter.check_cpu_weight("0g")[0].should be false
106
+ Exec::CheckParameter.check_cpu_weight("&")[0].should be false
107
+ Exec::CheckParameter.check_cpu_weight("")[0].should be false
108
+ end
109
+
110
+ it "should verify network format" do
111
+ Exec::CheckParameter.check_network_address("10.0.0.0/8")[0].should be true
112
+ Exec::CheckParameter.check_network_address("10.0.0.0/16")[0].should be true
113
+ Exec::CheckParameter.check_network_address("10.0.0.0/24")[0].should be true
114
+ Exec::CheckParameter.check_network_address("192.168.124.0/24")[0].should be true
115
+ end
116
+
117
+ it "should NOT verify network format" do
118
+ Exec::CheckParameter.check_network_address("10.1.1.0/16")[0].should be false
119
+ Exec::CheckParameter.check_network_address("10.1.1.0/8")[0].should be false
120
+ Exec::CheckParameter.check_network_address("10.0.0.1/8")[0].should be false
121
+ Exec::CheckParameter.check_network_address("10.0.0.0")[0].should be false
122
+ end
123
+
124
+ it "should verify service name" do
125
+ Exec::CheckParameter.check_hadoop_service_name("HDFS")[0].should be true
126
+ Exec::CheckParameter.check_hadoop_service_name("MAPREDUCE")[0].should be true
127
+ Exec::CheckParameter.check_hadoop_service_name("HBASE")[0].should be true
128
+ Exec::CheckParameter.check_hadoop_service_name("NAGIOS")[0].should be true
129
+ Exec::CheckParameter.check_hadoop_service_name("GANGLIA")[0].should be true
130
+ end
131
+
132
+ it "should NOT verify service name" do
133
+ Exec::CheckParameter.check_hadoop_service_name("")[0].should be false
134
+ Exec::CheckParameter.check_hadoop_service_name("miaou")[0].should be false
135
+ Exec::CheckParameter.check_hadoop_service_name("COUCOU")[0].should be false
136
+ Exec::CheckParameter.check_hadoop_service_name(" ")[0].should be false
137
+ end
138
+
139
+ it "should verify component name" do
140
+ ["NAMENODE", "DATANODE", "GANGLIA_SERVER", "GANGLIA_MONITOR", "JOBTRACKER", "TASKTRACKER", "ZOOKEEPER_SERVER", "NAGIOS_SERVER", "HBASE_MASTER", "HBASE_REGIONSERVER", "HIVE_SERVER", "OOZIE_SERVER"].each do |component_name|
141
+ Exec::CheckParameter.check_hadoop_component_name(component_name)[0].should be true
142
+ end
143
+ end
144
+
145
+ it "should NOT verify component name" do
146
+ Exec::CheckParameter.check_hadoop_component_name("")[0].should be false
147
+ Exec::CheckParameter.check_hadoop_component_name("miaou")[0].should be false
148
+ Exec::CheckParameter.check_hadoop_component_name("COUCOU")[0].should be false
149
+ Exec::CheckParameter.check_hadoop_component_name(" ")[0].should be false
150
+ end
151
+
152
+ end