Yashandb数据库YCM安装
Yashandb YCM安装
到官网下载YCM软件:
https://download.yashandb.com/download
开机自启前提
管理平台开机自启需要确保对rc.local有可执行权限,可执行以下命令:
# chmod +x /etc/rc.local
将软件包上传至yasmanager用户/home/yashan路径下:
[root@yashan yasmanager]# tar xf yashandb-cloud-manager-23.3.1.0-linux-x86_64.tar.gz -C /home/yashan/
[root@yashan yasmanager]# cd /home/yashan/ycm/packages
[root@yashan packages]# mkdir yashandb-client-23.2.4.100-linux-x86_64
[root@yashan packages]# tar xf ./yashandb-clientar xf ./yashandb-clien^C
[root@yashan packages]# tar xf ./yashandb-client-23.2.4.100-linux-x86_64.tar.gz -C ./yashandb-client-23.2.4.100-linux-x86_64
[root@yashan lib]# pwd
/home/yashan/ycm/packages/yashandb-client-23.2.4.100-linux-x86_64/lib
[root@yashan ycm]# vi ./etc/deploy.yml
server:
ycm_name: 崖山监控运维平台 # 产品名称
ycm_name_en: YashanDB Cloud Manager # 产品英文名称
product_short_name: 管理平台 # 产品简称,不推荐修改
product_short_name_en: Management platform # 产品英文简称,不推荐修改
install_path: /home/yashan/ycm
system_user: yashan
ycm_port: 9060
prometheus_port: 9061
loki_http_port: 9062
loki_grpc_port: 9063
yasdb_exporter_port: 9064
prometheus_collect_interval: 10
prometheus_data_expired: 180
monit_enable: true
grpc_tls_enable: true
http_tls_enable: false
manage_ip: ""
minimumDiskPartitionSize: 1073741824
ycp_secret: TH1TkOFuUVrjlMBVeB28bsO9JLiFafY5
dbconfig:
driver: "yashandb" # 可填参数:sqlite3,yashandb。默认是sqlite3
url: "hefei/hefei@192.168.50.183:1688" # driver为yashandb时,该参数必填。单IP:ip:port,HA多ip:ip:port,ip:port,ip:port
libPath: "/home/yashan/ycm/packages/yashandb-client-23.2.4.100-linux-x86_64/lib" # driver为yashandb时,默认为{YCM_INSTALL_PATH}/YCM/tool/yasha
ndb-client/lib
client:
install_path: /home/yashan/ycm
system_user: yashan
system_group: yashan
agent_port: 9070
export_port: 9071
user:
superadmin:
# 用户和密码为admin,以下密码为加密后的密文
password: "17521182513677377011312139512002239872235871971452391332822116097549121243198103"
nickname: superman
email:
phone:
token_key: "cod-base-yasom-auth-token-key1"
token_expired: 30
password_expired: 60
retry_times: 5
lock_expired: 3
log:
console: true
level: "INFO"
rotationTime: 7
rotationSize: 10
maxBackupNum: 30
[root@yashan ycm]# ./ycm-init deploy --conf ./etc/deploy.yml --报错用下面的
[root@yashan ycm]# ./ycm-init deploy --conf ./etc/deploy.yml --force
2024-11-14 16:53:22 INFO deploy/deploy.go:200 yashandb lib path is /home/yasmanager/ycm/packages/yashandb-client-23.2.4.100-linux-x86_64/lib
2024-11-14 16:53:22 INFO deploy/manage.go:39 conf manager starting...
2024-11-14 16:53:22 INFO deploy/deploy.go:339 beginning install ycm
2024-11-14 16:53:22 INFO filectl/filectl.go:211 get dir owner uid: 0 success
2024-11-14 16:53:22 INFO execer/exec.go:30 exec: bash -c id -u yasmanager starting
2024-11-14 16:53:22 INFO filectl/filectl.go:221 get agent uid: 1003 success
2024-11-14 16:53:22 WARN deploy/deploy.go:360 user :yasmanager has not access to path:/home/yasmanager/YCM
2024-11-14 16:53:22 INFO deploy/deploy.go:248 check install path exec to other success, progress:15
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/backup is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/bin is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/data is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/installation_resource is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/log_backup is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/log_collect is detected
2024-11-14 16:53:22 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/loki is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/monit is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/notify_script is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/prometheus is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/promtail is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/tool is detected
2024-11-14 16:53:23 WARN ycm-init/ycm-init.go:109 residual data: /home/yasmanager/YCM/ycm/yashandb_exporter is detected
2024-11-14 16:53:23 INFO deploy/deploy.go:248 check ycm install residual data success, progress:17
2024-11-14 16:53:23 INFO deploy/deploy.go:248 mkdir ycm installpath success, progress:20
2024-11-14 16:53:23 INFO deploy/deploy.go:248 mkdir ycm-agent installpath success, progress:21
2024-11-14 16:53:23 INFO execer/exec.go:30 exec: bash /home/yasmanager/ycm/scripts/install.sh ycm yasmanager /home/yasmanager/YCM/ycm starting
2024-11-14 16:53:33 INFO deploy/deploy.go:261 unzip packages success, progress:30
2024-11-14 16:53:33 INFO deploy/deploy.go:248 mkdir cert path success, progress:32
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate self signed cert key success, progress:35
2024-11-14 16:53:33 INFO deploy/deploy.go:420 beginning generate ycm config file
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate ycm.yaml success, progress:40
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate config.ini success, progress:43
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate prometheus.yml success, progress:45
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate loki-local-config.yaml success, progress:47
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate promtail-local-config.yaml success, progress:48
2024-11-14 16:53:33 INFO deploy/deploy.go:248 generate yasdbpasswd.ini success, progress:50
2024-11-14 16:53:33 INFO deploy/deploy.go:248 check backend database exists table success, progress:59
2024-11-14 16:53:34 INFO model/auto_migrate.go:260 auto migrate all of 91 tables success
2024-11-14 16:53:34 WARN alarm/add_default.go:365 query alarm notify strategy is incorrect, just add default, allns: [], err: <nil>
2024-11-14 16:53:34 INFO execer/exec.go:30 exec: cp -f /home/yasmanager/YCM/ycm/loki/rules/fake/loki-rules.yaml /home/yasmanager/YCM/ycm/loki/loki-rules.yaml.bak starting
2024-11-14 16:53:34 INFO execer/exec.go:30 exec: cp -f /home/yasmanager/YCM/ycm/prometheus/rules.yml /home/yasmanager/YCM/ycm/prometheus/rules.yml.bak starting
2024-11-14 16:53:35 INFO deploy/deploy.go:248 set conf success, progress:60
2024-11-14 16:53:35 INFO deploy/deploy.go:248 set conf success, progress:65
2024-11-14 16:53:35 INFO deploy/deploy.go:248 init db success, progress:70
2024-11-14 16:53:35 INFO deploy/deploy.go:546 beginning start ycm process
2024-11-14 16:53:35 INFO execer/exec.go:30 exec: chown -R yasmanager:yasmanager /home/yasmanager/YCM/ycm starting
2024-11-14 16:53:35 INFO deploy/deploy.go:261 chown ycm path success, progress:75
2024-11-14 16:53:35 INFO execer/exec.go:30 exec: chown -R yasmanager:yasmanager /home/yasmanager/YCM/ycm-agent starting
2024-11-14 16:53:35 INFO deploy/deploy.go:261 chown ycm-agent path success, progress:76
2024-11-14 16:53:35 INFO execer/exec.go:30 exec: chmod 0755 /home/yasmanager/YCM starting
2024-11-14 16:53:35 INFO deploy/deploy.go:261 chmod path success, progress:78
2024-11-14 16:53:35 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/scripts/ycm.sh start starting
2024-11-14 16:53:36 INFO deploy/deploy.go:261 start server success, progress:80
2024-11-14 16:53:36 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/scripts/yashandb_exporter.sh start starting
2024-11-14 16:53:37 INFO deploy/deploy.go:261 start yashandb_exporter success, progress:85
2024-11-14 16:53:37 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/scripts/prometheus.sh start starting
2024-11-14 16:53:38 INFO deploy/deploy.go:261 start monitor success, progress:88
2024-11-14 16:53:38 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/scripts/loki.sh start starting
2024-11-14 16:53:39 INFO deploy/deploy.go:261 start loki success, progress:90
2024-11-14 16:53:39 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/scripts/promtail.sh start starting
2024-11-14 16:53:40 INFO deploy/deploy.go:261 start promtail success, progress:91
2024-11-14 16:53:40 INFO execer/exec.go:30 exec: bash /home/yasmanager/YCM/ycm/monit/monitctl reload starting
2024-11-14 16:53:40 INFO deploy/deploy.go:261 reload monit success, progress:93
2024-11-14 16:53:40 INFO deploy/deploy.go:304 success, progress:100
查看YCM配置的自动启动脚本:
cat /etc/rc.local
su yashan -c '/home/yashan/ycm/ycm/monit/bin/monit -c /home/yashan/ycm/ycm/monit/data/monitrc'
[root@yashan ycm]# netstat -lntup | grep ycm
tcp6 0 0 :::9060 :::* LISTEN 10987/ycm
[root@yashan ycm]# ps -ef | grep ycm
yasmana+ 4149 1 0 16:06 ? 00:00:26 /app/install/ycm/monit/bin/monit -c /app/install/ycm/monit/data/monitrc
yasmana+ 4643 1 0 16:09 ? 00:00:24 /app/install/ycm/monit/bin/monit -c /app/install/ycm/monit/data/monitrc
yasmana+ 5653 1 0 16:16 ? 00:00:22 /app/install/ycm/monit/bin/monit -c /app/install/ycm/monit/data/monitrc
yasmana+ 7173 1 0 16:29 ? 00:00:17 /home/yasmanager/YCM/ycm/monit/bin/monit -c /home/yasmanager/YCM/ycm/monit/data/monitrc
yasmana+ 9570 1 0 16:44 ? 00:00:12 /home/yasmanager/YCM/ycm/monit/bin/monit -c /home/yasmanager/YCM/ycm/monit/data/monitrc
yasmana+ 10415 1 0 16:50 ? 00:00:10 /home/yasmanager/YCM/ycm/monit/bin/monit -c /home/yasmanager/YCM/ycm/monit/data/monitrc
yasmana+ 10947 1 0 16:53 ? 00:00:09 /home/yasmanager/YCM/ycm/monit/bin/monit -c /home/yasmanager/YCM/ycm/monit/data/monitrc
yasmana+ 10987 1 2 16:53 ? 00:00:38 /home/yasmanager/YCM/ycm/bin/ycm
yasmana+ 11018 1 0 16:53 ? 00:00:00 /home/yasmanager/YCM/ycm/yashandb_exporter/yashandb_exporter --web.listen-address=:9064 --yashandb.metrics=/home/yasmanager/YCM/ycm/etc/yasexporter.metrics.yml --yashandb.targets=/home/yasmanager/YCM/ycm/etc/yasexporter.targets.yml
yasmana+ 11054 1 0 16:53 ? 00:00:07 /home/yasmanager/YCM/ycm/prometheus/prometheus --config.file=/home/yasmanager/YCM/ycm/prometheus/prometheus.yml --storage.tsdb.path=/home/yasmanager/YCM/ycm/data/prometheus --web.enable-admin-api --web.enable-lifecycle --web.listen-address=0.0.0.0:9061 --storage.tsdb.retention.time=180d --log.level=error --query.lookback-delta=30s
yasmana+ 11085 1 1 16:53 ? 00:00:19 /home/yasmanager/YCM/ycm/loki/loki -config.file=/home/yasmanager/YCM/ycm/loki/loki-local-config.yaml -log.level=error
yasmana+ 11114 1 1 16:53 ? 00:00:17 /home/yasmanager/YCM/ycm/promtail/promtail -config.file=/home/yasmanager/YCM/ycm/promtail/promtail-local-config.yaml -log.level=error
root 14013 1535 0 17:16 pts/3 00:00:00 grep --color=auto ycm
访问管理平台
部署完成即可打开浏览器访问 IP:9060
,使用管理平台服务。 – Asdf1357.
卸载
[root@yashan scripts]# pwd
/home/yasmanager/YCM/ycm/scripts
[root@yashan scripts]# sh clean.sh
原文地址:https://blog.csdn.net/hf191850699/article/details/143781777
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!