Giter Site home page Giter Site logo

opscloud4's Introduction

Welcome to the opscloud wiki!

Thanks to JetBrains

Thanks JetBrains to support the project providing such great IDE.

GitHub Stats Card

OpsCloud4 云上运维


Security Status

架构图

Code repository

Database

登录信息

  • username:baiyi
  • password:空密码

开发环境

  • OpenJDK 21
  • node-v16.13.0
  • MacBook M1
  • IntelliJ IDEA 2023
  • WebStorm 2023

Leo持续交付

  • 构建

  • 部署

  • 规则配置(封网)

  • 任务配置

容器堡垒机(集成:Leo持续交付版本信息,多可用区部署可视化)

主要功能

  • Leo持续交付(Kubernetes)
    • 全冗余架构,多Jenkins引擎且无状态
    • 权限控制/封网策略
    • 分组(蓝/绿),金丝雀部署;可视化发布过程
  • 多实例动态数据源,万物皆资产
  • 堡垒机
    • 服务器Web终端
      • 多服务器同时连接+命令同步、会话复制、会话心跳
      • 支持ED25519、RSA密钥
    • KubernetesWeb终端
      • 多容器同时登录+命令同步、容器日志、会话心跳
    • SSH-Server
      • 原生SSH协议实现,支持ED25519密钥
      • 简化用户登录,自动关联用户GitLab账户公钥
      • 支持服务器、容器登录
flowchart LR
    A[User] -->|SSH:22| B{SLB}
    B-->|TCP:2222| C[Opscloud Server] 
    B-->|TCP:2222| D[Opscloud Server] 
    
    E[User] -->|ssh ed25519 | F{{SSH-Server}}
    F-->|ssh ed25519| G[Linux] 
  • 服务器批量任务
    • Ansible Playbook
    • 单服务器多线程实现,任务日志更加清晰
  • RBAC,MFA(OTP)
  • 集群架构
    • 实例健康检查接口 /api/instance/health/lb-check (GET)
    • 分布式调度任务(Quartz)、定时任务分布式锁(Shedlock)、任务并发锁(Redis)
    • 高性能、可伸缩、高可用性
  • 标签驱动、事件驱动
  • API文档
    • example.com/doc.html
    • API Token

Services & Ports

service protocol port startup parameter
web http 8080 --server.port=8080
ssh-server ssh 2222 --ssh.shell.port=2222

功能截图

系统环境 标签管理
集群管理 服务器管理
远程控制(RDP/VNC) 服务器(批量操作,会话复制,高低权限,布局切换)
服务器(批量操作,会话复制,高低权限,布局切换) 服务器(批量操作,会话复制,高低权限,布局切换)
容器(支持登录操作或只读查看日志) 容器(支持登录操作或只读查看日志)
SSH-Server SSH-Server
SSH-Server SSH-Server
SSH-Server 审计
剧本 剧本
剧本 剧本
用户 用户
MFA 数据源
数据源 数据源
数据源

平台演示视频1

帮助文档

传送门:https://www.kancloud.cn/ixrjog/opscloud4/2361886

交流群

Q群: 630913972

opscloud4's People

Contributors

ixrjog avatar xj921022 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opscloud4's Issues

tomcat启动报错

一个是sl4j 一个是jdbc链接 memery leak 大概就是 在注册的时候已经有一个注册了

关于4.0版本的一些问题

我已经下载了4.0版本的前端项目和后端项目两个工程,并使用两个项目的默认分支,进行了打包运行。想请教如下问题:

功能介绍部分下载sql是不是不太全?问题体现在:

  • /api/auth/menu/query 这个接口访问的时候404
  • /oc3路径需要修改为/api
  • 登录后再去访问时,发现access_token表不存在,已经修改为user_api_token,但是access_token并未更新,也未看到有更新的逻辑

目前遇到了这几个问题,请指点迷津,感谢!

OpenLDAP用户无法认证

