Skip to content

Commit

Permalink
Merge pull request #1953 from toabctl/monasca-cleanup
Browse files Browse the repository at this point in the history
Replace monasca-installer with chef/crowbar
  • Loading branch information
dirkmueller authored Feb 4, 2019
2 parents 6ea5a75 + 645ec4a commit e13c4a7
Show file tree
Hide file tree
Showing 71 changed files with 5,001 additions and 973 deletions.
3 changes: 1 addition & 2 deletions chef/cookbooks/crowbar-openstack/libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def fetch_rabbitmq_settings(barclamp=@cookbook_name)
end

def no_monasca_server_or_master
monasca_master = node_search_with_cache("roles:monasca-master").first
monasca_server = node_search_with_cache("roles:monasca-server").first
monasca_master.nil? || monasca_server.nil?
monasca_server.nil?
end
end
end
Expand Down
19 changes: 10 additions & 9 deletions chef/cookbooks/horizon/files/default/grafana-monasca.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@
}
],
"metricNameColor": "#000000",
"rangeMaps": [],
"rangeMaps": [
{
"from": "1",
"text": "UP",
"to": "100"
}
],
"rowHeight": 50,
"showDistinctCount": false,
"showLegend": true,
Expand All @@ -253,7 +259,7 @@
"alias": "@hostname",
"dimensions": [
{
"key": "component",
"key": "process_name",
"value": "monasca-persister"
},
{
Expand All @@ -263,7 +269,7 @@
],
"error": "",
"group": false,
"metric": "http_status",
"metric": "process.pid_count",
"period": "300",
"refId": "A"
}
Expand All @@ -272,15 +278,10 @@
"title": "Persister",
"type": "natel-discrete-panel",
"valueMaps": [
{
"op": "=",
"text": "UP",
"value": "0"
},
{
"op": "=",
"text": "DOWN",
"value": "1"
"value": "0"
}
],
"valueTextColor": "#000000",
Expand Down
7 changes: 3 additions & 4 deletions chef/cookbooks/horizon/recipes/monasca_ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
return
end
monasca_cfg = Barclamp::Config.load("openstack", "monasca")
grafana_password = monasca_cfg["master"]["database_grafana_password"]
grafana_password = monasca_cfg["db_grafana"]["password"]
db_settings = fetch_database_settings

# Used for creating data source
grafana_base_url = ::File.join(MonascaUiHelper.dashboard_local_url(node), "/grafana")
Expand Down Expand Up @@ -50,9 +51,7 @@
template "/etc/grafana/grafana.ini" do
source "grafana.ini.erb"
variables(
database_host: CrowbarHelper.get_host_for_admin_url(
monasca_server, monasca_cfg["ha"]["enabled"]
),
database_host: db_settings[:address],
grafana_password: grafana_password
)
owner "root"
Expand Down
91 changes: 87 additions & 4 deletions chef/cookbooks/monasca/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,29 @@
# See the License for the specific language governing permissions and
# limitation.

default[:monasca][:db][:database] = "monasca"
default[:monasca][:db][:user] = "monasca"
default[:monasca][:db][:password] = nil # must be set by wrapper

override[:monasca][:group] = "monasca"
override[:monasca][:user] = "monasca"

default[:monasca][:api][:bind_host] = "*"
default[:monasca][:api][:bind_port] = 8070

default[:monasca][:log_api][:bind_port] = 5607
default[:monasca][:log_api][:user] = "monasca-log-api"
default[:monasca][:log_api][:group] = "monasca"

default[:monasca][:kibana][:bind_port] = 5601
default[:monasca][:delegate_role] = "monasca-delegate"

# Database Settings
default[:monasca][:db_monapi][:password] = nil
default[:monasca][:db_monapi][:user] = "monapi"
# Don't change the database name. "mon" is hardcoded in the mysql mon.sql schema file
default[:monasca][:db_monapi][:database] = "mon"

default[:monasca][:db_grafana][:password] = nil
default[:monasca][:db_grafana][:user] = "grafana"
default[:monasca][:db_grafana][:database] = "grafana"

# agent default service settings
default[:monasca][:agent]["user"] = "monasca-agent"
default[:monasca][:agent][:group] = "monasca"
Expand All @@ -40,5 +48,80 @@
default[:monasca][:log_agent][:user] = "root"
default[:monasca][:log_agent][:group] = "root"

# log-transformer
default[:monasca][:log_transformer][:user] = "monasca-log-transformer"
default[:monasca][:log_transformer][:group] = "logstash"

# log-persister
default[:monasca][:log_persister][:user] = "monasca-log-persister"
default[:monasca][:log_persister][:group] = "logstash"

