一、安装所需软件
- 最新版cerebro:https://github.com/lmenezes/cerebro/releases/download/v0.9.4/cerebro-0.9.4-1.noarch.rpm
- JDK版本选择:
如果不开启登录验证的话,jdk8就可以支持。
如果开启登录验证之后,使用jdk8会报错:
play.api.UnexpectedException: Unexpected exception[RuntimeException: java.lang.UnsupportedClassVersionError: controllers/routes has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0]
升级到jdk11后问题解决。
二、启动配置
问题1:找不到jdk路径。
Jan 12 09:14:17 openeuler1 cerebro[2260176]: No java installations was detected.
Jan 12 09:14:17 openeuler1 cerebro[2260176]: Please go to http://www.java.com/getjava/ and download
我配置JDK的系统环境变量JAVA_HOME和PATH后,启动还是找不到jdk。
修改了/usr/share/cerebro/bin/cerebro文件后解决,
在
#java_cmd is overrode in process_args when -java-home is used
declare java_cmd=$(get_java_cmd)
之前添加一行:
declare -a JAVA_HOME=/opt/jdk-11.0.13
问题2:配置文件配置报错
Jan 12 09:15:18 openeuler1 cerebro[2260563]: Configuration error: Configuration error[application.conf @ file:/usr/share/cerebro/conf/application.conf: 71: List should have ended with ] or had a comma, instead had token: ‘=’ (if you want ‘=’ to be part of a string value, then double-quote it)]
修改如下解决:
hosts = [
{
host = "http://target_es:9200"
name = "cluster_name"
# headers-whitelist = [ "x-proxy-user", "x-proxy-roles", "X-Forwarded-For" ]
},
{
host = "http://target_es1:9200"
name = "cluster_name1"
# headers-whitelist = [ "x-proxy-user", "x-proxy-roles", "X-Forwarded-For" ]
}
# Example of host with authentication
#{
# host = "http://some-authenticated-host:9200"
# name = "Secured Cluster"
# auth = {
# username = "username"
# password = "secret-password"
# }
#}
]
问题3:找不到数据文件
Jan 12 09:19:45 openeuler1 cerebro[2262418]: Caused by: java.sql.SQLException: opening db: ‘./cerebro.db’: Permission denied
检查配置文件,修改cerebro.db文件路径为绝对路径。
# Path of local database file
data.path: "/var/lib/cerebro/cerebro.db"
开启登录验证,配置如下:
# Authentication
auth = {
# either basic or ldap
//type: ${?AUTH_TYPE}
type: basic
settings {
# LDAP
url = ${?LDAP_URL}
# OpenLDAP might be something like "ou=People,dc=domain,dc=com"
base-dn = ${?LDAP_BASE_DN}
# Usually method should be "simple" otherwise, set it to the SASL mechanisms to try
method = ${?LDAP_METHOD}
# user-template executes a string.format() operation where
# username is passed in first, followed by base-dn. Some examples
# - %s => leave user untouched
# - %s@domain.com => append "@domain.com" to username
# - uid=%s,%s => usual case of OpenLDAP
user-template = ${?LDAP_USER_TEMPLATE}
// User identifier that can perform searches
bind-dn = ${?LDAP_BIND_DN}
bind-pw = ${?LDAP_BIND_PWD}
group-search {
// If left unset parent's base-dn will be used
base-dn = ${?LDAP_GROUP_BASE_DN}
// Attribute that represent the user, for example uid or mail
user-attr = ${?LDAP_USER_ATTR}
// Define a separate template for user-attr
// If left unset parent's user-template will be used
user-attr-template = ${?LDAP_USER_ATTR_TEMPLATE}
// Filter that tests membership of the group. If this property is empty then there is no group membership check
// AD example => memberOf=CN=mygroup,ou=ouofthegroup,DC=domain,DC=com
// OpenLDAP example => CN=mygroup
group = ${?LDAP_GROUP}
}
# Basic auth
username = "cerebro"
//username = ${?BASIC_AUTH_USER}
//password = ${?BASIC_AUTH_PWD}
password = "cerebro"
}
}




