centos7安装grafana
设置源
1 | vi /etc/yum.repos.d/grafana.repo |
源文件内容
1 | [grafana] |
安装
1 | yum install grafana |
启动
1 | systemctl start grafana-server |
设为开机启动
1 | systemctl enable grafana-server |
访问
设置源
1 | vi /etc/yum.repos.d/grafana.repo |
源文件内容
1 | [grafana] |
安装
1 | yum install grafana |
启动
1 | systemctl start grafana-server |
设为开机启动
1 | systemctl enable grafana-server |
访问
找到grafana.db
数据库,用sqlite工具执行下无sql语句
1 | update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin'; |
重置后登录用户和密码为:admin/admin
下载地址https://downloads.mysql.com/archives/community/
找到想要的版本
1 | yum install libaio |
提示依赖mysql-community-client
和mysql-community-common
1 | wget https://downloads.mysql.com/archives/get/p/23/file/mysql-community-common-5.7.34-1.el7.x86_64.rpm |
提示依赖mysql-community-libs
1 | wget https://downloads.mysql.com/archives/get/p/23/file/mysql-community-libs-5.7.34-1.el7.x86_64.rpm |
一共需要下面4个文件
1 | systemctl start mysqld |
如果没有设置密码
1 | /usr/bin/mysqladmin -u root password 'xxx' |
如果设置了密码
1 | 找到密码 |
新创建的用户,使用sudo
切换到root
时提示错误
1 | xxx is not in the sudoers file. This incident will be reported. |
解决方法:
1 | 切换到`root`下 |
按官网步骤
1 | sudo yum remove docker \ |
1 | sudo yum install -y yum-utils |
启用Nightly版
1 | sudo yum-config-manager --enable docker-ce-nightly |
安装
1 | sudo yum install docker-ce docker-ce-cli containerd.io |
搜索可用版本
1 | yum list docker-ce --showduplicates | sort -r |
指定版本
1 | sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io |
1 | sudo systemctl start docker |
1 | sudo docker run hello-world |
acme.sh
官方安装
1 | curl https://get.acme.sh | sh -s email=my@example.com |
安装之后会在目录下生成个.acme.sh
目录
资源在github,经常下载失败,手动克隆仓库安装
把https://github.com/acmesh-official/acme.sh
同步到gitee上,再克隆下来,执行下面命令
1 | git https://gitee.com/xxx/acme.sh.git |
1 | acme.sh --issue -d www.example.com --webroot /home/wwwroot/example.com/ |
如果80端口只配置了一个站点,可以这样
1 | apache |
官方例子nginx
1 | acme.sh --install-cert -d www.example.com \ |
官方例子apache
1 | acme.sh --install-cert -d www.example.com \ |
拷贝到指定的目录
1 | cp ~/.acme.sh/www.example.com/fullchain.cer /etc/nginx/ssl/www.example.com.cer |
修改nginx配置/etc/nginx/conf.d/www.example.com.conf
1 | listen 443 ssl; |
1 | ssl_certificate /etc/nginx/ssl/www.example.com.cer; |
1 | server { |
创建一个用户
1 | useradd username |
创建用户并创建用户目录
1 | useradd -m username |
创建用户不创建用户目录
1 | useradd -M username |
创建用户不用于登录
1 | useradd -s /sbin/nologin |
创建用户不用于登录和不创建目录
1 | useradd -s /sbin/nologin -M username |
1 | userdel username |
把用户目录也删掉
1 | userdel -r username |
1 | passwd username |
创建组
1 | groupadd groupname |
删除组
1 | groupadd groupname |
用户加入组
1 | usermod -G groupname username |
用户加入组(并从原来组中移出)
1 | usermod -g groupname username |
用户移出用户组
1 | gpasswd -d username groupname |
所有用户
1 | cat /etc/passwd |
所有用户组
1 | cat /etc/group |
远程ssh连接服务器,默认长时间不用会自动断开,设置不自动断开方式有三种
1 | 相当于每隔120秒向服务器发送心跳 |
如果ssh服务器信息放~/.ssh/config
中的,设置ServerAliveInterval
值
1 | Host alias |
修改sshd_config
1 | vi vim /etc/ssh/sshd_config |
本地安装kubernetes
开发环境minikube
。
minikube官网选择系统对应的安装包
1 | curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 |
启动minikube
查看运行结果
1 | minikube start |
安装之后,apt用的是阿里镜像,运行apt-get update
报错
1 | W: GPG error: https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB |
解决方法
1 | sudo curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add - |
下载地址github clash
1 | wget https://github.com/Dreamacro/clash/releases/download/v1.8.0/clash-linux-amd64-v1.8.0.gz |
解压
1 | gunzip clash-linux-amd64-v1.8.0.gz |
创建clash目录
1 | mkdir ~/clash |
复制文件到clash
目录
1 | mv clash-linux-amd64-v1.8.0 ~/clash/clash |
进入clash
目录下载配置
1 | cd ~/clash |
启动class
1 | ./clash -d . |
打开clash dashboard,设置:Host: 127.0.0.1,端口: 9090
打开网络设置代理,HTTP和HTTPS代理为 127.0.0.1:7890,Socks代理为 127.0.0.1:7891。