Windows +VM虚拟机安装github服务器

WARNING: This value is valid only in the following conditions

1. If provided manually (either via GITLAB_ROOT_PASSWORD environment variable or via gitlab_rails['initial_root_password'] setting in gitlab.rb, it was provided before database was seeded for the first time (usually, the first reconfigure run).

2. Password hasn’t been changed manually, either via UI or via command line.

If the password shown here doesn’t work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: HUTAZJRe+9KGfr56H4NS6Jj9fNobZxcy2qdvKji0aUQ=

NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

在浏览器中访问:http://您的虚拟机IP

首次访问需要为root用户设置密码

登录用户名:root,密码:您设置的密码

<<<<<<<<<root<<<<<<<<<<<<<
http://172.16.100.247
登录用户名:root,密码:trzn1234

<<<<<<<<常用GitLab命令<<<<<<

查看GitLab状态

sudo gitlab-ctl status

停止GitLab

sudo gitlab-ctl stop

启动GitLab

sudo gitlab-ctl start

重启GitLab

sudo gitlab-ctl restart

查看日志

sudo gitlab-ctl tail # 查看所有日志
sudo gitlab-ctl tail nginx # 查看nginx日志

备份GitLab

sudo gitlab-backup create

以下是迁移本地 GitLab 服务器的详细步骤:

一、准备工作
1.1 源服务器检查

查看 GitLab 版本

sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
17.1.0

检查配置

sudo gitlab-rake gitlab:env:info
<<<<<<<<<<<<<
System information
System: Ubuntu 24.04
Current User: git
Using RVM: no
Ruby Version: 3.1.5p253
Gem Version: 3.5.11
Bundler Version:2.5.11
Rake Version: 13.0.6
Redis Version: 7.0.15
Sidekiq Version:7.1.6
Go Version: unknown

GitLab information
Version: 17.1.0
Revision: 35cd573d799
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 14.11
URL: http://172.16.100.247
HTTP Clone URL: http://172.16.100.247/some-group/some-project.git
SSH Clone URL: [email protected]:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version: 14.36.0
Repository storages:

  • default: unix:/var/opt/gitlab/gitaly/gitaly.socket
    GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell

Gitaly

  • default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket
  • default Version: 17.1.0
  • default Git Version: 2.45.1

查看数据目录大小

sudo du -sh /var/opt/gitlab/
4.7G /var/opt/gitlab/

1.2 新服务器准备

确保新服务器满足 GitLab 硬件要求

RAM ≥ 4GB,磁盘空间 ≥ 源服务器使用量 + 20%

二、备份源服务器数据
2.1 完整备份

创建备份(包含所有数据)

sudo gitlab-backup create STRATEGY=copy

备份文件默认位置:/var/opt/gitlab/backups/

文件名示例:1766024326_2025_12_18_17.1.0_gitlab_backup.tar

2.2 备份配置文件

备份关键配置文件

sudo tar -czvf gitlab_config_backup.tar.gz
/etc/gitlab/gitlab.rb
/etc/gitlab/gitlab-secrets.json

2.3 可选:备份 SSL 证书
sudo cp -r /etc/gitlab/ssl /tmp/gitlab-ssl-backup

三、新服务器安装
3.1 安装相同版本 GitLab

方法1:通过官方脚本安装(推荐)

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

安装特定版本(与源服务器相同)

sudo apt-get install gitlab-ce=15.0.0-ce.0

或使用最新版

sudo apt-get install gitlab-ce
如果安装失败

  1. 添加 GitLab 官方软件源(如果没有添加的话)
    curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
  2. 更新软件包列表
    sudo apt-get update
  3. 再次尝试安装
    sudo apt-get install gitlab-ce=17.1.0-ce.0

3.2 停止相关服务
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
sudo gitlab-ctl stop nginx

四、迁移数据到新服务器
4.1 传输备份文件

从源服务器传输到新服务器

scp /var/opt/gitlab/backups/XXXX_gitlab_backup.tar user@新服务器IP:/tmp/
scp gitlab_config_backup.tar.gz user@新服务器IP:/tmp/

如果ssh不能用:

1. 在虚拟机中安装 SSH 服务器

sudo apt-get install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh

2. 获取虚拟机 IP 地址

ip addr show

hostname -I

4.2 恢复备份

1. 复制备份文件到正确位置

sudo cp /tmp/XXXX_gitlab_backup.tar /var/opt/gitlab/backups/

2. 恢复备份(需要备份文件名中的时间戳部分)

sudo gitlab-backup restore BACKUP=XXXX

 1. 启动 GitLab 相关服务 # 确保 GitLab 服务已启动(这会同时启动 PostgreSQL) sudo gitlab-ctl start # 或者只启动 PostgreSQL sudo gitlab-ctl start postgresql 2. 检查 PostgreSQL 状态 # 检查 PostgreSQL 是否运行 sudo gitlab-ctl status postgresql # 检查 PostgreSQL 日志 sudo gitlab-ctl tail postgresql 3. 重新执行备份恢复 sudo gitlab-backup restore BACKUP=1766024326_2025_12_18_17.1.0 

3. 恢复配置文件

sudo tar -xzvf /tmp/gitlab_config_backup.tar.gz -C /

4.3 重新配置

重新加载配置

sudo gitlab-ctl reconfigure

重启 GitLab

sudo gitlab-ctl restart

五、验证迁移
5.1 基础检查

检查服务状态

sudo gitlab-ctl status

运行健康检查

sudo gitlab-rake gitlab:check SANITIZE=true

检查项目、用户数量

sudo gitlab-rake gitlab:env:info

六、重置登录密码
sudo gitlab-rake “gitlab:password:reset”
用户名:zhangguolong
重置后的密码:zgl12345678

Read more

一文看懂:AI编程工具深度对比:Cursor、Copilot、Trae与Claude Code

一文看懂:AI编程工具深度对比:Cursor、Copilot、Trae与Claude Code

AI编程工具深度对比:Cursor、Copilot、Trae与Claude Code 引言 在人工智能技术蓬勃发展的今天,AI编程工具已成为开发者提高效率的重要助手。从早期的代码补全插件到如今能够理解整个代码库的智能助手,AI编程工具正在不断进化。本文将对当前主流的AI编程工具——Cursor、GitHub Copilot、Trae和Claude Code进行全面对比,帮助开发者选择最适合自己的工具。 主流AI编程工具概述 Cursor Cursor是一款基于VSCode的AI驱动代码编辑器,它最大的特点是能够理解整个代码库的上下文,提供智能的代码补全和重构建议。Cursor默认使用Claude-3.5-Sonnet模型,即使是OpenAI投资的公司,也选择了Claude模型作为默认选项,这足以说明其在代码生成领域的优势。 GitHub Copilot GitHub Copilot是由GitHub与OpenAI合作开发的AI编码助手,集成在VSCode、Visual Studio等主流编辑器中。它基于OpenAI的模型,能够根据注释和上下文自动生成代码,是AI编程工具

By Ne0inhk
win10升级后总会弹出365 Copilot窗口如何禁用和关闭

win10升级后总会弹出365 Copilot窗口如何禁用和关闭

win10升级后总会弹出365 Copilot窗口如何禁用和关闭 在Windows 10中,可以通过以下几种方法禁用或关闭Microsoft 365 Copilot: 方法一:任务栏上直接禁用 1. 右键点击任务栏。 2. 在弹出的菜单中,找到并取消勾选“显示 Copilot(预览版)按钮”选项。 这种方法只是让Copilot不再显示在任务栏上,但并未彻底禁用该功能。用户仍然可以通过“Windows 键 + C”键盘快捷键来打开和关闭Copilot界面。 方法二:利用组策略彻底禁用 1. 打开开始菜单,搜索“组策略”并打开组策略编辑器。 2. 按照“用户配置 > 管理模板 > Windows 组件 > Windows Copilot”的路径依次展开。 3. 双击“关闭 Windows Copilot”

By Ne0inhk
LLaMA Factory 从入门到精通,一篇讲完

LLaMA Factory 从入门到精通,一篇讲完

目录 一、LLaMA-Factory 简介 二、安装部署 三、数据微调 1、数据集的建立 2、数据集格式 3、模型参数 4、开始运行 5、导出模型 四、webui 评估预测与对话 导出 五、SFT 训练 命令行 六、LoRA 合并 合并 量化 七、推理 原始模型推理配置 微调模型推理配置 多模态模型 批量推理 八、评估 通用能力评估 NLG 评估 评估相关参数 一、LLaMA-Factory 简介 LLaMA Factory 是一个简单易用且高效的大型语言模型(Large

By Ne0inhk
Chat took too long to get ready.Please ensure...<VSCode\Copilot>

Chat took too long to get ready.Please ensure...<VSCode\Copilot>

在VScode里面,应用Copilot提问,无法解决问题,该怎么解决呢? 1、在vscode里面,按键  ctrl + shift + p,输入setting,即看到setting.json文件 2、在setting.json文件中添加下面两行   "github.copilot.nextEditSuggestions.enabled": true,   "chat.extensionUnification.enabled":false, 参考图片25、26行 3、保存,重启vscode 4、重启后,点击vscode左下角人头像,查看是否有让授权Copilot的,如果有点击一下授权,解决!!! 如果这样无法解决,建议检查账号是不是不能使用Copilot功能了

By Ne0inhk