obd安装ocp,启动失败

先安装的集群。
再新增obagent和ocp组件

ocp-obagent.yaml

cat ocp-obagent.yaml 
obagent:
  depends:
    - oceanbase-ce
  servers:
    - name: server1
      # Please don't use hostname, only IP can be supported
      ip: 127.0.0.1
  global:
    home_path: /home/admin/obagent
ocp-express:
  depends:
    - oceanbase-ce
    - obproxy-ce
    - obagent
  servers:
    - 127.0.0.1
  global:
    # The working directory for prometheus. prometheus is started under this directory. This is a required field.
    home_path: /home/admin/ocp-express
    # log_dir: /home/oceanbase/ocp-express/log # The log directory of ocp express server. The default value is {home_path}/log.
    memory_size: 1G # The memory size of ocp-express server.  The recommend value is 512MB * (expect node num + expect tenant num) * 60MB.
    # logging_file_total_size_cap: 10G # The total log file size of ocp-express server
    # logging_file_max_history: 1 # The maximum of retention days the log archive log files to keep. The default value is unlimited

[admin@z ~]$  obd cluster component add obdemo -c ocp-obagent.yaml
Get local repositories and plugins ok
Cluster status check ok
Get added repositories and plugins ok
Open ssh connection ok
Generate observer configuration ok
Connect to observer 127.0.0.1:2881 ok
Create tenant ocp_meta ok
+-------------------------------------------------------------------------------------------+
|                                          Packages                                         |
+-------------+---------+------------------------+------------------------------------------+
| Repository  | Version | Release                | Md5                                      |
+-------------+---------+------------------------+------------------------------------------+
| obagent     | 4.2.2   | 100000042024011120.el7 | 19739a07a12eab736aff86ecf357b1ae660b554e |
| ocp-express | 4.2.2   | 100000022024011120.el7 | 09ffcf156d1df9318a78af52656f499d2315e3f7 |
+-------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Load param plugin ok
Parameter check ok
Initializes obagent work home ok
Initializes ocp-express work home ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository install ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository lib check ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository install ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository lib check !!
Try to get lib-repository
Remote openjdk-jre-1.8.0_322-b09.el7-051aa69c5abb8697d15c2f0dcb1392b3f815f7ed repository install ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository lib check ok
Search plugins ok
Load cluster param plugin ok
Check before start obagent ok
Check before start ocp-express ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
Start ocp-express ok
[ERROR] failed to start 127.0.0.1 ocp-express
[ERROR] ocp-express start failed
+-------------------------------------------------------------------+
|                              obagent                              |
+----------------+--------------------+--------------------+--------+
| ip             | mgragent_http_port | monagent_http_port | status |
+----------------+--------------------+--------------------+--------+
| 1xxxx | 8089               | 8088               | active |
+----------------+--------------------+--------------------+--------+
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 814dd23c-549b-11ef-9b15-6c92bfce2490
If you want to view detailed obd logs, please run: obd display-trace 814dd23c-549b-11ef-9b15-6c92bfce2490

obd display-trace 814dd23c-549b-11ef-9b15-6c92bfce2490报错部分的日志:


