Spark 官方提供的二进制下载版本缺少对Hive的支持,需要自己下载源码进行编译,加入hive的支持。

解压并修改maven repo为国内地址源(有2处)。

$ tar zxvf spark-3.2.1.tgz
$ cd spark-3.2.1
$ vim pom.xml
<!--url>https://maven-central.storage-download.googleapis.com/maven2/</url-->
<url>https://maven.aliyun.com/repository/public</url>

编译

$ export MAVEN_OPTS="-Xss64m -Xmx2g -XX:ReservedCodeCacheSize=1g"
$ ./dev/make-distribution.sh --name hadoop-3.3.2-hive-3.1.3 --tgz -Pyarn -Dhadoop.version=3.3.2 -Phive -Phive-thriftserver -DskipTests

其中-Phive -Phive-thriftserver参数就是启用hive支持,MAVEN_OPTS参数必须的,否则编译过程中会提示java内存不足.

安装

$ sudo apt install mysql-server

查看默认账号密码

$ sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket   = /var/run/mysqld/mysqld.sock

修改密码

$ mysql -udebian-sys-maint -pJRvfA0JiQGk5qhnz
mysql>USE mysql;

// mysql 5.7
mysql>UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql>update mysql.user set authentication_string=password('xxx') where User='root' and Host='localhost';
// mysql 8.0
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';

mysql>flush privileges;
mysql>exit;

安装lftools

$ sudo apt install python3-pip
$ sudo python3 -m pip install -U pip
$ sudo python3 -m pip install -U setuptools
$ sudo -H pip3 install --ignore-installed PyYAML
$ sudo pip3 install lftools

配置

$ vim ~/.netrc
machine nexus.akraino.org
login <LF ID>
password <Password>

上传CD log

$ vim push_logs.sh
# Deploying logs to LF Nexus log server ##
# BUILD_NUMBER and JOB_NAME should be set by Jenkins

NEXUS_URL=https://nexus.akraino.org
SILO=myais
JENKINS_HOSTNAME=https://52.83.xx.xxx/
JOB_NAME=smartcities
BUILD_NUMBER=8
BUILD_URL="${JENKINS_HOSTNAME}/job/${JOB_NAME}/${BUILD_NUMBER}/"
NEXUS_PATH="${SILO}/job/${JOB_NAME}/${BUILD_NUMBER}"

lftools deploy logs $NEXUS_URL $NEXUS_PATH $BUILD_URL

echo "Logs uploaded to $NEXUS_URL/content/sites/logs/$NEXUS_PATH"

上传BluVal Results

$ zip -r results.zip ./results
NEXUS_PATH="/pcei/job/v2"
NEXUS_URL="https://nexus.akraino.org/"
lftools deploy nexus-zip $NEXUS_URL logs $NEXUS_PATH results.zip

错误新如下:

Configure Gradle memory settings using '-Xmx' JVM option (e.g. '-Xmx2048m'.)

全局设置下Android Studio的内存。

Settings ==> Appearance & Behavior ==> System Settings ==> Memory Settings.
三个内存设置都调大为2048M

查看k3s anget启动日志,有如下错误。

$ systemctl status k3s-agent.service

`time="2022-04-09T05:03:40+08:00" level=error msg="CA cert validation failed: Get \"https://127.0.0.1:6444/cacerts\": x509: certificate has expired or is not yet valid: current time 2022-04-09T05:`

表面上看是请求到的server证书,时间早于证书的notBefore time,分析原因可能是两个系统的时区和时间不一致导致。

统一到utc时区,并自动更新时间

$ timedatectl set-timezone UTC
$ timedatectl set-ntp yes

然后需要重新安装k3s server, 之前agnet就能正常连接到server了

默认运行容器的时候,网络是一个隔离的子网络,不能通过localhost访问宿主机的端口

docker 官方从18版本开始提供host.docker.internal访问宿主机,但默认只能Mac和Windows使用。
Linux 从20.04版本开始支持通过添加运行参数的方式来支持.

--add-host=host.docker.internal:host-gateway

如果是老版本可以用下面的参数来让容器和宿主机出于同一个网络中。

--net="host"

SONiC 配置管理口的ip地址

  1. 查询已存在的设置

    $ redis-cli -n 4 keys "MGMT_INTERFACE*"
  2. 如果已有设置就删除

    $ redis-cli -n 4 DEL "MGMT_INTERFACE|eth0|10.20.30.40/24"
  3. 编辑配置文件

    $ vim mgmt_ip.json
    {
            "MGMT_INTERFACE": {
                    "eth0|192.168.0.116/24": {
                            "gwaddr": "192.168.0.1"
                    }
            }
    }
  4. 加载配置文件,并保存

    $ sudo config load mgmt_ip.json
    $ redis-cli -n 4 save
    $ redis-cli save
    $ sudo config save
  5. 重启网络

    $ sudo systemctl restart interfaces-config
  6. 检查配置

    $ /sbin/ifconfig eth0

参考:https://github.com/Azure/SONiC/blob/master/doc/SONiC-User-Manual.md

  1. 下载离线包
    在官方release地址下载k3s和k3s-airgap-images-xxx.tar.gz, 在 https://get.k3s.io 下载 k3s_install.sh 脚本
  2. 安装依赖包

    sudo apt-get update
    sudo apt-get install nfs-common
  3. 离线安装

    sudo cp ./k3s /usr/local/bin/
    sudo chmod +x /usr/local/bin/k3s
    
    sudo mkdir -p /var/lib/rancher/k3s/agent/images/
    sudo cp ./k3s-airgap-images-arm64.tar.gz /var/lib/rancher/k3s/agent/images/
    
    sudo chmod +x ./k3s_install.sh

Server docker模式

sudo INSTALL_K3S_SKIP_DOWNLOAD=true ./k3s_install.sh --docker