This article will show you how to integrate spacewalk 1.7 with postgresql.Before you do,you must configure yum repository.Append following lines to your file:
[Satellite] name=SpacewalkSatellite baseurl=http://spacewalk.redhat.com/yum/1.7/RHEL/6/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012 [Satellite-ClIEnt] name=SpacewalkSatellite baseurl=http://spacewalk.redhat.com/yum/1.7-clIEnt/RHEL/6/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk-2012 [epel] name=RedHatEnterpriselinux$releasever-$basearch-DeBUG baseurl=http://dl.fedoraproject.org/pub/epel/6/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 [Centos] name=Centos baseurl=http://mirrors.163.com/centos/6.2/os/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.163.com/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6 [Centos-Update] name=Centos baseurl=http://mirrors.163.com/centos/6.2/updates/x86_64/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.163.com/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6 [Jpackes] name=jpackage baseurl=http://mirrors.dotsrc.org/jpackage/5.0/generic/free/ enabled=1 gpgcheck=1
After,use following command to install spacewalk:
yum-yinstallspacewalk-postgresql
Configure postgresql database
You will need to becomethe operating system user under which Postgresql was installed (usually postgres) to create the firstuser account. It Could also be that you were assigned a Postgresql user name that is different from youroperating system user name.By default,postgresql has already created a user postgres.
[root@sate~]#ID-apostgres uID=26(postgres)gID=26(postgres)groups=26(postgres)
1.Create database and user:
Before you do,you mustinitialize postgrsql and start it by following command.
[root@sate~]#servicepostgresqlinitdb Initializingdatabase:[OK] [root@sate~]#servicepostgresqlstart Startingpostgresqlservice:[OK]
[root@sate~]#su-postgres -bash-4.1$PGPASSWORD=redhat //Set the spaceuser's password -bash-4.1$createdbspacewalk //Create database -bash-4.1$createlangplpgsqlspacewalk -bash-4.1$createuser-P-sDRspaceuser //Create user Enterpasswordfornewrole: Enteritagain:
2.Append following contents to /var/lib/pgsql/data/pg_hba.conf:
hostallall172.16.255.0/24trust
3.Append following lines to /var/lib/pgsql/data/psotgresql.conf:
Listen_addresses='*'
4.Restart postgresql service:
[root@sate~]#servicepostgresqlrestart StopPingpostgresqlservice:[OK] Startingpostgresqlservice:[OK]
5.Connect to spacewalk database:
[root@sate~]#su-postgres postgres=#\cspacewalk psql(8.4.9) YouareNowconnectedtodatabase"spacewalk". spacewalk=# spacewalk=#\db listoftablespaces name|Owner|Location ------------+----------+---------- pg_default|postgres| pg_global|postgres| (2rows)
Configure Spacewalk by spacewalk-setup command
[root@sate~]#spacewalk-setup--disconnected **Database:SettingupdatabaseconnectionforPostgresqlbackend. Hostname(leaveemptyforlocal)?sate.xzxj.edu.cn Port[5432]? Database?spacewalk Username?spaceuser Password? ***Progress:################################## *Settingupusersandgroups. **GPG:InitializingGPGandimportingkey. Youmustenteranemailaddress. adminEmailAddress?root@localhost *Performinginitialconfiguration. *ActivatingSpacewalk. **LoadingSpacewalkCertificate. **Verifyingcertificatelocally. **ActivatingSpacewalk. *EnablingMonitoring. *ConfiguringapacheSSLvirtualhost. Shouldsetupconfigureapache'sdefaultsslserverforyou(savesoriginalssl.conf)[Y]? *Configuringtomcat. **/etc/tomcat6/server.xmlhasbeenbackeduptoserver.xml-swsave Reversed(orprevIoUslyapplIEd)patchdetected!SkipPingpatch. 1outof1hunkignored--savingrejectstofileweb.xml.rej *Configuringjabberd. *CreatingSSLcertificates. CAcertificatepassword? Re-enterCAcertificatepassword? Organization?xzxj OrganizationUnit[sate.xzxj.edu.cn]? EmailAddress[root@localhost]? City?ShangHai State?ShangHai Countrycode(Examples:"US","JP","IN",ortype"?"toseeaList)?CN **SSL:GeneratingCAcertificate. **SSL:deployingCAcertificate. **SSL:Generatingservercertificate. **SSL:StoringSSLcertificates. *deployingconfigurationfiles. *Updateconfigurationindatabase. *SettingupCobbler.. cobblerddoesnotappeartoberunning/accessible CobblerrequirestftpandxinetdservicesbeturnedonforPXEprovisioningfunctionality.Enabletheseservices[Y]? cobblerddoesnotappeartoberunning/accessible *Restartingservices. Installationcomplete. Visithttps://sate.xzxj.edu.cntocreatetheSpacewalkadministratoraccount.
Check Spacewalk service
[root@sate~]#spacewalk-servicestatus router(pID16795)isrunning... sm(pID16802)isrunning... c2s(pID16809)isrunning... s2s(pID16816)isrunning... osa-dispatcher(pID16832)isrunning... tomcat6(pID16901)isrunning...[OK] httpd(pID17126)isrunning... 2012-03-0918:41:43Monitoring:-----------InstallSoftwareConfigSTATUS--------------- 2012-03-0918:41:44Monitoring:-----------NotifEscalatorSTATUS--------------- 2012-03-0918:41:46Monitoring:-----------GenerateNotifConfigSTATUS--------------- 2012-03-0918:41:47Monitoring:-----------NotifLauncherSTATUS--------------- 2012-03-0918:41:49Monitoring:-----------NotifIErSTATUS--------------- 2012-03-0918:41:54Monitoring:-----------AckProcessorSTATUS--------------- 2012-03-0918:41:55Monitoring:-----------TSDBLocalQueueSTATUS--------------- 2012-03-0918:42:02MonitoringScout:-----------InstallSoftwareConfigSTATUS--------------- rhn-searchisrunning(17338). cobblerd(pID17393)isrunning... RHNTaskomaticisrunning(17451).
Create the Spacewalk administrator account
650) this.width=650;" title="image" border="0" alt="image" width="644" height="328" src="http://img.jb51.cc/vcimg/static/loading.png" src="http://img1.51cto.com/attachment/201203/10/704299_13313597921Bow.png">
After created,use administrator account to access:
650) this.width=650;" title="image" border="0" alt="image" width="644" height="228" src="http://img.jb51.cc/vcimg/static/loading.png" src="http://img1.51cto.com/attachment/201203/10/704299_1331359794uE8h.png">
650) this.width=650;" border="0" alt="" src="http://img.jb51.cc/vcimg/static/loading.png" src="http://img1.51cto.com/attachment/201203/144939642.jpg">
650) this.width=650;" title="image" border="0" alt="image" height="202" src="http://img.jb51.cc/vcimg/static/loading.png" src="http://img1.51cto.com/attachment/201203/10/704299_1331359796FzrI.png">
VIEw Database information
1.List tables:
[root@sate~]#su-postgres -bash-4.1$psqlspacewalk psql(8.4.9) Type"help"forhelp. spacewalk=#\dt Listofrelations Schema|name|Type|Owner --------+--------------------------------+-------+----------- public|dual|table|spaceuser public|pxtsessions|table|spaceuser public|qrtz_blob_triggers|table|spaceuser public|qrtz_calendars|table|spaceuser public|qrtz_cron_triggers|table|spaceuser public|qrtz_fired_triggers|table|spaceuser public|qrtz_job_details|table|spaceuser public|qrtz_job_Listeners|table|spaceuser public|qrtz_locks|table|spaceuser public|qrtz_paused_trigger_grps|table|spaceuser public|qrtz_scheduler_state|table|spaceuser public|qrtz_simple_triggers|table|spaceuser public|qrtz_trigger_Listeners|table|spaceuser public|qrtz_triggers|table|spaceuser public|rhn_check_probe|table|spaceuser public|rhn_check_suite_probe|table|spaceuser public|rhn_check_suites|table|spaceuser public|rhn_command|table|spaceuser public|rhn_command_class|table|spaceuser public|rhn_command_groups|table|spaceuser public|rhn_command_param_threshold|table|spaceuser public|rhn_command_parameter|table|spaceuser public|rhn_command_queue_commands|table|spaceuser public|rhn_command_queue_execs|table|spaceuser public|rhn_command_queue_instances|table|spaceuser public|rhn_command_queue_params|table|spaceuser public|rhn_command_queue_sessions|table|spaceuser public|rhn_command_requirements|table|spaceuser public|rhn_command_target|table|spaceuser public|rhn_config_group|table|spaceuser public|rhn_config_macro|table|spaceuser public|rhn_config_parameter|table|spaceuser public|rhn_config_security_type|table|spaceuser public|rhn_contact_group_members|table|spaceuser public|rhn_contact_groups|table|spaceuser public|rhn_contact_methods|table|spaceuser public|rhn_current_state_summarIEs|table|spaceuser public|rhn_deployed_probe|table|spaceuser public|rhn_host_probe|table|spaceuser public|rhn_ll_netsaint|table|spaceuser public|rhn_method_types|table|spaceuser public|rhn_metrics|table|spaceuser public|rhn_multi_scout_threshold|table|spaceuser public|rhn_notification_formats|table|spaceuser ............ (383rows)
2.List vIEws:
spacewalk=#\dv Listofrelations Schema|name|Type|Owner --------+--------------------------------+------+----------- public|all_primary_keys|vIEw|spaceuser public|all_tab_columns|vIEw|spaceuser public|rhn_contact_monitoring|vIEw|spaceuser public|rhn_customer_monitoring|vIEw|spaceuser public|rhn_host_monitoring|vIEw|spaceuser public|rhnactionovervIEw|vIEw|spaceuser public|rhnavailablechannels|vIEw|spaceuser public|rhncddevice|vIEw|spaceuser public|rhnchannelfamilyovervIEw|vIEw|spaceuser public|rhnchannelfamilypermissions|vIEw|spaceuser public|rhnchannelfamilyserverfve|vIEw|spaceuser public|rhnchannelfamilyserverphysical|vIEw|spaceuser public|rhnchannelfamilyservers|vIEw|spaceuser public|rhnchannelfamilyservervirtual|vIEw|spaceuser public|rhnchannelnewestpackagevIEw|vIEw|spaceuser public|rhnchannelpermissions|vIEw|spaceuser public|rhnchanneltreevIEw|vIEw|spaceuser public|rhnchecksumvIEw|vIEw|spaceuser public|rhnenTitledservers|vIEw|spaceuser public|rhnhwdevice|vIEw|spaceuser public|rhnorgchannelfamilypermissions|vIEw|spaceuser public|rhnorgchanneltreevIEw|vIEw|spaceuser public|rhnorgerrata|vIEw|spaceuser public|rhnpackagechangelog|vIEw|spaceuser public|rhnserverenTitlementphysical|vIEw|spaceuser public|rhnserverenTitlementvIEw|vIEw|spaceuser public|rhnserverenTitlementvirtual|vIEw|spaceuser public|rhnservererratatypevIEw|vIEw|spaceuser public|rhnserverfeaturesvIEw|vIEw|spaceuser public|rhnserverfvecapable|vIEw|spaceuser public|rhnservergroupmembership|vIEw|spaceuser public|rhnservergroupovervIEw|vIEw|spaceuser public|rhnservergroupovlitehelper|vIEw|spaceuser public|rhnserverneedederratacache|vIEw|spaceuser public|rhnserverneededpackagecache|vIEw|spaceuser public|rhnserverneededvIEw|vIEw|spaceuser .......... (58rows)
3.List roles:
spacewalk=#\dg Listofroles Rolename|Attributes|Memberof -----------+-------------+----------- postgres|Superuser|{} :Createrole :CreateDB spaceuser|Superuser|{} :Createrole :CreateDB
4.display table info:
spacewalk-#\drhnpackage table"public.rhnpackage" Column|Type|ModifIErs -----------------+-----------------------------+------------------------ ID|numeric|notnull org_ID|numeric| name_ID|numeric|notnull evr_ID|numeric|notnull package_arch_ID|numeric|notnull package_group|numeric| rpm_version|charactervarying(16)| description|charactervarying(4000)| summary|charactervarying(4000)| package_size|numeric|notnull payload_size|numeric| build_host|charactervarying(256)| build_time|timestampwithouttimezone| source_rpm_ID|numeric| checksum_ID|numeric|notnull vendor|charactervarying(64)|notnull payload_format|charactervarying(32)| compat|smallint|default0 path|charactervarying(1000)| header_sig|charactervarying(64)| copyright|charactervarying(128)| cookie|charactervarying(128)| last_modifIEd|timestampwithtimezone|notnulldefaultNow() created|timestampwithtimezone|notnulldefaultNow() modifIEd|timestampwithtimezone|notnulldefaultNow() header_start|numeric|notnulldefault(-1) header_end|numeric|notnulldefault(-1) ................ spacewalk-#
5.query table:
spacewalk=#selectcount(*)fromrhnpackage; count ------- 4812 (1row) spacewalk=#select*fromrhn_os; recID|os_name -------+-------------- 4|linuxSystem 14|Satellite (2rows)
For more infomation about postgresql from following @R_419_6862@s:
1.PostgreSQL 8.4.11 Documentation
2.PostgreSQL examples
总结以上是内存溢出为你收集整理的Spacewalk 1.7 With PostgreSQL全部内容,希望文章能够帮你解决Spacewalk 1.7 With PostgreSQL所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)