[2024-08-07 17:01:05.432] [INFO] Start ocp-express
[2024-08-07 17:01:05.433] [DEBUG] -- local execute: cat /home/admin/ocp-express/run/ocp-express.pid 
[2024-08-07 17:01:05.439] [DEBUG] -- exited code 1, error output:
[2024-08-07 17:01:05.439] [DEBUG] cat: /home/admin/ocp-express/run/ocp-express.pid: No such file or directory
[2024-08-07 17:01:05.439] [DEBUG] 
[2024-08-07 17:01:05.439] [DEBUG] -- local execute: ls /home/admin/ocp-express/.bootstrapped 
[2024-08-07 17:01:05.445] [DEBUG] -- exited code 2, error output:
[2024-08-07 17:01:05.445] [DEBUG] ls: cannot access /home/admin/ocp-express/.bootstrapped: No such file or directory
[2024-08-07 17:01:05.445] [DEBUG] 
[2024-08-07 17:01:05.446] [DEBUG] -- connect 127.0.0.1 -P2883 -umeta@ocp_meta -p10933hKSlR
[2024-08-07 17:01:05.558] [DEBUG] -- admin@127.0.0.1 append '/home/admin/ocp-express/jre/bin:' to PATH
[2024-08-07 17:01:05.559] [DEBUG] -- local execute: ls <ssh.SshReturn object at 0x7f2d0ecd0ee0> 
[2024-08-07 17:01:05.564] [DEBUG] -- exited code 1, error output:
[2024-08-07 17:01:05.564] [DEBUG] /bin/sh: -c: line 0: syntax error near unexpected token `newline'
[2024-08-07 17:01:05.564] [DEBUG] /bin/sh: -c: line 0: `ls <ssh.SshReturn object at 0x7f2d0ecd0ee0>'
[2024-08-07 17:01:05.564] [DEBUG] 
[2024-08-07 17:01:05.565] [DEBUG] -- admin@127.0.0.1 set env OCP_EXPRESS_INIT_PROPERTIES to '{"cluster": {"name": "obdemo", "obClusterId": 1, "rootSysPassword": "E1ipLCQQ5bKQ7tz7RZZn", "ser
verAddresses": [], "obCredentials": [{"tenantName": "ocp_meta", "username": "root", "password": "Snh3iOTTgw"}]}, "agentUsername": "admin", "agentPassword": "qYoQz550T", "agentAuthType": "OC
P_DIGEST"}'
[2024-08-07 17:01:05.565] [DEBUG] -- admin@127.0.0.1 set env OCP_EXPRESS_ADMIN_PASSWD to 's1L)@5mJ'
[2024-08-07 17:01:05.565] [DEBUG] -- admin@127.0.0.1 set env JDBC_PASSWORD to '10933hKSlR'
[2024-08-07 17:01:05.565] [DEBUG] -- local execute: cd /home/admin/ocp-express; bash -c 'java -jar -Xms512m -Xmx512m -DJDBC_URL=jdbc:oceanbase://127.0.0.1:2883/ocp_meta -DJDBC_USERNAME=meta
@ocp_meta -DPUBLIC_KEY= /home/admin/ocp-express/lib/ocp-express-server.jar --port=8180 --bootstrap --progress-log=/home/admin/ocp-express/log/bootstrap.log --with-property=logging.file.max-
size:100MB --with-property=ocp.logging.file.total.size.cap:1GB --with-property=logging.file.name:/home/admin/ocp-express/log/ocp-express.log > /dev/null 2>&1 &' 
[2024-08-07 17:01:05.571] [DEBUG] -- exited code 0
[2024-08-07 17:01:05.572] [DEBUG] -- local execute: ps -aux | grep 'java -jar -Xms512m -Xmx512m -DJDBC_URL=jdbc:oceanbase://127.0.0.1:2883/ocp_meta -DJDBC_USERNAME=meta@ocp_meta -DPUBLIC_KE
Y= /home/admin/ocp-express/lib/ocp-express-server.jar --port=8180 --bootstrap --progress-log=/home/admin/ocp-express/log/bootstrap.log --with-property=logging.file.max-size:100MB --with-pro
perty=ocp.logging.file.total.size.cap:1GB --with-property=logging.file.name:/home/admin/ocp-express/log/ocp-express.log' | grep -v grep | awk '{print $2}'  
[2024-08-07 17:01:05.621] [DEBUG] -- exited code 0
[2024-08-07 17:01:05.622] [DEBUG] -- write 18577 to /home/admin/ocp-express/run/ocp-express.pid
[2024-08-07 17:01:05.622] [DEBUG] -- open /home/admin/ocp-express/run/ocp-express.pid for w
[2024-08-07 17:01:05.622] [DEBUG] -- mkdir /home/admin/ocp-express/run
[2024-08-07 17:01:05.695] [INFO] ocp-express program health check
[2024-08-07 17:01:05.696] [DEBUG] -- 127.0.0.1 program health check
[2024-08-07 17:01:05.696] [DEBUG] -- local execute: ls /proc/18577 
[2024-08-07 17:01:05.703] [DEBUG] -- exited code 0
[2024-08-07 17:01:05.704] [DEBUG] -- local execute: bash -c 'cat /proc/net/{tcp*,udp*}' | awk -F' ' '{print $2,$10}' | grep '00000000:1FF4' | awk -F' ' '{print $2}' | uniq 
[2024-08-07 17:01:05.718] [DEBUG] -- exited code 0

提示pid文件不存在,我看是存在的。进程也在。

[admin@zz~]$ cat /home/admin/ocp-express/run/ocp-express.pid
18577
[admin@zz~]$ 
[admin@zz~]$ 
[admin@zz~]$ ps -ef|grep 18577
admin     18577      1  3 17:01 pts/0    00:01:27 java -jar -Xms512m -Xmx512m -DJDBC_URL=jdbc:oceanbase://127.0.0.1:2883/ocp_meta -DJDBC_USERNAME=meta@ocp_meta -DPUBLIC_KEY= /home/admin/ocp-express/lib/ocp-express-server.jar --port=8180 --bootstrap --progress-log=/home/admin/ocp-express/log/bootstrap.log --with-property=logging.file.max-size:100MB --with-property=ocp.logging.file.total.size.cap:1GB --with-property=logging.file.name:/home/admin/ocp-express/log/ocp-express.log
admin     49662  47083  0 17:47 pts/0    00:00:00 grep --color=auto 18577

