ahfncj 发表于 2021-7-21 00:21

使用低功耗双网卡小主机打造迷你AIO服务器-

本帖最后由 ahfncj 于 2021-7-21 00:27 编辑

本人原创
一.购买原因最近逛恩山的时候发现有一款KODLIX品牌J4105的双网口小主机在开车,价格是690元,内置4G内存及64G硬盘.恩山坛友-15,然后我就上车买了一台回来玩玩,前几篇写的文章使用的还是unraid6.8版本,新版6.9.2有许多操作都有了一些变化,故借这个小主机重新写一篇分享一下经验(毕竟好几个月没有更新).虽然好多朋友说aio容易崩,而且一崩全完蛋,但是本人使用aio将近二年,一直稳定使用中,重要文件也在黑群中组建了raid1并同步至微软网盘.此文我仅仅介绍软路由与影音服务器,下载服务的搭建,并无太过重要的私人数据,所以没有组建阵列和做数据备份.如有需求请自行添加校验盘保证数据安全.此篇文章适用大部分双网卡小主机.
二.机器配置及接口https://raw.githubusercontent.com/ahfncj/PicGo/main/img/lighter
Kodlix GK45 Mini PC
Processor:Intel® Celeron® J4105 Processor , 4 Cores/4 Threads(4M Cache, up to 2.50 GHz)
GPU:Intel® UHD Graphics 600
Memory:LPDDR4 4GB (On Board)
Storage:eMMC 64GB (On Board)
Storage Expansion
1×M.2 2280 SATA SSD Slot (up to 1TB , SATA 3.0 6.0Gb/s)1×M.2 2242 PCIe SSD Slot (up to 1TB , PCle)1×2.5 inch SATA HDD Slot (SATA 3.0 6.0Gb/s)1×TF Card Slot (up to 128GB)
Wireless Connectivity:IEEE 802.11ac Dual-Band Wi-Fi,BT5.0
Ethernet:1000Mbps LAN*2
Video Output
① HDMI 2.0(4K@60Hz)
② Mini DP(4K@60Hz)
③ USB-C Port(4K@60Hz)
机器内置4G内存不可扩展,硬盘有三种扩展接口2.5英寸sata,1×M.2 2280 SATA SSD,1×M.2 2242 PCIe SSD.存储扩展还算比较丰富,做简易nas也基本够用,也可外接WD的My Book 3.5寸外置硬盘,三个输出接口都支持4K60hz,其中type-c是全功能的,显示器有type-c接口并可以供电的用一根type-c线就可以完成图像传输和机器供电.
三.系统搭建思路
[*]unraid系统的安装我不再赘述,网上教程很多,很简单.开心版也有,不过建议支持正版,基础版59美金也不贵,可以满足大部分人的需求.
[*]网络部分这样考虑.双网卡其中一块直通给openwrt虚拟当作软路由wan口使用,直接连接光猫.另外一块网卡当作unraid虚拟交换机.unraid和Docker容器及openwrt的LAN口共用.
[*]PLEX或者jellyfin调用UHD600的核显进行硬件转码(自己在外网或者分享给朋友观看)(我的好几个朋友都在白嫖我的视频服务器)
四.搭建教程
1.直通网卡设置
进入系统界面先到设置菜单的网络设置选项.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720221747067.png
进入网络设置选项
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720222049440.png
去除ETH1勾选,点击APPLY应用生效.此网卡稍后将直通给openwrt虚机.
下面来到TOOL选项,打开系统设备管理.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720222506214.png
勾选ETH1网卡,禁止unraid系统使用.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720222620304.png
重启后生效.直通其他的设备也同样使用此方法.

2.启动磁盘序列

https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720224312526.png
这机器主要就是放电影之类的文件,对安全性需求不高,就不配置校验盘了,有几块盘就整几个数据盘,选择完成后点start开启磁盘序列.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720225217030.png
磁盘第一次使用需要格式化.

3.安装应用商店并切换中文

https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720225533119.png
https://raw.githubusercontent.com/Squidly271/community.applications/master/plugins/community.applications.plg

点击插件选项,选择安装选项,将上方地址黏贴到地址栏里点击install.然后刷新网页,就会出现APPS应用商店.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720225750630.png
点击APPS应用商店,根据上图表示,下载并切换至中文.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720230157891.png

