分类
未分类

helm安装mongodb

helm install my-mongo bitnami/mongodb –set architecture=”replicaset” –set auth.rootPassword=”mongo2025″
NAME: my-mongo
LAST DEPLOYED: Fri Apr 25 04:46:27 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mongodb
CHART VERSION: 16.5.1
APP VERSION: 8.0.8

Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information.

** Please be patient while the chart is being deployed **

MongoDB® can be accessed on the following DNS name(s) and ports from within your cluster:

my-mongo-mongodb-0.my-mongo-mongodb-headless.default.svc.cluster.local:27017
my-mongo-mongodb-1.my-mongo-mongodb-headless.default.svc.cluster.local:27017

To get the root password run:

export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace default my-mongo-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 -d)

To connect to your database, create a MongoDB® client container:

kubectl run --namespace default my-mongo-mongodb-client --rm --tty -i --restart='Never' --env="MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD" --image docker.io/bitnami/mongodb:8.0.8-debian-12-r0 --command -- bash

Then, run the following command:
mongosh admin –host “my-mongo-mongodb-0.my-mongo-mongodb-headless.default.svc.cluster.local:27017,my-mongo-mongodb-1.my-mongo-mongodb-headless.default.svc.cluster.local:27017” –authenticationDatabase admin -u $MONGODB_ROOT_USER -p $MONGODB_ROOT_PASSWORD

WARNING: There are “resources” sections in the chart not set. Using “resourcesPreset” is not recommended for production. For production installations, please set the following values according to your workload needs:

  • arbiter.resources
  • resources
    +info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

分类
未分类

Docker升级到最新版本

背景: 在搭建docker私有仓库的时候出现以下错误,版本太低
Need to upgrade docker package to 17.06.0+.

1.查找主机上关于Docker的软件包

rpm -qa | grep docker

2.使用yum remove卸载软件
yum remove docker-1.13.1-103

3.使用curl升级到最新版

4.curl -fsSL https://get.docker.com/ | sh

分类
未分类

R410 Raid卡Centos8支持

驱动列表地址:

安装界面按 TAB 出现命令行 写入 inst.dd 回车

选择驱动mptsas,并选中状态按c继续回到安装界面即可

系统升级

更新kernel后不要重启

下载 8.3驱动 (根据系统版本)并安装

安装后 把驱动加载到kernel (注意版本号) dracut -f /boot/initramfs-4.18.0-240.1.1.el8_3.x86_64.img 4.18.0-240.1.1.el8_3.x86_64

相关命令:
  • /boot/loader/entries 目录下列表内核
  • grub2-editenv list 当前启动内核
  • grub2-set-default “CentOS Linux (4.18.0-193.28.1.el8_2.x86_64) 8 (Core)” 设置默认启动内核
  • /boot/grub2/grubenv 里的 saved_entry 值 代表启动内核
  • lsinitrd -k 4.18.0-240.1.1.el8_3.x86_64 | grep sas 查看内核版本的sas驱动

分类
全部分类

pyspark demo

df = spark.read.csv('/export/20001-battle-0-2019-07-29.log',sep='|')
 json
 df = spark.read.json('hdfs://bigdata1/export/logging_20190722.log')
 df.createOrReplaceTempView("df")
 ds2 = spark.sql("select token,min(ctime) as lt,max(ctime) as oft,(max(ctime)-min(ctime)) as online \
 from df where ltype='online' group by token").collect()
 collect() 直接打印全部结果集
 print ds2

[Row(token=u'3', lt=1563851449, oft=1563851979, online=530), 
 Row(token=u'0B2D0360-AC77-11E9-884A-00163E01F784', lt=1563796293, oft=1563796415, online=122)]

df.select(df.token).filter(df.ltype=='online').filter(df.guid>0).show()

+--------------------+                                                         
 |               token|
 +--------------------+
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|
 |FFDAC760-AC6F-11E…|

分类
未分类

航班统计

Python 3.6.8 (default, May  2 2019, 20:40:44) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyspark.context import SparkContext
>>> from pyspark.sql.session import SparkSession
>>> sc = SparkContext('local')
19/07/23 05:35:16 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
>>> spark = SparkSession(sc)
>>> flightPerFilePath='hdfs://10.18.3.151/export/departuredelays.csv'
>>> airportFilePath='hdfs://10.18.3.151/export/airport-codes-na.txt'
>>> aireports=spark.read.csv(airportFilePath,header='true',inferSchema='true',sep='\t')
>>> aireports.createOrReplaceTempView("airports")
>>> flightPerf=spark.read.csv(flightPerFilePath,header='true')
>>> flightPerf.createOrReplaceTempView("FlightPerformance")
>>> flightPerf.cache()
DataFrame[date: string, delay: string, distance: string, origin: string, destination: string]
>>> spark.sql("""select a.City,f.origin,sum(f.delay) as Delays from FlightPerformance f join airports a on a.IATA=f.origin 
... where a.State='WA' group by a.City,f.origin order by sum(f.delay) desc""").show()
+-------+------+--------+                                                       
|   City|origin|  Delays|
+-------+------+--------+
|Seattle|   SEA|159086.0|
|Spokane|   GEG| 12404.0|
|  Pasco|   PSC|   949.0|
+-------+------+--------+

>>>