# log-metrics
default[:monasca][:log_metrics][:user] = "monasca-log-metrics"
default[:monasca][:log_metrics][:group] = "logstash"

# HA attributes
default[:monasca][:ha][:enabled] = false

# zookeeper
default[:monasca][:zookeeper][:data_dir] = "/var/lib/zookeeper/data"
default[:monasca][:zookeeper][:client_port_address] = "0.0.0.0"
default[:monasca][:zookeeper][:client_port] = 2181

# kafka
default[:monasca][:kafka][:listen_address] = nil
default[:monasca][:kafka][:port] = 9092
default[:monasca][:kafka][:num_network_threads] = 2
default[:monasca][:kafka][:num_io_threads] = 2
default[:monasca][:kafka][:socket_send_buffer_bytes] = 1048576
default[:monasca][:kafka][:socket_receive_buffer_bytes] = 1048576
default[:monasca][:kafka][:socket_request_max_bytes] = 104857600
default[:monasca][:kafka][:connections_max_idle_ms] = 86400000
default[:monasca][:kafka][:data_dir] = "/var/kafka"
default[:monasca][:kafka][:auto_create_topics] = "false"
default[:monasca][:kafka][:num_partitions] = 2
default[:monasca][:kafka][:log_flush_interval_messages] = 10000
default[:monasca][:kafka][:log_flush_interval_ms] = 1000
default[:monasca][:kafka][:log_retention_hours] = 24
default[:monasca][:kafka][:log_retention_bytes] = 21474836480
default[:monasca][:kafka][:log_segment_bytes] = 104857600
default[:monasca][:kafka][:replica_fetch_max_bytes] = 1048576
default[:monasca][:kafka][:message_max_bytes] = 1000012
default[:monasca][:kafka][:zookeeper_connection_timeout_ms] = 1000000

# elasticsearch
default[:monasca][:elasticsearch][:cluster_name] = "elasticsearch"
default[:monasca][:elasticsearch][:is_master_node] = "true"
default[:monasca][:elasticsearch][:is_data_node] = "true"
default[:monasca][:elasticsearch][:data_dirs] = ["/var/data/elasticsearch"]
default[:monasca][:elasticsearch][:log_dir] = "/var/log/elasticsearch"
default[:monasca][:elasticsearch][:repo_dirs] = []
default[:monasca][:elasticsearch][:bootstrap_memory_lock] = "true"

# storm
default[:monasca][:storm][:user] = "storm"
default[:monasca][:storm][:group] = "storm"
default[:monasca][:storm][:nimbus_thrift_port] = 6627

# influxdb
default[:monasca][:influxdb][:user] = "influxdb"
default[:monasca][:influxdb][:group] = "influxdb"
default[:monasca][:influxdb][:client_port] = 8086

# monasca-thresh
default[:monasca][:thresh][:user] = "monasca-thresh"
default[:monasca][:thresh][:group] = "monasca"

# monasca-notification
default[:monasca][:notification][:user] = "monasca-notification"
default[:monasca][:notification][:group] = "monasca"

# monasca-persister
default[:monasca][:persister][:user] = "monasca-persister"
default[:monasca][:persister][:group] = "monasca"
default[:monasca][:persister][:influxdb_user] = "mon_persister"

# monasca-api
default[:monasca][:api][:user] = "monasca-api"
default[:monasca][:api][:group] = "monasca"
default[:monasca][:api][:influxdb_user] = "mon_api"
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"order" : 0,
"template" : "*",
"settings" : {
"index.refresh_interval" : "5s",
"index" : {
"analysis": {
"analyzer" : {
"no_token" : {
"type" : "custom",
"tokenizer" : "keyword",
"filter" : "lowercase"
}
}
}
}
},
"mappings" : {
"_default_" : {
"dynamic_templates" : [ {
"message_field" : {
"mapping" : {
"index" : "analyzed",
"omit_norms" : true,
"type" : "string"
},
"match_mapping_type" : "string",
"match" : "message"
}
}, {
"string_fields" : {
"mapping" : {
"analyzer" : "no_token",
"omit_norms" : true,
"type" : "string"
},
"match_mapping_type" : "string",
"match" : "*"
}
} ],
"properties" : {
"geoip" : {
"dynamic" : true,
"properties" : {
"location" : {
"type" : "geo_point"
}
},
"type" : "object"
},
"@version" : {
"index" : "not_analyzed",
"type" : "string"
}
},
"_all" : {
"enabled" : true,
"omit_norms" : true
}
}
},
"aliases" : { }
}
Loading

0 comments on commit e13c4a7

Please sign in to comment.