NAS配置全记录

@vrqq  February 21, 2019

系统 RHEL7.6
Raid卡 dell perc h740p
低端AMD平台 磐正AA68MZ+Q3(pcie2.0 x1 + pcie3.0 x16 + 板载集成网卡100M) + 不带集成显卡的CPU
NVIDIA独显一枚(插pcie2.0)
遇到的坑在文章末尾会更新

板载bios

南桥插显卡这块主板是不高兴的,默认都不给开机,好在在bios里打开vga snooping,然后在PCI Setting里面NO SNOOP关掉,顺利进系统。
显卡插在pcie2.0 x1上,之前插外接显示器还好好的,最近点不亮了,但是也好。以前这个bios要探测道显示器才能开机,不然就算插了显卡也过不了自检,我不知道动了哪里,莫名其妙可以不连屏幕了,大喜。
买了个pcie x4保护插槽,把侧面锯开然后可以插pcie X16的卡,只需要前面几个连上就可。。。
请输入图片描述

证明进系统:http://guochongxin.github.io/alarm/c/c/c++/console/ioctl/keyboard/linux/%E6%97%A5%E5%BF%97/signal/timer/tty/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/2014/05/12/let_pc_keyboard_leds_flash_by_c_program
(不要在kernel space里面做啦)

装系统 装驱动

申请开发者账户 1年有效的lincense
然后参照这个 https://access.redhat.com/solutions/265523 打开官方repo

[root@nas docker]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
repo id                                                   repo name                                           status
rh-gluster-3-client-for-rhel-7-server-rpms/7Server/x86_64 Red Hat Storage Native Client for RHEL 7 (RPMs)        240
rhel-7-server-extras-rpms/x86_64                          Red Hat Enterprise Linux 7 Server - Extras (RPMs)    1,063
rhel-7-server-optional-rpms/7Server/x86_64                Red Hat Enterprise Linux 7 Server - Optional (RPMs) 17,348
rhel-7-server-rh-common-rpms/7Server/x86_64               Red Hat Enterprise Linux 7 Server - RH Common (RPMs    235
rhel-7-server-rpms/7Server/x86_64                         Red Hat Enterprise Linux 7 Server (RPMs)            23,690
rhel-7-server-supplementary-rpms/7Server/x86_64           Red Hat Enterprise Linux 7 Server - Supplementary (    298
rhel-server-rhscl-7-rpms/7Server/x86_64                   Red Hat Software Collections RPMs for Red Hat Enter 10,935
rhel-server-rhscl-7-source-rpms/7Server/x86_64            Red Hat Software Collections Source RPMs for Red Ha  4,529
repolist: 58,338

装google-noto-*字体、megasas驱动、docker。

ssh上传证书

cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
restorecon ~/.ssh
vim /etc/ssh/sshd_config

Raid卡管理工具

驱动直接装的sas3501?(可能是 忘记了)通用驱动
我用的Dell Perc h740p,用Avago官方的LSI Storage Authority即可,broadcom.com官网下载安装包
安装选(1) Gateway Installation, 区别在这里 https://docs.broadcom.com/docs-and-downloads/raid-controllers/DB15-001161-03_pub-005290_2015-11-25_LSI_Storage_Authority_Software_User_Guide.pdf
装完以后浏览器 http://localhost:2463 可以配置了
新建VirtualDrive一定关掉磁盘缓存(磁盘缓存没有掉电保护),我的配置是写write-back,读direct,没有read-ahead。
我用的HGST HUH721008AL4200 不带SED但是带ISE,因此raid卡的加密就没开,这块盘4k native也不涉及4k对齐。
卡的缓存写入4GB/s直接跑满带宽,依托于大缓存,速度拉爆系统盘直连的SSD。
新建VD以后,raid卡会在后台扫描磁盘,我的8TB需要9小时,我没有等他直接开写(我不知道如果报错会如何)。

Raid管理器之Rebuild

某一天进管理器突然发现提示降级了:
Virtual Drive:
Logical Drive 0 has missing physical devices , state is degraded
我也是很奇怪啊,这是咋了大兄弟,然后发现!硬盘线掉了。。。
https://localhost:2463 用登录系统的账号看看,只看到下图,咦咋连个进度条都没有呢?
rebuild.png
我也是很迷,然后发现咦咋连创建修改阵列都不行呢!
研究了许久。。突发奇想换root帐号试试!果然ok!
进度条已经走了50% 显示剩余5小时。。。

Docker 权限配置

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/getting_started_with_containers/get_started_with_docker_formatted_container_images#user_namespaces_options

## append on /etc/subuid
vrqq:1000:1 # mapping to root in this namespace
vrqq:60000:10000 #mapping to normal user in this namespace
## append on /etc/subgid
vrqq:1000:1 # uid of root in namespace
vrqq:60000:10000 # normal user-group-id in namespace
## modify /etc/docker/daemon.json
{
 "userns-remap": "vrqq",
}

Introduction about subuid/subgid
Thanks for https://www.binss.me/blog/solve-docker-permission-problem-by-using-user-namespace/
Base on the configuration file above, the first part, the name of user in the bare OS is vrqq.
The first line : When we use root in container(namespace) the uid mapping to the bare OS is 1000, and the privilege is same as the user which uid=1000 in bare OS.
The second line: When we create a user in container, for example, the uid is 888(in namespace), the corresponding uid in bare OS is 60887, because the uid is begin from 1. (1 in container = 60000 in bare OS)
因为开了selinux,docker共享目录时候需要加:z参数!(例如-v /hostfolder:/vmfolder:z)

下载器 base on docker

sudo docker run -d \
--name aria2-with-webui \
-p 6800:6800 \
-p 6888:8080 \
-v /home/vrqq/Downloads:/data \
-v /home/vrqq/Downloads/aria_config:/conf \
-e SECRET=123456 \
xujinkai/aria2-with-webui

翻墙工具

下载器也需要翻墙不是!在阿里云开了个docker images服务,简直神速!
https://github.com/noahziheng/ssr-helper
https://github.com/shadowsocksr-rm/shadowsocksr
欢迎用我的镜像,就是把上面两个揉在一起了,详见https://code.aliyun.com/vrqq3118/docker-ssr-helper.git

##安装
podman run -d --name ssr -p10086:1080 -e "SUBSCRIBE=https://my.subscribe.address/s/1234" registry.cn-beijing.aliyuncs.com/vrqq/ssr

##配置(一次就可以)
podman exec -it ssr bash
ssr local ##修改监听0.0.0.0
ssr delay ##测速

##更新
podman exec -it ssr ssr-subscribe update -d

##直连
podman exec -it ssr bash
ssr connect

##测试
curl -x socks5h://127.0.0.1:10086 https://www.google.com

##debug
podman exec -it ssr bash
/usr/bin/python /shadowsocksr-manyuser/shadowsocks/local.py --fast-open -c /root/.config/ssr-helper-nodejs/default.json

浏览器设代理socks5 localhost:10086

坑 网卡离奇失踪

参见这篇啦:https://blog.vrqq.org/archives/393/


仅有一条评论

  1. Test Test

    Test

添加新评论