ocp 日志有报错:
less /home/admin/ocp-express/log/ocp-express.log


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2024-08-07 17:01:22.146  INFO 18577 --- [main,,] c.o.o.b.spring.BootstrapRunListener      : BootstrapRunListener failed
2024-08-07 17:01:22.201 ERROR 18577 --- [main,,] c.o.ocp.analyzer.OcpFailureAnalyzer      : OCP startup check failed with cause: 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocpExpressInitializer': Invocation of init method failed; nested exception is java.lang.RuntimeException: Init by spring config files failed, please check config file format
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920) ~[spring-context-5.3.27.jar!/:5.3.27]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.27.jar!/:5.3.27]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) [spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) [spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) [spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) [spring-boot-2.7.12.jar!/:2.7.12]
        at com.oceanbase.ocp.OcpExpressApplication.main(OcpExpressApplication.java:21) [classes!/:4.2.2-20240108]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_332]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_332]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_332]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_332]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [ocp-express-server.jar:4.2.2-20240108]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) [ocp-express-server.jar:4.2.2-20240108]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [ocp-express-server.jar:4.2.2-20240108]
        at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) [ocp-express-server.jar:4.2.2-20240108]
Caused by: java.lang.RuntimeException: Init by spring config files failed, please check config file format

obd cluster start xxxx -c ocp-express
单独启动试试呢

报错:[ERROR] No such component: ocp-express

ob集群也是黑屏化部署的吧?

ocp日志一直在刷这个报错:

2024-08-07 18:11:20.384 ERROR 18577 --- [pool-schedule-monitor-meta-1,,] c.o.o.m.helper.MonitorMetaMapContainer   : loadMetricExpr error.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boo
t/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/oceanbase/ocp/config/datasource/MetaDbConfiguration.
class]: Initialization of bean failed; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.datasource
-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Could not bind properties to 'DataSourceProperties' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownF
ields=true; nested exception is java.lang.IllegalStateException: org.springframework.context.annotation.AnnotationConfigApplicationContext@31610302 has been closed already
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.27.jar
!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory$1.orderedStream(DefaultListableBeanFactory.java:481) ~[spring-beans-5.3.27.jar!/:5.3.27]
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:167) ~[spring-tx-
5.3.27.jar!/:5.3.27]
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:149) ~[spring-tx-5.3.27.jar!/:5.3.27]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
        at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:174) ~[s
pring-data-jpa-2.7.12.jar!/:2.7.12]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.27.jar!/:5.3.27]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:220) ~[spring-aop-5.3.27.jar!/:5.3.27]

config文件再看一下是否存在语法问题

这个配置文件前面发了。
还是说看当前正在使用的。


这里只填ip就行,不用name和ip这种格式
image

和ob风格保持一致

1 个赞

666啊,改了这果然好了。

加组件的配置文件
cat ocp-obagent.yaml

obagent:
  depends:
    - oceanbase-ce
  servers:
    - 127.0.0.1
  global:
    home_path: /home/admin/obagent
ocp-express:
  depends:
    - oceanbase-ce
    - obproxy-ce
    - obagent
  servers:
    - 127.0.0.1
  global:
    # The working directory for prometheus. prometheus is started under this directory. This is a required field.
    home_path: /home/admin/ocp-express
    # log_dir: /home/oceanbase/ocp-express/log # The log directory of ocp express server. The default value is {home_path}/log.
    memory_size: 1G # The memory size of ocp-express server.  The recommend value is 512MB * (expect node num + expect tenant num) * 60MB.
    # logging_file_total_size_cap: 10G # The total log file size of ocp-express server
    # logging_file_max_history: 1 # The maximum of retention days the log archive log files to keep. The default value is unlimited

重新卸载安装的命令:

#  kill  obagent相关进程
ps -ef|grep obagent
kill -9 xx
# 删除相关目录
rm -rf /home/admin/obagent
rm -rf /home/admin/ocp-express

# 删除租户ocp_meta
obd cluster tenant drop obdemo -t ocp_meta
obd cluster tenant show obdemo

# 重新安装
obd cluster component add obdemo -c ocp-obagent.yaml
1 个赞