基础爬虫服务配置和安装

1.首先建立独立的安装包目录:makir 姓名全拼
2.安装Anaconda  :wget https://repo.continuum.io/archive/Anaconda3-2020.02-Linux-x86_64.sh 
		· 报错-bash: wget: command not found   
		· 执行:yum -y install wget
	2.1.在Anaconda存在的目录下执行bash Anaconda3-2020.02-Linux-x86_64.sh 指定安装
		· 报错:bunzip2: command not found
		· 执行:yum install -y bzip2
	完成后重启连接
3.安装pip3:wget https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz
	3.1 当前目录下执行解压:tar -zxvf pip-18.0.tar.gz
	3.2 执行安装:cd pip-18.0  后 python setup.py install
4.安装 Chrome:
	4.1 配置yum源
		4.1.1 首先安装google的epel源 vi /etc/yum.repos.d/google.repo
			[google]
			name=Google-x86_64
			baseurl=http://dl.google.com/linux/rpm/stable/x86_64
			enabled=1
			gpgcheck=0
			gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
		4.1.2 更新源 yum update
	4.2 安装google chrome浏览器 
		yum -y install google-chrome-stable
	4.3 找到chrome路径,并做个软连接,方便使用
		which google-chrome-stable  
		ln -s 路径 /bin/chrome
	4.4 解决root用户不能运行chrome 
		vim /opt/google/chrome/google-chrome
		改写最后一行  exec -a "$0" "$HERE/chrome" "$@" --no-sandbox $HOME
5. 安装mysql
	5.1 ### 下载并安装MySQL官方的 Yum Repository
		下载 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
		安装 yum -y install mysql57-community-release-el7-10.noarch.rpm
		启动服务 yum -y install mysql-community-server
	5.2 ### MySQL数据库设置
		首先启动MySQL systemctl start  mysqld.service
		查看MySQL运行状态 systemctl status mysqld.service
		通过如下命令可以在日志文件中找出密码(首次进入)grep "password" /var/log/mysqld.log
		进入数据库 mysql -uroot -p
		修改密码参数 
			set global validate_password_length=1;
			set global validate_password_policy=0;
			 update user set authentication_string=passworD("test") where user='root';
		修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
		以后每次yum操作都会自动更新,需要把这个卸载掉 yum -y remove mysql57-community-release-el7-10.noarch
	5.3 权限设置 
		所有用户登录 GRANT ALL PRIVILEGES ON *.* TO 'root'`@`'%' IDENTIFIED BY 'admin123'  `WITH GRANT OPTION;
		指定用户登录 `GRANT ALL PRIVILEGES ON *.* TO` `'myuser'``@``'192.168.1.104'`  `IDENTIFIED BY` `'admin123'`  `WITH GRANT OPTION;`
6. 端口设置
	6.1 开启防火墙 
		systemctl start firewalld.service
	6.2 通过以下命令开放`http`  `80` 端口
		firewall-cmd --add-service=http --permanent
		firewall-cmd --add-port=80/tcp --permanent
	6.3 重启防火墙
		firewall-cmd --reload
7.华为云配置kafka服务:
	7.1:首先设置基础条件配置
	7.2:更新安全组:点击kafka名字
	7.4:添加资源组:管理与部属中云监控创建资源组
8. 配置redis
	8.1 安装reids  和 官网步骤相同
	8.2 配置redis 配置文件 redis.conf
		8.2.1 后台启动服务 daemonize 值设为yes
		8.2.3 修改密码
				# requirepass foobared  
				requirepass 123 指定密码123(如果已启动redis 修改完配置文件要先杀死redis进程在重启才会生效)
		8.2.4 启动令 ./src/redis-server ./redis.conf
9. kafka ssl 连接:		
	9.1 :安装jdk
	9.2 :下载或生成ssl证书  
	9.3 : 配置python参数
		9.3.1 	python ssl 协议
				self.context = ssl.create_default_context()  
				self.context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)  
				self.context.verify_mode = ssl.CERT_REQUIRED  
				kafka ssl证书
				self.context.load_verify_locations("phy_ca.crt")
		9.3.2	配置KafkaProducer参数
				sasl_mechanism="PLAIN",  
				ssl_context=self.context,  
				security_protocol='SASL_SSL',
				sasl_plain_username=self.conf['用户名'],  
				sasl_plain_password=self.conf['密码']


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值