环境信息:
OS: CentOS Linux release 7.6.1810 (Core)
LDAP: openldap-servers-2.4.44-15.el7_5.x86_64
jdk: Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
tomcat: apache-tomcat-8.0.36

OpenLDAP配置如下:
suffix "dc=limeng,dc=org"
rootdn "cn=openldap,dc=limeng,dc=org"
举个例子:
DN: cn=User,ou=Group,dc=limeng,dc=org
DN: cn=guiqing,cn=User,ou=Group,dc=limeng,dc=org

server.properties配置文件中的LDAP配置如下:
# ldap配置,建议使用apacheDS,用户dn:cn=user1,ou=users,ou=system
ldapUrl=ldap://ldap.duozheng.org:389
ldapBase=
ldapUserDn=cn=User,ou=Group
ldapPwd=rootpw

yapi可以通过LDAP登录,相关配置信息如下:
"ldapLogin": {
"enable": true,
"server": "ldap://ldap.duozheng.org:389",
"baseDn": "cn=openldap,dc=limeng,dc=org",
"bindPassword": "rootpw",
"searchDn": "cn=User,ou=Group,dc=limeng,dc=org",
"searchStandard": "cn",
"emailPostfix": "@邮箱后缀",
"emailKey": "mail",
"usernameKey": "name"
}

报错信息:
LDAP用户无法登录,web报错"登录凭证错误!"
image

tomcat日志如下:
image

Gitlab API 错误

ui点击git仓库,gitlab报错:
28-May-2019 15:36:41.362 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Spring-Dispatcher] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: java.io.FileNotFoundException: http://gitlab.xxx.com:80/api/v4/projects/1/repository/tags?per_page=100] with root cause
java.io.FileNotFoundException: http://gitlab.xxx.com:80/api/v4/projects/1/repository/tags?per_page=100
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at org.gitlab.api.http.GitlabHTTPRequestor.parse(GitlabHTTPRequestor.java:363)
at org.gitlab.api.http.GitlabHTTPRequestor.access$200(GitlabHTTPRequestor.java:38)
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:236)

gitlab version:11.0.3
Gitlab API version: v4
我用postman测试token可以正常返回project list。
postman get : http://gitlab.xxx.com/api/v4/projects?private_token=7y3y2b11e-7LB_o-C_Q8

web无法访问

安装好,tomcat正常启动,但是web却无法访问,netstat查看也有访问连接,3306,6379,8080这些服务端口都有连接,但web就是打不开网页?

opscloud.war在哪里?

解压opscloud.war,并将解压文件复制到/usr/local/tomcat/webapps/ROOT/
注意:不要带项目路径opscloud

opscloud.war在哪里?

请求pending

jumpserver需要配置嘛,tomcat启动成功了,但是请求无响应

mvn 报错

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/ws/XtermWSController.java:[35,8] class XTermWSController is public, should be declared in a file named XTermWSController.java
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/ticket/impl/handler/TicketServerGroupHandler.java:[65,68] cannot find symbol
symbol: method getServerGroup()
location: variable serverGroupEntry of type com.baiyi.opscloud.factory.ticket.entry.ServerGroupEntry
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/ticket/impl/handler/TicketServerGroupHandler.java:[70,72] cannot find symbol
symbol: method getNeedAdministratorAccount()
location: variable serverGroupEntry of type com.baiyi.opscloud.factory.ticket.entry.ServerGroupEntry
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/change/consumer/impl/BaseServerChangeConsumer.java:[73,58] cannot find symbol
symbol: method getCode()
location: variable changeResult of type com.baiyi.opscloud.factory.change.consumer.bo.ChangeResult
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/change/consumer/impl/BaseServerChangeConsumer.java:[74,57] cannot find symbol
symbol: method getMsg()
location: variable changeResult of type com.baiyi.opscloud.factory.change.consumer.bo.ChangeResult
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/change/consumer/impl/BaseServerChangeConsumer.java:[82,54] cannot find symbol
symbol: method getCode()
location: variable changeResult of type com.baiyi.opscloud.factory.change.consumer.bo.ChangeResult
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/change/consumer/impl/BaseServerChangeConsumer.java:[83,53] cannot find symbol
symbol: method getMsg()
location: variable changeResult of type com.baiyi.opscloud.factory.change.consumer.bo.ChangeResult
[ERROR] /app/opsCloud-master/opscloud-manage/src/main/java/com/baiyi/opscloud/factory/change/consumer/impl/ApplicationStopConsumer.java:[64,53] cannot find symbol
symbol: method builder()