4.设置SMB共享访问

设置共享文件夹权限
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720230946743.png
将安全性设置为私有,并将设置应用到其他共享文件夹.
点击用户选项卡创建一个账户(不支持root账户使用SMB)
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720230601369.png
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720230638464.png
创建完成后点击用户名进入账户设置界面
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720230742439.png
设置相应的共享文件夹访问权限.
打开windows资源管理器输入 \unraid的ip地址
比如的我的就是: \192.168.8.215
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720231256599.png
填写刚刚新建的用户名及密码登录
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720231642560.png
5.安装openwrt软路由
将openwrt的img映像上传到unraid的共享文件夹.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720231842974.png
点击unraid的虚拟机选项,新建一个linux虚机.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720232001874.png
按图填写,openwrt分配2个核心,使用1G内存即可.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720232217426.png
勾选刚刚直通的网卡
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720232300782.png
然后点击创建即可.
将光猫出口接到主机的ETH1口,主机的ETH0接口接交换机或者AP模式的路由器,下层的设备会自动获取到IP地址.
一般openwrt的网段为192.168.1.0.管理地址为192.168.1.1.根据你使用的固件信息来访问.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720232534112.png
6.安装qBittorrent 下载工具先新建一个video共享文件夹并设置访问权限.保存下载的电影及电视剧等影视音文件.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720232826077.png
然后来到应用商店界面搜索并安装qBittorrent,作者喜欢使用linuxserver的版本.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233056677.png
按下图填写即可,需要填写的只有一项,下载的保存目录.我们将unraid的video文件夹映射到容器的/downloads文件夹.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233250379.png
切换到docker选项,点击qb的图标,然后点击webui即可打开qb的管理界面.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233506469.png
默认用户名:admin 密码:adminadmin
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233536982.png
登陆后按下图操作切换到中文.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233635457.png
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233722354.png

7.开启intel核显

6.9.2中开启核显很简单,到应用商店安装Intel GPU TOP插件即可
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720233915461.png

8.安装jellyfin并设置硬件转码

我个人是PLEX+EMBY的正版用户,但是免费的jellyfin更适合白嫖的同志们.所以在这里介绍jellyfin的安装.plex和emby的安装类似就不单独介绍了.
打开应用商店搜索jellyfin,这里也使用linuxserver的版本
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720234934560.png
按下图填写实际的影视音文件的目录.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235157561.png
Nvdia哪一项是n卡硬件解码使用的,我们小主机是intel核显,故需要移除此项.点击添加选项,我们来添加intel核显给jellyfin使用.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235411895.png
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235539418.png
添加完成后点击应用,会拉取镜像并创建docker容器.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235658089.png
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235720765.png
创建完成后,按照打开QB管理界面的流程即可打开jellyfin的管理界面.按照自身需求填写相关选项.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235838961.png
设置管理员账户.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210720235935873.png

添加相应影视音的媒体库
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721000124004.png
设置元数据语言及国家
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721000202865.png
配置远程访问
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721000218878.png
点击完成即可登录jellyfin.
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721000259457.png
欣赏自己下载的精彩节目吧
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721000702021.png

9.安装FileBrowser文件管理器

参照前面的docker安装流程,按下图设置即可
https://raw.githubusercontent.com/ahfncj/PicGo/main/img/image-20210721001049734.png

五.总结
J4105的性能在低功耗CPU里还是很不错的,硬件解码4K电影,CPU使用率也只在35%左右.

夏冰萱 发表于 2021-7-21 09:50

这个配置可以刷黑群晖

ahfncj 发表于 2021-7-21 16:37

unraid功能比群晖强,而且扩展不了几个硬盘装群晖没意义

haierccc 发表于 2021-7-21 18:42

好文收藏!      

固特异轮胎 发表于 2021-7-21 21:37

可以可以,果然高玩

DoctorX99 发表于 2021-7-21 21:53

早点看到就好了,之前玩了一下根本玩不转

yhhuada66 发表于 2021-7-29 22:42

厉害,保姆级教程呀,有高端小主机了可以试试,谢谢
页: [1]
查看完整版本: 使用低功耗双网卡小主机打造迷你AIO服务器-