raid配置

1. Centos7配置软RAID 1 准备两块新硬盘,最好是同容量同转速的,新加硬盘必需重新启动系统才能读取: 列出所有磁盘: [root@linux-node1 ~]# fdisk -l [root@linux-node1 ~]# fdisk /dev/sdb 新建分区/dev/sdb1,并更改ID为fd(Linux raid autodetect类型),按w退出并保存 [root@linux-node1 ~]# fdisk /dev/sdc 新建分区/dev/sdc1,并更改ID为fdLinux raid autodetect类型),按w退出并保存 使用partprobe /dev/sdb,partprobe /dev/sdc命令让linux内核重新读取硬盘参数 使用mdadm -C /dev/md0 -l 1 -a yes -n 2 /dev/sdb1 /dev/sdc1命令新建一个md0 软RAID mkfs -t ext4 /dev/md0格式化RAID分区 mkdir /raid && mount /dev/md0 /raid 新建目录并挂载分区 vim /etc/fstab 增加开机启动设备 /dev/md0 /raid ext4 defaults 0 0 mount -a 检查开机启动设备文件是否无误 2. ubuntu 18.04.5 2.1 小插曲 在制作软RAID之前,安装ubuntu18.04.5安装了两次,第一次安装在500G的 /dev/sda机械硬盘{安装一半中止安装} 第二次安装在240G的 /dev/sdb固态硬盘,最终以固态硬盘为系统盘启动 在系统中查看到根目录下挂载了LV,但是通过lvdisplay查看到有两块盘都挂载在/目录下,但有一个是活动,一个未活动,想删除未活动的,没有命令,最后重启后生效,以下是过程 root@ubuntu-18:/etc/apt# pvdisplay --- Physical volume --- PV Name /dev/sdb5 VG Name ubuntu-18-vg PV Size <222....

June 30, 2025 · 38 min · 8013 words · Jack

LetsEncrypt安装及使用

LetsEncrypt 1. 安装certbot和certbot-nginx插件 [root@prometheus conf]# yum install certbot python2-certbot-nginx [root@prometheus conf]# certbot --help (the certbot apache plugin is not installed) --standalone Run a standalone webserver for authentication --nginx Use the Nginx plugin for authentication & installation #装好nginx插件才有 --webroot Place files in a server's webroot folder for authentication --manual Obtain certificates interactively, or using shell script [root@prometheus conf]# certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log The nginx plugin is not working; there may be problems with your existing configuration....

July 26, 2024 · 8 min · 1624 words · Jack

nexus包管理

nexus私服 介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。 利用Nexus你可以只在一个地方就能够完全控制访问和部署在你所维护仓库中的每个Artifact。 Nexus是一套“开箱即用”的系统不需要数据库,它使用文件系统加Lucene来组织数据。 这里有很多仓库,简单介绍下 central: 中央仓库,默认从https://repo1.maven.org/maven2/拉取jar。类型:proxy releases: 自定义的jar存储的仓库。类型:hosted snapshots: 私库快照(调试版本)jar。类型:hosted public: 仓库分组,把上面三个仓库组合在一起对外提供服务,在本地maven基础配置settings.xml中使用。类型:group 类型 Nexus的仓库分为这么几类: hosted 宿主仓库:主要用于部署无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动)以及自己或第三方的项目构件; proxy 代理仓库:代理公共的远程仓库; virtual 虚拟仓库:用于适配 Maven 1; group 仓库组:Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库。 安装 docker run -d -p 8010:8081 –name nexus-dotnet -v /data/nexus3:/nexus-data sonatype/nexus3:3.32.0 备份恢复 备份 只需要备份nexus-data目录即可。 恢复 #chmod -R 770 /data/nexus-data && chown -R root.200 /data/nexus-data chmod -R 777 /data/nexus-data docker run -d -p 8010:8081 --name nexus-dotnet -v /data/nexus-data:/nexus-data sonatype/nexus3:3.32.0 maven 安装 wget http://mirrors....

February 2, 2024 · 4 min · 771 words · Jack

frp安装及使用

frp就是一个反向代理软件,它体积轻量但功能很强大,可以使处于内网或防火墙后的设备对外界提供服务,它支持HTTP、TCP、UDP等众多协议。我们今天仅讨论TCP和UDP相关的内容。 为什么需要内网穿透功能 从公网中访问自己的私有设备向来是一件难事儿 自己的主力台式机、NAS等等设备,它们可能处于路由器后,或者运营商因为IP地址短缺不给你分配公网IP地址。如果我们想直接访问到这些设备(远程桌面,远程文件,SSH等等),一般来说要通过一些转发或者P2P组网软件的帮助。 我有一台计算机位于一个很复杂的局域网中,我想要实现远程桌面和文件访问,目前来看其所处的网络环境很难通过简单的端口映射将其暴露在公网之中,我试过这么几种方法: 远程桌面使用TeamViewer。可用,但需要访问端也拥有TeamViewer软件,不是很方便,希望能使用Windows自带的远程桌面。且TeamViewer不易实现远程文件访问。 使用蒲公英VPN软件进行组网,可用,但免费版本网络速度极慢,体验不佳,几乎无法正常使用。 使用花生壳软件进行DDNS解析,可用,但同第二点所述,免费版本有带宽限制,无法实际使用。 搭建frp服务器进行内网穿透,可用且推荐,可以达到不错的速度,且理论上可以开放任何想要的端口,可以实现的功能远不止远程桌面或者文件共享。 frp安装 curl -OL https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz tar xf frp_0.44.0_linux_amd64.tar.gz -C /usr/local/ cd /usr/local/ ln -sv frp_0.44.0_linux_amd64/ frp cd frp vim frps.ini frp服务端配置 [root@prometheus frp]# cat frps.ini [common] bind_port = 7123 #frp server port vhost_http_port = 8088 #http port vhost_https_port = 8099 #https port token = idBANrqAS3hDK #frp token [root@prometheus frp]# systemctl cat frp.service #frp服务端启动脚本 # /usr/lib/systemd/system/frp.service [Unit] Description=The nginx HTTP and reverse proxy server After=network....

June 15, 2023 · 2 min · 368 words · Jack

hugo安装及使用

hugo简介 世界上最快的网站构建框架 Hugo是最受欢迎的开源静态站点生成器之一。凭借其惊人的速度和灵活性,Hugo 让构建网站再次变得有趣。 1. 安装hugo [root@prometheus download]# axel -n 30 https://github.com/gohugoio/hugo/releases/download/v0.113.0/hugo_0.113.0_linux-amd64.tar.gz [root@prometheus download]# tar xf hugo_0.113.0_linux-amd64.tar.gz -C /usr/local/bin/ 2. 安装git [root@prometheus download]# yum install -y git 3. 配置hugo [root@prometheus download]# mkdir /opt/hugo [root@prometheus download]# cd /opt/hugo [root@prometheus hugo]# hugo new site blog [root@prometheus hugo]# cd blog/ [root@prometheus blog]# git init Initialized empty Git repository in /opt/hugo/blog/.git/ # 此步可能需要科学上网 [root@prometheus blog]# git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod ############ # 配置代理,方可进行下面clone [root@docker /usr/local/hugo/quickstart]# export HTTP_PROXY="http://172....

June 15, 2023 · 3 min · 570 words · Jack