tomcat

请问安装步骤5中,opscloud.war从哪里下载?
“3. 修改opscloud配置文件/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/server.properties”
这个修改的配置内容是什么?文档中写的不是很清楚。

关于快速体验项目的建议

我已经下载了4.0.3版本的前端项目和后端项目两个工程,并使用两个项目的默认分支,并成功打包运行了,目前遇到了一个问题。

sql是不是不太全,问题体现在:当我用demo账户登录时提示我鉴权失败,后来我到数据库中看了一下权限相关的表,发现里面的数据都是空的。这就让人很难办,首先我不了解该项目表结构之间的关联关系,当然如果我查阅源码也是可以自己归发现的,但是那样很耗时的,对于想快速体验该项目的同学很不友好。

小建议

希望初始化数据中有一个admin账号,该账号包含了所有权限。

最后感谢分享!

运行成功但是缺失一些数据表

我根据部署文档成功运行了这个项目,但是似乎缺失一些关键数据表,请问哪里可以找到这些表
目前已知缺失的表有:oc_instance oc_submenu oc_role_menu

资产订阅有用例吗?

看V4.0.4,资源只有ansible源,没有接入其他的源。手动改了前端,改了zabbix,剧本怎么配置呢?有用例吗?
image

3.0.1的版本mvn构建的时候提示缺少jar包

Failed to execute goal on project opscloud-dingtalk: Could not resolve dependencies for project com.baiyi:opscloud-dingtalk:jar:0.0.1-SNAPSHOT: Could not find artifact com.dingtalk.api:taobao-sdk-java:jar:1.0.1-20201102.123754-1 -> [Help 1]
image

貌似windows下跑不起来

  1. 环境
  • win10 1903
  • jdk1.8.0_202
  • MySQL 8.0.19
  • intellij idea 2019.3.4
  • maven 3.5.2
  1. 配置信息
  • application-open.yaml中的MySQL配置
app:
  datasource:
    opscloud:
      url: jdbc:mysql://localhost:3307/opscloud?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&useInformationSchema=true&tinyInt1isBit=true&nullCatalogMeansCurrent=true&serverTimezone=UTC&allowMultiQueries=true
      username: root
      password: 123456
      driver-class-name: com.mysql.jdbc.Driver
      minimum-idle: 3
      maximum-pool-size: 10
      max-lifetime: 30000
      connection-test-query: SELECT 1
  • 启动配置
    捕获
  1. 错误日志
2020-09-06 09:27:04.468 ERROR 6640 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'authFilter': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authBaseFacadeImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocAuthResourceServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ocAuthResourceMapper' defined in file [D:\Dev\DevOps\opscloud\opscloud-service\target\classes\com\baiyi\opscloud\mapper\opscloud\OcAuthResourceMapper.class]: Cannot resolve reference to bean 'opscloudSqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'opscloudSqlSessionTemplate' defined in class path resource [com/baiyi/opscloud/config/DatasourceOpscloudConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.SqlSessionTemplate]: Factory method 'opscloudSqlSessionTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'opscloudDataSourceSqlSessionFactory' defined in class path resource [com/baiyi/opscloud/config/DatasourceOpscloudConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'opscloudDataSourceSqlSessionFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'opscloudDataSource' defined in class path resource [com/baiyi/opscloud/config/DatasourceOpscloudConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'opscloudDataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2020-09-06 09:27:04.524  INFO 6640 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-09-06 09:27:04.543  WARN 6640 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-09-06 09:27:04.553  INFO 6640 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-09-06 09:27:04.568 ERROR 6640 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (the profiles open are currently active).


Process finished with exit code 1

搞了一早上搞不太明白,我数据库信息已经导入3.0.1版本的sql文件了,而且我本地用工具连接数据库是正常的。

请指教,谢谢

server.properties没有找到

你好,我用最新的代码构建出来的war包,解压之后在WEB-INF/classes/目录里边没有找到配置文件,目录下有com logback.groovy这些内容。

gradle clean war -DpkgName=opscloud -Denv=online -Dorg.gradle.daemon=false

环境:
Centos7
JDK1.8
Tomcat8.0.36
Gradel3.1

关于k8s的pod容器终端无法登录问题

登录容器终端的时候无法操作,感觉是没登录成功,而且后台没报错,有一些日志如下
新事件 Event success! message: SimpleEvent(eventType=USER_PERMISSION, action=CREATE, body=UserPermission(id=29047, userId=1, businessId=81, businessType=8, permissionRole=null, rate=null, content=null, createTime=null, updateTime=null))
2021-12-21 18:04:12.099 INFO 2924 --- [Async-Service-5] c.b.o.event.listener.NoticeListener : 监听事件 : eventType = USER_PERMISSION , action = CREATE
image
image
我用的4.0.4后端的代码,后端也没报错所以不好排查,大佬能帮我看看怎么解决吗
还有就是应用配置里面的应用key是填什么的,是不是因为这里的原因
image
而且终端操作页面跟你视频介绍的不一样,你视频里面的是图标我这里显示的是字母单词Terminal和Log,这两个操作看了前端请求的路径都是/api/ws/kubernetes/terminal,是不是这里的问题导致的,麻烦大佬解决这个问题,现在很需要这个功能,谢谢

gradle编译报错

执行:
gradle clean war -DpkgName=opscloud -Denv=online -Dorg.gradle.daemon=false
gradle-error

error信息:
/data/opsCloud/cmdb-service/src/main/java/com/sdg/cmdb/service/impl/NginxServiceImpl.java:14: error: package com.sun.tools.doclint does not exist
import com.sun.tools.doclint.Env;
^
Note: /data/opsCloud/cmdb-service/src/main/java/com/sdg/cmdb/service/impl/VmServiceImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:cmdb-service:compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':cmdb-service:compileJava'.

Compilation failed; see the compiler error output for details.

jdk版本:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

tomcat无法启动

日志:Could not find or load main class org.apache.catalina.startup.Bootstrap

修改sqlmode失败---Unknown system variable 'NO_ZERO_IN_DATE'

[root@devops-test-03 opsCloud]# mysql -uopscloud -popscloud
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34
Server version: 5.6.43 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select @@global.sql_mode;
+--------------------------------------------+
| @@global.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)

mysql> set @@global.sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;
ERROR 1193 (HY000): Unknown system variable 'NO_ZERO_IN_DATE'
mysql>

创建用户或者凭证报的加密错误,请问这个要怎么处理

ERROR 3494 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: either 'jasypt.encryptor.password', one of ['jasypt.encryptor.private-key-string', 'jasypt.encryptor.private-key-location'] for asymmetric encryption, or one of ['jasypt.encryptor.gcm-secret-key-string', 'jasypt.encryptor.gcm-secret-key-location', 'jasypt.encryptor.gcm-secret-key-password'] for AES/GCM encryption must be provided for Password-based or Asymmetric encryption] with root cause

mvn时报错

前面一切顺利,mvn时报如下错误,今天中午git拉取的
1808f48c31a2d4fa77b7408df207eea436714667b3c7f65d36645f925a3ac818QzpcVXNlcnNcc20tMDAxMVxBcHBEYXRhXFJvYW1pbmdcRGluZ1RhbGtcNDIzNjc2OTAzX3YyXEltYWdlRmlsZXNcODdGNkY2MzctMDc2NS00NmRiLUEzMDEtOTk1OEZDRkUxMUVFLjM2MF90aHVtYg==

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.